@extrahorizon/javascript-sdk 8.10.0-dev-159-0e9a0f1 → 8.10.0-dev-161-c1dd6ca

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 (156) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/btoa.d.ts +6 -0
  3. package/build/client.d.ts +147 -0
  4. package/build/constants.d.ts +17 -0
  5. package/build/errorHandler.d.ts +1 -0
  6. package/build/errors.d.ts +361 -0
  7. package/build/http/client.d.ts +2 -0
  8. package/build/http/index.d.ts +4 -0
  9. package/build/http/interceptors.d.ts +9 -0
  10. package/build/http/oAuth1Signature.d.ts +18 -0
  11. package/build/http/oauth1.d.ts +3 -0
  12. package/build/http/oauth2.d.ts +3 -0
  13. package/build/http/proxy.d.ts +3 -0
  14. package/build/http/types.d.ts +331 -0
  15. package/build/http/utils.d.ts +21 -0
  16. package/build/index.cjs.js +1 -1
  17. package/build/index.d.ts +9 -0
  18. package/build/index.mjs +1 -1
  19. package/build/mock.d.ts +43 -0
  20. package/build/mockType.d.ts +1721 -0
  21. package/build/parseStoredCredentials.d.ts +11 -0
  22. package/build/rql/index.d.ts +16 -0
  23. package/build/rql/parser.d.ts +1 -0
  24. package/build/rql/types.d.ts +174 -0
  25. package/build/services/auth/applications/index.d.ts +5 -0
  26. package/build/services/auth/applications/types.d.ts +260 -0
  27. package/build/services/auth/index.d.ts +3 -0
  28. package/build/services/auth/oauth1/index.d.ts +5 -0
  29. package/build/services/auth/oauth1/types.d.ts +102 -0
  30. package/build/services/auth/oauth2/index.d.ts +5 -0
  31. package/build/services/auth/oauth2/types.d.ts +100 -0
  32. package/build/services/auth/oidc/index.d.ts +5 -0
  33. package/build/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  34. package/build/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  35. package/build/services/auth/oidc/providers/index.d.ts +5 -0
  36. package/build/services/auth/oidc/providers/types.d.ts +148 -0
  37. package/build/services/auth/oidc/types.d.ts +40 -0
  38. package/build/services/auth/types.d.ts +39 -0
  39. package/build/services/auth/users/index.d.ts +5 -0
  40. package/build/services/auth/users/types.d.ts +121 -0
  41. package/build/services/configurations/general.d.ts +5 -0
  42. package/build/services/configurations/groups.d.ts +5 -0
  43. package/build/services/configurations/index.d.ts +10 -0
  44. package/build/services/configurations/patients.d.ts +5 -0
  45. package/build/services/configurations/staff.d.ts +5 -0
  46. package/build/services/configurations/types.d.ts +222 -0
  47. package/build/services/configurations/users.d.ts +5 -0
  48. package/build/services/data/comments.d.ts +5 -0
  49. package/build/services/data/documents.d.ts +5 -0
  50. package/build/services/data/index.d.ts +13 -0
  51. package/build/services/data/indexes.d.ts +5 -0
  52. package/build/services/data/infrastructure.d.ts +10 -0
  53. package/build/services/data/json-schema.d.ts +121 -0
  54. package/build/services/data/properties.d.ts +5 -0
  55. package/build/services/data/schemas.d.ts +5 -0
  56. package/build/services/data/statuses.d.ts +5 -0
  57. package/build/services/data/transitions.d.ts +5 -0
  58. package/build/services/data/types.d.ts +1500 -0
  59. package/build/services/dispatchers/actions/index.d.ts +5 -0
  60. package/build/services/dispatchers/actions/types.d.ts +78 -0
  61. package/build/services/dispatchers/dispatchers/index.d.ts +5 -0
  62. package/build/services/dispatchers/dispatchers/types.d.ts +111 -0
  63. package/build/services/dispatchers/index.d.ts +7 -0
  64. package/build/services/dispatchers/types.d.ts +2 -0
  65. package/build/services/events/events.d.ts +5 -0
  66. package/build/services/events/index.d.ts +5 -0
  67. package/build/services/events/subscriptions.d.ts +5 -0
  68. package/build/services/events/types.d.ts +107 -0
  69. package/build/services/files/files.d.ts +5 -0
  70. package/build/services/files/formHelpers.d.ts +3 -0
  71. package/build/services/files/index.d.ts +6 -0
  72. package/build/services/files/settings/index.d.ts +5 -0
  73. package/build/services/files/settings/types.d.ts +38 -0
  74. package/build/services/files/tokens.d.ts +5 -0
  75. package/build/services/files/types.d.ts +185 -0
  76. package/build/services/helpers.d.ts +7 -0
  77. package/build/services/http-client.d.ts +22 -0
  78. package/build/services/index.d.ts +16 -0
  79. package/build/services/localizations/countries.d.ts +5 -0
  80. package/build/services/localizations/index.d.ts +3 -0
  81. package/build/services/localizations/languages.d.ts +5 -0
  82. package/build/services/localizations/localizations.d.ts +5 -0
  83. package/build/services/localizations/types.d.ts +150 -0
  84. package/build/services/logs/access/index.d.ts +5 -0
  85. package/build/services/logs/access/types.d.ts +41 -0
  86. package/build/services/logs/index.d.ts +3 -0
  87. package/build/services/logs/types.d.ts +4 -0
  88. package/build/services/mails/index.d.ts +3 -0
  89. package/build/services/mails/mails.d.ts +5 -0
  90. package/build/services/mails/types.d.ts +149 -0
  91. package/build/services/notifications/index.d.ts +6 -0
  92. package/build/services/notifications/notifications.d.ts +5 -0
  93. package/build/services/notifications/settings.d.ts +5 -0
  94. package/build/services/notifications/types.d.ts +235 -0
  95. package/build/services/notificationsV2/index.d.ts +6 -0
  96. package/build/services/notificationsV2/notificationsV2.d.ts +5 -0
  97. package/build/services/notificationsV2/types.d.ts +166 -0
  98. package/build/services/notificationsV2/userSettings/index.d.ts +5 -0
  99. package/build/services/notificationsV2/userSettings/types.d.ts +138 -0
  100. package/build/services/payments/appStore.d.ts +5 -0
  101. package/build/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/services/payments/health.d.ts +9 -0
  103. package/build/services/payments/index.d.ts +15 -0
  104. package/build/services/payments/orders.d.ts +5 -0
  105. package/build/services/payments/playStore.d.ts +5 -0
  106. package/build/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/services/payments/products.d.ts +5 -0
  109. package/build/services/payments/stripe.d.ts +5 -0
  110. package/build/services/payments/subscriptions.d.ts +5 -0
  111. package/build/services/payments/types.d.ts +1198 -0
  112. package/build/services/profiles/groups.d.ts +5 -0
  113. package/build/services/profiles/index.d.ts +8 -0
  114. package/build/services/profiles/logs.d.ts +5 -0
  115. package/build/services/profiles/profiles.d.ts +5 -0
  116. package/build/services/profiles/types.d.ts +375 -0
  117. package/build/services/tasks/api/index.d.ts +5 -0
  118. package/build/services/tasks/api/types.d.ts +146 -0
  119. package/build/services/tasks/apiRequests/index.d.ts +5 -0
  120. package/build/services/tasks/apiRequests/logs/index.d.ts +5 -0
  121. package/build/services/tasks/apiRequests/logs/types.d.ts +25 -0
  122. package/build/services/tasks/apiRequests/types.d.ts +83 -0
  123. package/build/services/tasks/functions/index.d.ts +5 -0
  124. package/build/services/tasks/functions/types.d.ts +171 -0
  125. package/build/services/tasks/index.d.ts +15 -0
  126. package/build/services/tasks/logs/index.d.ts +5 -0
  127. package/build/services/tasks/logs/types.d.ts +28 -0
  128. package/build/services/tasks/schedules/index.d.ts +5 -0
  129. package/build/services/tasks/schedules/types.d.ts +92 -0
  130. package/build/services/tasks/tasks.d.ts +5 -0
  131. package/build/services/tasks/types.d.ts +118 -0
  132. package/build/services/templates/index.d.ts +3 -0
  133. package/build/services/templates/templates.d.ts +5 -0
  134. package/build/services/templates/types.d.ts +237 -0
  135. package/build/services/templatesV2/index.d.ts +3 -0
  136. package/build/services/templatesV2/templatesV2.d.ts +5 -0
  137. package/build/services/templatesV2/types.d.ts +156 -0
  138. package/build/services/types.d.ts +103 -0
  139. package/build/services/users/activationRequests/index.d.ts +4 -0
  140. package/build/services/users/activationRequests/types.d.ts +70 -0
  141. package/build/services/users/forgotPasswordRequests/index.d.ts +4 -0
  142. package/build/services/users/forgotPasswordRequests/types.d.ts +70 -0
  143. package/build/services/users/globalRoles.d.ts +5 -0
  144. package/build/services/users/groupRoles.d.ts +5 -0
  145. package/build/services/users/index.d.ts +14 -0
  146. package/build/services/users/settings/index.d.ts +4 -0
  147. package/build/services/users/settings/types.d.ts +47 -0
  148. package/build/services/users/types.d.ts +1278 -0
  149. package/build/services/users/users.d.ts +5 -0
  150. package/build/sha1.d.ts +11 -0
  151. package/build/types/services/users/types.d.ts +69 -25
  152. package/build/types/version.d.ts +1 -1
  153. package/build/types.d.ts +104 -0
  154. package/build/utils.d.ts +5 -0
  155. package/build/version.d.ts +1 -0
  156. package/package.json +3 -3
@@ -0,0 +1,100 @@
1
+ import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
+ export interface AuthOauth2Service {
3
+ tokens: AuthOauth2TokenService;
4
+ /**
5
+ * Create an OAuth2 authorization
6
+ *
7
+ * Permission | Scope | Effect
8
+ * - | - | -
9
+ * none | | Everyone can use this endpoint
10
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/post_oauth2_authorizations
11
+ * @throws {ApplicationUnknownError}
12
+ * @throws {CallbackNotValidError}
13
+ * @throws {UnsupportedResponseTypeError}
14
+ */
15
+ createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2Authorization>;
16
+ /**
17
+ * Get a list of OAuth2 Authorizations
18
+ *
19
+ * Permission | Scope | Effect
20
+ * - | - | -
21
+ * VIEW_AUTHORIZATIONS | global | **Required** for this endpoint
22
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/get_oauth2_authorizations
23
+ */
24
+ getAuthorizations(options?: OptionsWithRql): Promise<PagedResult<OAuth2Authorization>>;
25
+ /**
26
+ * Delete an OAuth2 Authorization
27
+ *
28
+ * Permission | Scope | Effect
29
+ * - | - | -
30
+ * DELETE_AUTHORIZATIONS | global | **Required** for this endpoint
31
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/delete_oauth2_authorizations__authorizationId_
32
+ * @throws {ResourceUnknownError}
33
+ */
34
+ deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
35
+ }
36
+ export interface AuthOauth2TokenService {
37
+ /**
38
+ * Get a list of OAuth2 tokens
39
+ *
40
+ * Permission | Scope | Effect
41
+ * - | - | -
42
+ * none | | Can only see a list of OAuth2 tokens for this account
43
+ * VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
44
+ */
45
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth2Token>>;
46
+ /**
47
+ * Get the first OAuth2 token found
48
+ *
49
+ * Permission | Scope | Effect
50
+ * - | - | -
51
+ * none | | Can only see a list of OAuth2 tokens for this account
52
+ * VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
53
+ */
54
+ findFirst(options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
55
+ /**
56
+ * Get an oAuth2 token by its id
57
+ *
58
+ * Permission | Scope | Effect
59
+ * - | - | -
60
+ * none | | Can only see a list of OAuth2 tokens for this account
61
+ * VIEW_AUTHORIZATIONS | global | Can see a list of OAuth2 tokens for any account
62
+ */
63
+ findById(id: string, options?: OptionsWithRql): Promise<OAuth2Token | undefined>;
64
+ /**
65
+ * Remove an oAuth2 token
66
+ *
67
+ * Permission | Scope | Effect
68
+ * - | - | -
69
+ * DELETE_AUTHORIZATIONS | | Required for this endpoint
70
+ */
71
+ remove(id: string): Promise<AffectedRecords>;
72
+ }
73
+ export interface OAuth2AuthorizationCreation {
74
+ responseType: string;
75
+ clientId: string;
76
+ redirectUri: string;
77
+ state: string;
78
+ scope: string;
79
+ }
80
+ export interface OAuth2Authorization {
81
+ id: string;
82
+ userId: string;
83
+ clientId: string;
84
+ authorizationCode: string;
85
+ state: string;
86
+ /** The timestamp when the authorization was last updated */
87
+ updateTimestamp?: Date;
88
+ /** The timestamp when the authorization was created */
89
+ creationTimestamp?: Date;
90
+ }
91
+ export interface OAuth2Token {
92
+ id: string;
93
+ applicationId: string;
94
+ userId: string;
95
+ refreshTokenId: string;
96
+ accessToken: string;
97
+ expiryTimestamp: Date;
98
+ updateTimestamp: Date;
99
+ creationTimestamp: Date;
100
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../types';
2
+ import { HttpClient } from '../../http-client';
3
+ import { OidcService } from './types';
4
+ declare const _default: (oidcClient: HttpClient, httpWithAuth: HttpInstance) => OidcService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { LoginAttemptsService } from './types';
4
+ declare const _default: (oidcClient: HttpClient, httpWithAuth: HttpInstance) => LoginAttemptsService;
5
+ export default _default;
@@ -0,0 +1,67 @@
1
+ import { FindAllIterator } from '../../../helpers';
2
+ import { OptionsWithRql, PagedResultWithPager } from '../../../types';
3
+ export interface LoginAttemptsService {
4
+ /**
5
+ * ## Retrieve a paged list of login attempts
6
+ *
7
+ * **Global Permissions:**
8
+ * - `VIEW_OIDC_LOGIN_ATTEMPTS` - Allows a user to view login attempts
9
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
10
+ * @returns A paged list of login attempts {@link PagedResultWithPager PagedResultWithPager<LoginAttempt>}
11
+ */
12
+ find(options?: OptionsWithRql): Promise<PagedResultWithPager<LoginAttempt>>;
13
+ /**
14
+ * ## Retrieve a list of all login attempts
15
+ *
16
+ * **Global Permissions:**
17
+ * - `VIEW_OIDC_LOGIN_ATTEMPTS` - Allows a user to view login attempts
18
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
19
+ * @returns An array of login attempts {@link LoginAttempt LoginAttempt[]}
20
+ * @throws {@link Error} Do not pass in limit operator with findAll
21
+ */
22
+ findAll(options?: OptionsWithRql): Promise<LoginAttempt[]>;
23
+ /**
24
+ * ## Retrieve a paged list of login attempts
25
+ *
26
+ * **Global Permissions:**
27
+ * - `VIEW_OIDC_LOGIN_ATTEMPTS` - Allows a user to view login attempts
28
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
29
+ * @returns An iterator for the queried login attempts {@link FindAllIterator FindAllIterator<LoginAttempt>}
30
+ */
31
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<LoginAttempt>;
32
+ /**
33
+ * ## Retrieve the first queried login attempt
34
+ *
35
+ * **Global Permissions:**
36
+ * - `VIEW_OIDC_LOGIN_ATTEMPTS` - Allows a user to view login attempts
37
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
38
+ * @returns The first element of the queried login attempts {@link LoginAttempt}
39
+ */
40
+ findFirst(options?: OptionsWithRql): Promise<LoginAttempt | undefined>;
41
+ }
42
+ export declare enum LoginAttemptStatus {
43
+ SUCCESS = "success",
44
+ FAILED = "failed"
45
+ }
46
+ export interface LoginAttempt {
47
+ /** The Extra Horizon document id */
48
+ id: string;
49
+ /** The (success / failed) status of a login attempt. */
50
+ status: LoginAttemptStatus;
51
+ /** The id of the provider */
52
+ providerId: string;
53
+ /** The unique name of the provider */
54
+ providerName: string;
55
+ /** The subject id (sub) of the user for the given provider */
56
+ providerSubjectId: string;
57
+ /** The Extra Horizon user id */
58
+ userId: string;
59
+ /** An Extra Horizon formatted error for failed requests */
60
+ error: {
61
+ name: string;
62
+ message: string;
63
+ code: number;
64
+ };
65
+ /** The date and time of the login attempt */
66
+ creationTimestamp: Date;
67
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { OidcProviderService } from './types';
4
+ declare const _default: (oidcClient: HttpClient, httpWithAuth: HttpInstance) => OidcProviderService;
5
+ export default _default;
@@ -0,0 +1,148 @@
1
+ import { FindAllIterator } from '../../../helpers';
2
+ import { AffectedRecords, OptionsWithRql, PagedResultWithPager } from '../../../types';
3
+ export interface OidcProviderService {
4
+ /**
5
+ * ## Create a new OpenID Connect Provider
6
+ * ### You can use this function to create a new OpenId Connect Provider to enable Single Sign On.
7
+ *
8
+ * **Global Permissions:**
9
+ * `CREATE_OIDC_PROVIDER` - Allows a user to create a new OpenID Connect Provider
10
+ *
11
+ * @param body {@link OidcProviderCreation}
12
+ * @returns OidcProvider {@link OidcProvider}
13
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
14
+ * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
15
+ */
16
+ create(body: OidcProviderCreation): Promise<OidcProvider>;
17
+ /**
18
+ * ## Retrieve a paged list of OpenID Connect providers
19
+ *
20
+ * **Global Permissions:**
21
+ * - `VIEW_OIDC_PROVIDERS` - Allows a user to view OpenID Connect providers
22
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
23
+ * @returns A paged list of providers {@link PagedResultWithPager PagedResultWithPager<OidcProvider>}
24
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
25
+ */
26
+ find(options?: OptionsWithRql): Promise<PagedResultWithPager<OidcProvider>>;
27
+ /**
28
+ * ## Retrieve a list of all OpenID Connect providers
29
+ *
30
+ * **Global Permissions:**
31
+ * - `VIEW_OIDC_PROVIDERS` - Allows a user to view OpenID Connect providers
32
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
33
+ * @returns An array of providers {@link OidcProvider OidcProvider[]}
34
+ * @throws {@link Error} Do not pass in limit operator with findAll
35
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
36
+ */
37
+ findAll(options?: OptionsWithRql): Promise<OidcProvider[]>;
38
+ /**
39
+ * ## Retrieve a paged list of OpenID Connect providers
40
+ *
41
+ * **Global Permissions:**
42
+ * - `VIEW_OIDC_PROVIDERS` - Allows a user to view OpenID Connect providers
43
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
44
+ * @returns An iterator for the queried providers {@link FindAllIterator FindAllIterator<OidcProvider>}
45
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
46
+ */
47
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<OidcProvider>;
48
+ /**
49
+ * ## Retrieve the first queried OpenID Connect provider
50
+ *
51
+ * **Global Permissions:**
52
+ * - `VIEW_OIDC_PROVIDERS` - Allows a user to view OpenID Connect providers
53
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
54
+ * @returns The first element of the queried providers {@link OidcProvider}
55
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
56
+ */
57
+ findFirst(options?: OptionsWithRql): Promise<OidcProvider | undefined>;
58
+ /**
59
+ * ## Update an OpenID Connect provider
60
+ * ### You can use this function to update an existing OpenId Connect Provider. Fields left undefined will not be updated.
61
+ *
62
+ * **Global Permissions:**
63
+ * - `UPDATE_OIDC_PROVIDER` - Allows a user to update an OpenID Connect provider
64
+ *
65
+ * @param providerId {@link string} - The Extra Horizon provider id
66
+ * @param body {@link OidcProviderUpdate} - The set of updatable fields for an existing provider
67
+ * @returns An affected records promise {@link AffectedRecords}
68
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
69
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
70
+ * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
71
+ */
72
+ update(providerId: string, body: OidcProviderUpdate): Promise<AffectedRecords>;
73
+ /**
74
+ * ## Delete an OpenID Connect provider
75
+ * ### You can use this function to delete an existing OpenId Connect provider.
76
+ *
77
+ * **Global Permissions:**
78
+ * - `DELETE_OIDC_PROVIDER` - Allows a user to delete an OpenID Connect provider
79
+ *
80
+ * @param providerId {@link string} - The Extra Horizon provider id
81
+ * @returns An affected records response {@link AffectedRecords}
82
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
83
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
84
+ * @throws {@link IllegalStateError} when the provider is enabled (Only disabled providers can be removed) or when there are still users linked to this provider.
85
+ */
86
+ remove(providerId: string): Promise<AffectedRecords>;
87
+ /**
88
+ * @deprecated Use `remove` instead.
89
+ */
90
+ delete(providerId: string): Promise<AffectedRecords>;
91
+ /**
92
+ * ## Enable an OpenID Connect provider
93
+ *
94
+ * **Global Permissions:**
95
+ * - `UPDATE_OIDC_PROVIDER` - Allows a user to update an OpenID Connect provider
96
+ *
97
+ * @param providerId {@link string} - The Extra Horizon provider id
98
+ * @returns An affected records response {@link AffectedRecords}
99
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
100
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
101
+ */
102
+ enable(providerId: string): Promise<AffectedRecords>;
103
+ /**
104
+ * ## Disable an OpenID Connect provider
105
+ *
106
+ * **Global Permissions:**
107
+ * - `UPDATE_OIDC_PROVIDER` - Allows a user to update an OpenID Connect provider
108
+ *
109
+ * @param providerId - The Extra Horizon provider id
110
+ * @returns An affected records response {@link AffectedRecords}
111
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
112
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
113
+ */
114
+ disable(providerId: string): Promise<AffectedRecords>;
115
+ }
116
+ export interface OidcProvider {
117
+ /** A 24 character long hexadecimal value acting as the identifier of an OpenId Connect provider */
118
+ id: string;
119
+ /** Human friendly name of the provider, which can also be used in the oidc login url. Then name can be between 3 and 40 characters and match pattern: '/^[a-zA-Z0-9_-]+$/' */
120
+ name: string;
121
+ /** Description of the provider. With a maximum of 256 characters */
122
+ description: string;
123
+ /** Provided by the OpenID Connect provider after registration. With a maximum of 2048 characters */
124
+ clientId: string;
125
+ /** A URL of maximum 2048 charactes that acts as a unique identifier for the provider. `Issuer` in the provider's discovery document. */
126
+ issuerId: string;
127
+ /** A URL of maximum 2048 character that points to the provider’s URL for authorising the user (i.e., signing the user in). authorization_endpoint in the provider's discovery document. */
128
+ authorizationEndpoint: string;
129
+ /** A URL of maximum 2048 character that points to the provider’s OAuth 2.0 protected URL from which user information can be obtained. token_endpoint in the provider's discovery document. */
130
+ tokenEndpoint: string;
131
+ /** A URL of maximum 2048 character that points to the provider’s endpoint of the authorization server Extra Horizon can use to obtain the email address and optionally also the family name and given name. userinfo_endpoint in the provider's discovery document. */
132
+ userinfoEndpoint: string;
133
+ /** A URL of maximum 2048 character that points to the location where the authorization server sends the user once the app has been successfully authorised and granted an authorization code or access token */
134
+ redirectUri: string;
135
+ /** Indicates wether the OpenID Connect provider is active and can be used for SSO */
136
+ enabled: boolean;
137
+ /** The last four characters of the client secret */
138
+ clientSecretHint: string;
139
+ /** The creation timestamp of the OpenID Connectprovider */
140
+ creationTimestamp: Date;
141
+ /** The update timestamp of the OpenID Connect provider */
142
+ updateTimestamp: Date;
143
+ }
144
+ export interface OidcProviderCreation extends Required<Pick<OidcProvider, 'name' | 'description' | 'clientId' | 'authorizationEndpoint' | 'redirectUri' | 'tokenEndpoint' | 'userinfoEndpoint' | 'issuerId'>> {
145
+ /** The OAuth 2.0 Client Secret you received from your provider. Max 2048 characters */
146
+ clientSecret: string;
147
+ }
148
+ export declare type OidcProviderUpdate = Partial<OidcProviderCreation>;
@@ -0,0 +1,40 @@
1
+ import { AffectedRecords } from '../../types';
2
+ import { LoginAttemptsService } from './loginAttempts/types';
3
+ import { OidcProviderService } from './providers/types';
4
+ export * from './loginAttempts/types';
5
+ export * from './providers/types';
6
+ export interface OidcService {
7
+ /**
8
+ * ## Link the authenticated user to a provider
9
+ * ### You can use this function to link the currently logged-in user to a registered provider.
10
+ *
11
+ * **Default Permissions:**
12
+ * - Any authenticated user can execute this function.
13
+ *
14
+ * @param providerName {@link string} The name of the OpenID Connect provider to link the user to
15
+ * @param data {@link OidcLinkRequestBody} - The link to OpenID Connect provider data
16
+ * @returns An affected records response {@link AffectedRecords}
17
+ * @throws {@link IllegalStateError} when the provider is disabled. The provider must be enabled to link a user.
18
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerName.
19
+ */
20
+ linkUserToOidcProvider(providerName: string, data: OidcLinkRequestBody): Promise<AffectedRecords>;
21
+ /**
22
+ * ## Unlink a user from OpenID Connect
23
+ * ### You can use this function to unlink a user from an OpenId Connect Provider.
24
+ *
25
+ * **Global Permissions:**
26
+ * - `UNLINK_USER_FROM_OIDC` - Allows a user to unlink users from OpenID Connect
27
+ *
28
+ * @param userId {@link string} - The Extra Horizon id of the user to be unlinked from OpenID Connect
29
+ * @returns An affected records response {@link AffectedRecords}
30
+ */
31
+ unlinkUserFromOidc(userId: string): Promise<AffectedRecords>;
32
+ providers: OidcProviderService;
33
+ loginAttempts: LoginAttemptsService;
34
+ }
35
+ export interface OidcLinkRequestBody {
36
+ /** ### The users Extra Horizon presence token - Obtained from {@link AuthService.confirmPresence confirmPresence} */
37
+ presenceToken: string;
38
+ /** ### Obtained from the OpenID Connect application upon successful user login. */
39
+ authorizationCode: string;
40
+ }
@@ -0,0 +1,39 @@
1
+ import { OptionsBase } from '../types';
2
+ import { AuthApplicationsService } from './applications/types';
3
+ import { AuthOauth1Service } from './oauth1/types';
4
+ import { AuthOauth2Service } from './oauth2/types';
5
+ import { OidcService } from './oidc/types';
6
+ import { AuthUsersService } from './users/types';
7
+ export * from './applications/types';
8
+ export * from './oauth1/types';
9
+ export * from './oauth2/types';
10
+ export * from './oidc/types';
11
+ export * from './users/types';
12
+ export interface AuthService {
13
+ /**
14
+ * # Applications
15
+ * Applications represent mobile apps, web apps, web services or scripts that can communicate with the Extra Horizon API.
16
+ *
17
+ * ### Default applications
18
+ * When launching a new cluster two default applications are already created for you:
19
+ *
20
+ * **ExH Control center**: An oAuth2 app that gives our control center (available on [app.extrahorizon.com](app.extrahorizon.com)) the ability to communicate with your cluster. You as an admin can use this app to explore and manage your cluster.
21
+ *
22
+ * **CLI**: An oAuth1.0 application that you can use when installing our CLI in order to send configurations to your cluster. Credentials are provided to your cluster manager during onboarding.
23
+ */
24
+ applications: AuthApplicationsService;
25
+ oauth2: AuthOauth2Service;
26
+ oauth1: AuthOauth1Service;
27
+ users: AuthUsersService;
28
+ oidc: OidcService;
29
+ confirmPresence(data: {
30
+ password: string;
31
+ }, options?: OptionsBase): Promise<Presence>;
32
+ health(): Promise<boolean>;
33
+ }
34
+ export { AuthApplicationsService };
35
+ export interface Presence {
36
+ token: string;
37
+ updateTimestamp: Date;
38
+ creationTimestamp: Date;
39
+ }
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../../types';
2
+ import { HttpClient } from '../../http-client';
3
+ import type { AuthUsersService } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthUsersService;
5
+ export default _default;
@@ -0,0 +1,121 @@
1
+ import { AffectedRecords, OptionsBase } from '../../types';
2
+ export interface AuthUsersService {
3
+ /**
4
+ * View the MFA settings of a user (or create the settings if they have none)
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | See your own MFA settings
9
+ * `VIEW_USER_MFA_SETTINGS` | global | See anyone their MFA settings
10
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/get_mfa_users__userId_
11
+ */
12
+ getMfaSetting(userId: string, options?: OptionsBase): Promise<MfaSetting>;
13
+ /**
14
+ * Enable MFA for a user
15
+ *
16
+ * Permission | Scope | Effect
17
+ * - | - | -
18
+ * none | | Enable MFA for your own account
19
+ * `UPDATE_USER_MFA_SETTINGS` | global | Enable MFA for any account
20
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/post_mfa_users__userId__enable
21
+ * @throws {InvalidPresenceTokenError}
22
+ * @throws {NotEnoughMfaMethodsError}
23
+ */
24
+ enableMfa(userId: string, data: PresenceToken, options?: OptionsBase): Promise<AffectedRecords>;
25
+ /**
26
+ * Disable MFA for a user
27
+ *
28
+ * Permission | Scope | Effect
29
+ * - | - | -
30
+ * none | | Disable MFA for your own account
31
+ * `UPDATE_USER_MFA_SETTINGS` | global | Enable MFA for any account
32
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/post_mfa_users__userId__disable
33
+ * @throws {InvalidPresenceTokenError}
34
+ */
35
+ disableMfa(userId: string, data: PresenceToken, options?: OptionsBase): Promise<AffectedRecords>;
36
+ /**
37
+ * Add a MFA method to a user
38
+ *
39
+ * Permission | Scope | Effect
40
+ * - | - | -
41
+ * none | | Add a MFA method to your user
42
+ * `UPDATE_USER_MFA_SETTINGS` | global | Enable MFA for any account
43
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/post_mfa_users__userId__disable
44
+ * @throws {InvalidPresenceTokenError}
45
+ */
46
+ addMfaMethod<T extends RecoveryCodesMethodCreation | TotpMethodCreation>(userId: string, data: T, options?: OptionsBase): Promise<T extends RecoveryCodesMethodCreation ? RecoveryCodesMethod : TotpMethod>;
47
+ /**
48
+ * Confirm the correct functioning of a MFA method
49
+ *
50
+ * Permission | Scope | Effect
51
+ * - | - | -
52
+ * none | | Confirm a MFA method for your user
53
+ * `UPDATE_USER_MFA_SETTINGS` | global | Confirm a MFA method for any user
54
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/post_mfa_users__userId__methods__methodId__verification_confirm
55
+ * @throws {ResourceUnknownError}
56
+ * @throws {IllegalArgumentError}
57
+ * @throws {InvalidMfaCodeError}
58
+ * @throws {InvalidPresenceTokenError}
59
+ */
60
+ confirmMfaMethodVerification(userId: string, methodId: string, data: MfaMethodVerification, options?: OptionsBase): Promise<{
61
+ description: string;
62
+ }>;
63
+ /**
64
+ * Remove a MFA method from a user
65
+ *
66
+ * Permission | Scope | Effect
67
+ * - | - | -
68
+ * none | | Remove a MFA method for your user
69
+ * `UPDATE_USER_MFA_SETTINGS` | global | Enable MFA for any account
70
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/MFA/post_mfa_users__userId__methods__methodId__remove
71
+ * @throws {NotEnoughMfaMethodsError}
72
+ * @throws {InvalidPresenceTokenError}
73
+ */
74
+ removeMfaMethod(userId: string, methodId: string, data: PresenceToken, options?: OptionsBase): Promise<AffectedRecords>;
75
+ }
76
+ export interface RecoveryCodesMethod {
77
+ id: string;
78
+ name: string;
79
+ tags: string[];
80
+ verified: boolean;
81
+ type: 'recoveryCodes';
82
+ codes: string[];
83
+ updateTimestamp: Date;
84
+ creationTimestamp: Date;
85
+ }
86
+ export interface TotpMethod {
87
+ id: string;
88
+ name: string;
89
+ tags: string[];
90
+ verified: boolean;
91
+ type: 'totp';
92
+ secret: string;
93
+ updateTimestamp: Date;
94
+ creationTimestamp: Date;
95
+ }
96
+ export declare type MfaMethod = RecoveryCodesMethod | TotpMethod;
97
+ export interface MfaSetting {
98
+ id: string;
99
+ methods: [MfaMethod];
100
+ enabled: boolean;
101
+ updateTimestamp: Date;
102
+ }
103
+ interface MfaMethodCreationBase {
104
+ presenceToken: string;
105
+ name?: string;
106
+ tags?: string[];
107
+ }
108
+ export interface RecoveryCodesMethodCreation extends MfaMethodCreationBase {
109
+ type: 'recoveryCodes';
110
+ }
111
+ export interface TotpMethodCreation extends MfaMethodCreationBase {
112
+ type: 'totp';
113
+ }
114
+ export interface MfaMethodVerification {
115
+ presenceToken: string;
116
+ code: string;
117
+ }
118
+ export interface PresenceToken {
119
+ presenceToken: string;
120
+ }
121
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { ConfigurationsGeneralService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ConfigurationsGeneralService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { ConfigurationsGroupsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ConfigurationsGroupsService;
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { ConfigurationsGeneralService, ConfigurationsGroupsService, ConfigurationsPatientsService, ConfigurationsStaffService, ConfigurationsUsersService } from './types';
3
+ export declare type ConfigurationsService = {
4
+ general: ConfigurationsGeneralService;
5
+ groups: ConfigurationsGroupsService;
6
+ users: ConfigurationsUsersService;
7
+ patients: ConfigurationsPatientsService;
8
+ staff: ConfigurationsStaffService;
9
+ };
10
+ export declare const configurationsService: (httpWithAuth: HttpInstance) => ConfigurationsService;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { ConfigurationsPatientsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ConfigurationsPatientsService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { ConfigurationsStaffService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ConfigurationsStaffService;
5
+ export default _default;