@extrahorizon/javascript-sdk 8.2.0-test

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 (153) hide show
  1. package/CHANGELOG.md +1161 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -0
  4. package/build/index.cjs.js +1 -0
  5. package/build/index.mjs +1 -0
  6. package/build/types/btoa.d.ts +6 -0
  7. package/build/types/client.d.ts +136 -0
  8. package/build/types/constants.d.ts +15 -0
  9. package/build/types/errorHandler.d.ts +2 -0
  10. package/build/types/errors.d.ts +332 -0
  11. package/build/types/http/client.d.ts +2 -0
  12. package/build/types/http/index.d.ts +4 -0
  13. package/build/types/http/interceptors.d.ts +9 -0
  14. package/build/types/http/oAuth1Signature.d.ts +14 -0
  15. package/build/types/http/oauth1.d.ts +3 -0
  16. package/build/types/http/oauth2.d.ts +3 -0
  17. package/build/types/http/proxy.d.ts +3 -0
  18. package/build/types/http/types.d.ts +331 -0
  19. package/build/types/http/utils.d.ts +21 -0
  20. package/build/types/index.d.ts +9 -0
  21. package/build/types/mock.d.ts +43 -0
  22. package/build/types/mockType.d.ts +1511 -0
  23. package/build/types/parseStoredCredentials.d.ts +11 -0
  24. package/build/types/rql/index.d.ts +16 -0
  25. package/build/types/rql/parser.d.ts +1 -0
  26. package/build/types/rql/types.d.ts +168 -0
  27. package/build/types/services/auth/applications/index.d.ts +5 -0
  28. package/build/types/services/auth/applications/types.d.ts +190 -0
  29. package/build/types/services/auth/index.d.ts +3 -0
  30. package/build/types/services/auth/oauth1/index.d.ts +5 -0
  31. package/build/types/services/auth/oauth1/types.d.ts +63 -0
  32. package/build/types/services/auth/oauth2/index.d.ts +5 -0
  33. package/build/types/services/auth/oauth2/types.d.ts +52 -0
  34. package/build/types/services/auth/oidc/index.d.ts +5 -0
  35. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  36. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  37. package/build/types/services/auth/oidc/providers/index.d.ts +5 -0
  38. package/build/types/services/auth/oidc/providers/types.d.ts +144 -0
  39. package/build/types/services/auth/oidc/types.d.ts +40 -0
  40. package/build/types/services/auth/types.d.ts +39 -0
  41. package/build/types/services/auth/users/index.d.ts +5 -0
  42. package/build/types/services/auth/users/types.d.ts +121 -0
  43. package/build/types/services/configurations/general.d.ts +5 -0
  44. package/build/types/services/configurations/groups.d.ts +5 -0
  45. package/build/types/services/configurations/index.d.ts +10 -0
  46. package/build/types/services/configurations/patients.d.ts +5 -0
  47. package/build/types/services/configurations/staff.d.ts +5 -0
  48. package/build/types/services/configurations/types.d.ts +222 -0
  49. package/build/types/services/configurations/users.d.ts +5 -0
  50. package/build/types/services/data/comments.d.ts +5 -0
  51. package/build/types/services/data/documents.d.ts +5 -0
  52. package/build/types/services/data/index.d.ts +13 -0
  53. package/build/types/services/data/indexes.d.ts +5 -0
  54. package/build/types/services/data/infrastructure.d.ts +10 -0
  55. package/build/types/services/data/json-schema.d.ts +121 -0
  56. package/build/types/services/data/properties.d.ts +5 -0
  57. package/build/types/services/data/schemas.d.ts +5 -0
  58. package/build/types/services/data/statuses.d.ts +5 -0
  59. package/build/types/services/data/transitions.d.ts +5 -0
  60. package/build/types/services/data/types.d.ts +899 -0
  61. package/build/types/services/dispatchers/actions/index.d.ts +5 -0
  62. package/build/types/services/dispatchers/actions/types.d.ts +78 -0
  63. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -0
  64. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -0
  65. package/build/types/services/dispatchers/index.d.ts +7 -0
  66. package/build/types/services/dispatchers/types.d.ts +2 -0
  67. package/build/types/services/events/events.d.ts +5 -0
  68. package/build/types/services/events/health.d.ts +9 -0
  69. package/build/types/services/events/index.d.ts +6 -0
  70. package/build/types/services/events/subscriptions.d.ts +5 -0
  71. package/build/types/services/events/types.d.ts +90 -0
  72. package/build/types/services/files/files.d.ts +5 -0
  73. package/build/types/services/files/formHelpers.d.ts +3 -0
  74. package/build/types/services/files/index.d.ts +6 -0
  75. package/build/types/services/files/settings/index.d.ts +5 -0
  76. package/build/types/services/files/settings/types.d.ts +38 -0
  77. package/build/types/services/files/tokens.d.ts +5 -0
  78. package/build/types/services/files/types.d.ts +185 -0
  79. package/build/types/services/helpers.d.ts +7 -0
  80. package/build/types/services/http-client.d.ts +22 -0
  81. package/build/types/services/index.d.ts +15 -0
  82. package/build/types/services/localizations/countries.d.ts +5 -0
  83. package/build/types/services/localizations/health.d.ts +9 -0
  84. package/build/types/services/localizations/index.d.ts +4 -0
  85. package/build/types/services/localizations/languages.d.ts +5 -0
  86. package/build/types/services/localizations/localizations.d.ts +5 -0
  87. package/build/types/services/localizations/types.d.ts +145 -0
  88. package/build/types/services/logs/access/index.d.ts +5 -0
  89. package/build/types/services/logs/access/types.d.ts +41 -0
  90. package/build/types/services/logs/index.d.ts +3 -0
  91. package/build/types/services/logs/types.d.ts +4 -0
  92. package/build/types/services/mails/index.d.ts +3 -0
  93. package/build/types/services/mails/mails.d.ts +5 -0
  94. package/build/types/services/mails/types.d.ts +141 -0
  95. package/build/types/services/notifications/health.d.ts +9 -0
  96. package/build/types/services/notifications/index.d.ts +7 -0
  97. package/build/types/services/notifications/notifications.d.ts +5 -0
  98. package/build/types/services/notifications/settings.d.ts +5 -0
  99. package/build/types/services/notifications/types.d.ts +222 -0
  100. package/build/types/services/payments/appStore.d.ts +5 -0
  101. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/types/services/payments/health.d.ts +9 -0
  103. package/build/types/services/payments/index.d.ts +15 -0
  104. package/build/types/services/payments/orders.d.ts +5 -0
  105. package/build/types/services/payments/playStore.d.ts +5 -0
  106. package/build/types/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/types/services/payments/products.d.ts +5 -0
  109. package/build/types/services/payments/stripe.d.ts +5 -0
  110. package/build/types/services/payments/subscriptions.d.ts +5 -0
  111. package/build/types/services/payments/types.d.ts +1189 -0
  112. package/build/types/services/profiles/groups.d.ts +5 -0
  113. package/build/types/services/profiles/health.d.ts +9 -0
  114. package/build/types/services/profiles/index.d.ts +9 -0
  115. package/build/types/services/profiles/logs.d.ts +5 -0
  116. package/build/types/services/profiles/profiles.d.ts +5 -0
  117. package/build/types/services/profiles/types.d.ts +369 -0
  118. package/build/types/services/tasks/api/index.d.ts +5 -0
  119. package/build/types/services/tasks/api/types.d.ts +146 -0
  120. package/build/types/services/tasks/apiRequests/index.d.ts +5 -0
  121. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -0
  122. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -0
  123. package/build/types/services/tasks/apiRequests/types.d.ts +83 -0
  124. package/build/types/services/tasks/functions/index.d.ts +5 -0
  125. package/build/types/services/tasks/functions/types.d.ts +27 -0
  126. package/build/types/services/tasks/index.d.ts +15 -0
  127. package/build/types/services/tasks/logs/index.d.ts +5 -0
  128. package/build/types/services/tasks/logs/types.d.ts +28 -0
  129. package/build/types/services/tasks/schedules/index.d.ts +5 -0
  130. package/build/types/services/tasks/schedules/types.d.ts +88 -0
  131. package/build/types/services/tasks/tasks.d.ts +5 -0
  132. package/build/types/services/tasks/types.d.ts +107 -0
  133. package/build/types/services/templates/index.d.ts +3 -0
  134. package/build/types/services/templates/templates.d.ts +5 -0
  135. package/build/types/services/templates/types.d.ts +202 -0
  136. package/build/types/services/types.d.ts +77 -0
  137. package/build/types/services/users/activationRequests/index.d.ts +4 -0
  138. package/build/types/services/users/activationRequests/types.d.ts +70 -0
  139. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -0
  140. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -0
  141. package/build/types/services/users/globalRoles.d.ts +5 -0
  142. package/build/types/services/users/groupRoles.d.ts +5 -0
  143. package/build/types/services/users/health.d.ts +9 -0
  144. package/build/types/services/users/index.d.ts +16 -0
  145. package/build/types/services/users/settings/index.d.ts +4 -0
  146. package/build/types/services/users/settings/types.d.ts +47 -0
  147. package/build/types/services/users/types.d.ts +1055 -0
  148. package/build/types/services/users/users.d.ts +5 -0
  149. package/build/types/sha1.d.ts +11 -0
  150. package/build/types/types.d.ts +102 -0
  151. package/build/types/utils.d.ts +4 -0
  152. package/build/types/version.d.ts +1 -0
  153. package/package.json +57 -0
@@ -0,0 +1,144 @@
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>;
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
+ delete(providerId: string): Promise<AffectedRecords>;
87
+ /**
88
+ * ## Enable an OpenID Connect provider
89
+ *
90
+ * **Global Permissions:**
91
+ * - `UPDATE_OIDC_PROVIDER` - Allows a user to update an OpenID Connect provider
92
+ *
93
+ * @param providerId {@link string} - The Extra Horizon provider id
94
+ * @returns An affected records response {@link AffectedRecords}
95
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
96
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
97
+ */
98
+ enable(providerId: string): Promise<AffectedRecords>;
99
+ /**
100
+ * ## Disable an OpenID Connect provider
101
+ *
102
+ * **Global Permissions:**
103
+ * - `UPDATE_OIDC_PROVIDER` - Allows a user to update an OpenID Connect provider
104
+ *
105
+ * @param providerId - The Extra Horizon provider id
106
+ * @returns An affected records response {@link AffectedRecords}
107
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
108
+ * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
109
+ */
110
+ disable(providerId: string): Promise<AffectedRecords>;
111
+ }
112
+ export interface OidcProvider {
113
+ /** A 24 character long hexadecimal value acting as the identifier of an OpenId Connect provider */
114
+ id: string;
115
+ /** 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_-]+$/' */
116
+ name: string;
117
+ /** Description of the provider. With a maximum of 256 characters */
118
+ description: string;
119
+ /** Provided by the OpenID Connect provider after registration. With a maximum of 2048 characters */
120
+ clientId: string;
121
+ /** A URL of maximum 2048 charactes that acts as a unique identifier for the provider. `Issuer` in the provider's discovery document. */
122
+ issuerId: string;
123
+ /** 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. */
124
+ authorizationEndpoint: string;
125
+ /** 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. */
126
+ tokenEndpoint: string;
127
+ /** 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. */
128
+ userinfoEndpoint: string;
129
+ /** 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 */
130
+ redirectUri: string;
131
+ /** Indicates wether the OpenID Connect provider is active and can be used for SSO */
132
+ enabled: boolean;
133
+ /** The last four characters of the client secret */
134
+ clientSecretHint: string;
135
+ /** The creation timestamp of the OpenID Connectprovider */
136
+ creationTimestamp: Date;
137
+ /** The update timestamp of the OpenID Connect provider */
138
+ updateTimestamp: Date;
139
+ }
140
+ export interface OidcProviderCreation extends Required<Pick<OidcProvider, 'name' | 'description' | 'clientId' | 'authorizationEndpoint' | 'redirectUri' | 'tokenEndpoint' | 'userinfoEndpoint' | 'issuerId'>> {
141
+ /** The OAuth 2.0 Client Secret you received from your provider. Max 2048 characters */
142
+ clientSecret: string;
143
+ }
144
+ 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;
@@ -0,0 +1,222 @@
1
+ import { Entity, Timestamps, ObjectId, AffectedRecords, OptionsBase, OptionsWithRql } from '../types';
2
+ export declare type Configuration = Record<string, any>;
3
+ export interface GeneralConfigurationInput {
4
+ data: Configuration;
5
+ staffConfiguration: Configuration;
6
+ patientConfiguration: Configuration;
7
+ groupConfiguration?: Configuration;
8
+ userConfiguration?: Configuration;
9
+ }
10
+ export declare type GeneralConfiguration = GeneralConfigurationInput & Entity & Timestamps;
11
+ export interface GroupConfigurationInput {
12
+ data?: Configuration;
13
+ staffConfiguration?: Configuration;
14
+ patientConfiguration?: Configuration;
15
+ }
16
+ export declare type GroupConfiguration = GroupConfigurationInput & Entity & Timestamps;
17
+ export interface UserConfigurationInput {
18
+ data: Configuration;
19
+ }
20
+ export interface UserEnlistments {
21
+ staffConfigurations?: Array<EnlistmentConfiguration>;
22
+ patientConfigurations?: Array<EnlistmentConfiguration>;
23
+ }
24
+ export interface EnlistmentConfiguration {
25
+ groupId: ObjectId;
26
+ data: Configuration;
27
+ }
28
+ export declare type UserConfiguration = UserConfigurationInput & UserEnlistments & Entity & Timestamps;
29
+ export interface ConfigurationsGeneralService {
30
+ /**
31
+ * View the general configuration.
32
+ *
33
+ * Permission | Scope | Effect
34
+ * - | - | -
35
+ * none | | Everyone can use this endpoint
36
+ * @returns GeneralConfiguration
37
+ */
38
+ get(options?: OptionsBase): Promise<GeneralConfiguration>;
39
+ /**
40
+ * Update the general configuration
41
+ *
42
+ * Permission | Scope | Effect
43
+ * - | - | -
44
+ * `UPDATE_CONFIGURATIONS` | `global` | Required for this endpoint
45
+ * @param requestBody GeneralConfigurationInput
46
+ * @param rql Add filters to the requested list.
47
+ * @returns AffectedRecords
48
+ */
49
+ update(requestBody: GeneralConfigurationInput, options?: OptionsWithRql): Promise<AffectedRecords>;
50
+ /**
51
+ * Delete fields from the general configuration.
52
+ *
53
+ * Permission | Scope | Effect
54
+ * - | - | -
55
+ * `UPDATE_CONFIGURATIONS` | `global` | Required for this endpoint
56
+ * @param requestBody list of fields to remove
57
+ * @param rql Add filters to the requested list.
58
+ * @returns AffectedRecords
59
+ */
60
+ removeFields(requestBody: {
61
+ fields: Array<string>;
62
+ }, options?: OptionsWithRql): Promise<AffectedRecords>;
63
+ }
64
+ export interface ConfigurationsGroupsService {
65
+ /**
66
+ * View a group configuration
67
+ *
68
+ * Permission | Scope | Effect
69
+ * - | - | -
70
+ * `VIEW_PATIENT_CONFIGURATIONS` | `staff enlistment` | View the group its patient configuration
71
+ * `VIEW_STAFF_CONFIGURATIONS` | `staff enlistment` | View the group its staff configuration
72
+ * `VIEW_CONFIGURATIONS` | `staff enlistment` | View the group its full configuration
73
+ * `VIEW_CONFIGURATIONS` | `global` | View any group its full configuration
74
+ * @param groupId The id of the targeted group
75
+ * @returns GroupConfiguration
76
+ */
77
+ get(groupId: ObjectId, options?: OptionsBase): Promise<GroupConfiguration>;
78
+ /**
79
+ * Update a group configuration.
80
+ *
81
+ * Permission | Scope | Effect
82
+ * - | - | -
83
+ * `UPDATE_PATIENT_CONFIGURATIONS` | `staff enlistment` | Update the group its patient configuration
84
+ * `UPDATE_STAFF_CONFIGURATIONS` | `staff enlistment` | Update the group its staff configuration
85
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | Update the group its full configuration
86
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any group its full configuration
87
+ * @param groupId The id of the targeted group
88
+ * @param requestBody GroupConfigurationInput
89
+ * @param rql Add filters to the requested list.
90
+ * @returns AffectedRecords
91
+ */
92
+ update(groupId: ObjectId, requestBody: GroupConfigurationInput, options?: OptionsWithRql): Promise<AffectedRecords>;
93
+ /**
94
+ * Delete fields from a group configuration.
95
+ *
96
+ * Permission | Scope | Effect
97
+ * - | - | -
98
+ * `UPDATE_PATIENT_CONFIGURATIONS` | `staff enlistment` | Update the group its patient configuration
99
+ * `UPDATE_STAFF_CONFIGURATIONS` | `staff enlistment` | Update the group its staff configuration
100
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | Update the group its full configuration
101
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any group its full configuration
102
+ * @param groupId The id of the targeted group
103
+ * @param requestBody the list of fields to remove
104
+ * @param rql Add filters to the requested list.
105
+ * @returns AffectedRecords
106
+ */
107
+ removeFields(groupId: ObjectId, requestBody: {
108
+ fields: Array<string>;
109
+ }, options?: OptionsWithRql): Promise<AffectedRecords>;
110
+ }
111
+ export interface ConfigurationsPatientsService {
112
+ /**
113
+ * Update a patient configuration for a group of a user.
114
+ *
115
+ * Permission | Scope | Effect
116
+ * - | - | -
117
+ * `UPDATE_PATIENT_CONFIGURATIONS` | `staff enlistment` | For patients of the group, update the patient enlistment configuration of the group
118
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | For patients of the group, update the patient enlistment configuration of the group
119
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user its staff configuration
120
+ * @param groupId The id of the targeted group
121
+ * @param userId The id of the targeted user
122
+ * @param requestBody UserConfigurationInput
123
+ * @returns AffectedRecords
124
+ */
125
+ update(groupId: ObjectId, userId: ObjectId, requestBody: Partial<UserConfigurationInput>, options?: OptionsBase): Promise<AffectedRecords>;
126
+ /**
127
+ * Delete fields from a patient configuration for a group of a user.
128
+ *
129
+ * Permission | Scope | Effect
130
+ * - | - | -
131
+ * `UPDATE_PATIENT_CONFIGURATIONS` | `staff enlistment` | For patients of the group, update the patient enlistment configuration of the group
132
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | For patients of the group, update the patient enlistment configuration of the group
133
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user its staff configuration
134
+ * @param groupId The id of the targeted group
135
+ * @param userId The id of the targeted user
136
+ * @param requestBody the list of fields to remove
137
+ * @returns AffectedRecords
138
+ */
139
+ removeFields(groupId: ObjectId, userId: ObjectId, requestBody: {
140
+ fields: Array<string>;
141
+ }, options?: OptionsBase): Promise<AffectedRecords>;
142
+ }
143
+ export interface ConfigurationsStaffService {
144
+ /**
145
+ * Update a staff configuration for a group of a user.
146
+ *
147
+ * Permission | Scope | Effect
148
+ * - | - | -
149
+ * `UPDATE_STAFF_CONFIGURATIONS` | `staff enlistment` | For staff of the group, update the staff enlistment configuration of the group
150
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | For staff of the group, update the staff enlistment configuration of the group
151
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user its staff configuration
152
+ * @param groupId The id of the targeted group
153
+ * @param userId The id of the targeted user
154
+ * @param requestBody UserConfigurationInput
155
+ * @returns AffectedRecords
156
+ */
157
+ update(groupId: ObjectId, userId: ObjectId, requestBody: Partial<UserConfigurationInput>, options?: OptionsBase): Promise<AffectedRecords>;
158
+ /**
159
+ * Delete fields from a staff configuration for a group of a user.
160
+ *
161
+ * Permission | Scope | Effect
162
+ * - | - | -
163
+ * `UPDATE_STAFF_CONFIGURATIONS` | `staff enlistment` | For staff of the group, update the staff enlistment configuration of the group
164
+ * `UPDATE_CONFIGURATIONS` | `staff enlistment` | For staff of the group, update the staff enlistment configuration of the group
165
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user its staff configuration
166
+ * @param groupId The id of the targeted group
167
+ * @param userId The id of the targeted user
168
+ * @param requestBody the list of fields to remove
169
+ * @returns AffectedRecords
170
+ */
171
+ removeFields(groupId: ObjectId, userId: ObjectId, requestBody: {
172
+ fields: Array<string>;
173
+ }, options?: OptionsBase): Promise<AffectedRecords>;
174
+ }
175
+ export interface ConfigurationsUsersService {
176
+ /**
177
+ * Get a user configuration
178
+ *
179
+ * Permission | Scope | Effect
180
+ * - | - | -
181
+ * none | | View your own configuration
182
+ * `VIEW_PATIENT_CONFIGURATIONS` | `staff enlistment` | For patients of the group, view the patient enlistment configuration of the group
183
+ * `VIEW_STAFF_CONFIGURATIONS` | `staff enlistment` | For staff of the group, view the staff enlistment configuration of the group
184
+ * `VIEW_CONFIGURATIONS` | `staff enlistment` | view the patient enlistment configuration of the group
185
+ * `VIEW_CONFIGURATIONS` | `global` | View any user its full configuration
186
+ * @param userId The id of the targeted user
187
+ * @returns UserConfiguration
188
+ */
189
+ get(userId: ObjectId, options?: OptionsBase): Promise<UserConfiguration>;
190
+ /**
191
+ * Update a user configuration
192
+ *
193
+ * Only the `data` content
194
+ *
195
+ * Permission | Scope | Effect
196
+ * - | - | -
197
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user configuration
198
+ * none | | Update your own configuration
199
+ * @param userId The id of the targeted user
200
+ * @param requestBody UserConfigurationInput
201
+ * @param rql Add filters to the requested list.
202
+ * @returns AffectedRecords
203
+ */
204
+ update(userId: ObjectId, requestBody: Partial<UserConfigurationInput>, options?: OptionsWithRql): Promise<AffectedRecords>;
205
+ /**
206
+ * Delete fields from a user configuration
207
+ *
208
+ * Only from the `data` field
209
+ *
210
+ * Permission | Scope | Effect
211
+ * - | - | -
212
+ * `UPDATE_CONFIGURATIONS` | `global` | Update any user configuration
213
+ * none | | Update your own configuration
214
+ * @param userId The id of the targeted user
215
+ * @param requestBody the list of fields to remove
216
+ * @param rql Add filters to the requested list
217
+ * @returns AffectedRecords
218
+ */
219
+ removeFields(userId: ObjectId, requestBody: {
220
+ fields: Array<string>;
221
+ }, options?: OptionsWithRql): Promise<AffectedRecords>;
222
+ }
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import type { ConfigurationsUsersService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ConfigurationsUsersService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { DataCommentsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => DataCommentsService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { DataDocumentsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => DataDocumentsService;
5
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import infrastructure from './infrastructure';
3
+ import { DataCommentsService, DataDocumentsService, DataIndexesService, DataPropertiesService, DataSchemasService, DataStatusesService, DataTransitionsService } from './types';
4
+ export declare type DataService = ReturnType<typeof infrastructure> & {
5
+ schemas: DataSchemasService;
6
+ indexes: DataIndexesService;
7
+ statuses: DataStatusesService;
8
+ properties: DataPropertiesService;
9
+ comments: DataCommentsService;
10
+ documents: DataDocumentsService;
11
+ transitions: DataTransitionsService;
12
+ };
13
+ export declare const dataService: (httpWithAuth: HttpInstance) => DataService;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { DataIndexesService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => DataIndexesService;
5
+ export default _default;