@extrahorizon/javascript-sdk 8.2.0 → 8.2.1-dev-49-61b4511

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +1182 -1161
  2. package/README.md +108 -119
  3. package/build/index.cjs.js +1 -1
  4. package/build/index.mjs +1 -1
  5. package/build/types/btoa.d.ts +6 -6
  6. package/build/types/client.d.ts +136 -136
  7. package/build/types/constants.d.ts +15 -15
  8. package/build/types/errorHandler.d.ts +2 -2
  9. package/build/types/errors.d.ts +332 -332
  10. package/build/types/http/client.d.ts +2 -2
  11. package/build/types/http/index.d.ts +4 -4
  12. package/build/types/http/interceptors.d.ts +9 -9
  13. package/build/types/http/oAuth1Signature.d.ts +14 -14
  14. package/build/types/http/oauth1.d.ts +3 -3
  15. package/build/types/http/oauth2.d.ts +3 -3
  16. package/build/types/http/proxy.d.ts +3 -3
  17. package/build/types/http/types.d.ts +331 -331
  18. package/build/types/http/utils.d.ts +21 -21
  19. package/build/types/index.d.ts +9 -9
  20. package/build/types/mock.d.ts +43 -43
  21. package/build/types/mockType.d.ts +1547 -1511
  22. package/build/types/parseStoredCredentials.d.ts +11 -11
  23. package/build/types/rql/index.d.ts +16 -16
  24. package/build/types/rql/parser.d.ts +1 -1
  25. package/build/types/rql/types.d.ts +168 -168
  26. package/build/types/services/auth/applications/index.d.ts +5 -5
  27. package/build/types/services/auth/applications/types.d.ts +260 -190
  28. package/build/types/services/auth/index.d.ts +3 -3
  29. package/build/types/services/auth/oauth1/index.d.ts +5 -5
  30. package/build/types/services/auth/oauth1/types.d.ts +63 -63
  31. package/build/types/services/auth/oauth2/index.d.ts +5 -5
  32. package/build/types/services/auth/oauth2/types.d.ts +52 -52
  33. package/build/types/services/auth/oidc/index.d.ts +5 -5
  34. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -5
  35. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -67
  36. package/build/types/services/auth/oidc/providers/index.d.ts +5 -5
  37. package/build/types/services/auth/oidc/providers/types.d.ts +144 -144
  38. package/build/types/services/auth/oidc/types.d.ts +40 -40
  39. package/build/types/services/auth/types.d.ts +39 -39
  40. package/build/types/services/auth/users/index.d.ts +5 -5
  41. package/build/types/services/auth/users/types.d.ts +121 -121
  42. package/build/types/services/configurations/general.d.ts +5 -5
  43. package/build/types/services/configurations/groups.d.ts +5 -5
  44. package/build/types/services/configurations/index.d.ts +10 -10
  45. package/build/types/services/configurations/patients.d.ts +5 -5
  46. package/build/types/services/configurations/staff.d.ts +5 -5
  47. package/build/types/services/configurations/types.d.ts +222 -222
  48. package/build/types/services/configurations/users.d.ts +5 -5
  49. package/build/types/services/data/comments.d.ts +5 -5
  50. package/build/types/services/data/documents.d.ts +5 -5
  51. package/build/types/services/data/index.d.ts +13 -13
  52. package/build/types/services/data/indexes.d.ts +5 -5
  53. package/build/types/services/data/infrastructure.d.ts +10 -10
  54. package/build/types/services/data/json-schema.d.ts +121 -121
  55. package/build/types/services/data/properties.d.ts +5 -5
  56. package/build/types/services/data/schemas.d.ts +5 -5
  57. package/build/types/services/data/statuses.d.ts +5 -5
  58. package/build/types/services/data/transitions.d.ts +5 -5
  59. package/build/types/services/data/types.d.ts +899 -899
  60. package/build/types/services/dispatchers/actions/index.d.ts +5 -5
  61. package/build/types/services/dispatchers/actions/types.d.ts +78 -78
  62. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -5
  63. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -111
  64. package/build/types/services/dispatchers/index.d.ts +7 -7
  65. package/build/types/services/dispatchers/types.d.ts +2 -2
  66. package/build/types/services/events/events.d.ts +5 -5
  67. package/build/types/services/events/health.d.ts +9 -9
  68. package/build/types/services/events/index.d.ts +6 -6
  69. package/build/types/services/events/subscriptions.d.ts +5 -5
  70. package/build/types/services/events/types.d.ts +90 -90
  71. package/build/types/services/files/files.d.ts +5 -5
  72. package/build/types/services/files/formHelpers.d.ts +3 -3
  73. package/build/types/services/files/index.d.ts +6 -6
  74. package/build/types/services/files/settings/index.d.ts +5 -5
  75. package/build/types/services/files/settings/types.d.ts +38 -38
  76. package/build/types/services/files/tokens.d.ts +5 -5
  77. package/build/types/services/files/types.d.ts +185 -185
  78. package/build/types/services/helpers.d.ts +7 -7
  79. package/build/types/services/http-client.d.ts +22 -22
  80. package/build/types/services/index.d.ts +15 -15
  81. package/build/types/services/localizations/countries.d.ts +5 -5
  82. package/build/types/services/localizations/health.d.ts +9 -9
  83. package/build/types/services/localizations/index.d.ts +4 -4
  84. package/build/types/services/localizations/languages.d.ts +5 -5
  85. package/build/types/services/localizations/localizations.d.ts +5 -5
  86. package/build/types/services/localizations/types.d.ts +145 -145
  87. package/build/types/services/logs/access/index.d.ts +5 -5
  88. package/build/types/services/logs/access/types.d.ts +41 -41
  89. package/build/types/services/logs/index.d.ts +3 -3
  90. package/build/types/services/logs/types.d.ts +4 -4
  91. package/build/types/services/mails/index.d.ts +3 -3
  92. package/build/types/services/mails/mails.d.ts +5 -5
  93. package/build/types/services/mails/types.d.ts +141 -141
  94. package/build/types/services/notifications/health.d.ts +9 -9
  95. package/build/types/services/notifications/index.d.ts +7 -7
  96. package/build/types/services/notifications/notifications.d.ts +5 -5
  97. package/build/types/services/notifications/settings.d.ts +5 -5
  98. package/build/types/services/notifications/types.d.ts +222 -222
  99. package/build/types/services/payments/appStore.d.ts +5 -5
  100. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -5
  101. package/build/types/services/payments/health.d.ts +9 -9
  102. package/build/types/services/payments/index.d.ts +15 -15
  103. package/build/types/services/payments/orders.d.ts +5 -5
  104. package/build/types/services/payments/playStore.d.ts +5 -5
  105. package/build/types/services/payments/playStoreHistory.d.ts +5 -5
  106. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -5
  107. package/build/types/services/payments/products.d.ts +5 -5
  108. package/build/types/services/payments/stripe.d.ts +5 -5
  109. package/build/types/services/payments/subscriptions.d.ts +5 -5
  110. package/build/types/services/payments/types.d.ts +1189 -1189
  111. package/build/types/services/profiles/groups.d.ts +5 -5
  112. package/build/types/services/profiles/health.d.ts +9 -9
  113. package/build/types/services/profiles/index.d.ts +9 -9
  114. package/build/types/services/profiles/logs.d.ts +5 -5
  115. package/build/types/services/profiles/profiles.d.ts +5 -5
  116. package/build/types/services/profiles/types.d.ts +370 -369
  117. package/build/types/services/tasks/api/index.d.ts +5 -5
  118. package/build/types/services/tasks/api/types.d.ts +146 -146
  119. package/build/types/services/tasks/apiRequests/index.d.ts +5 -5
  120. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -5
  121. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -25
  122. package/build/types/services/tasks/apiRequests/types.d.ts +83 -83
  123. package/build/types/services/tasks/functions/index.d.ts +5 -5
  124. package/build/types/services/tasks/functions/types.d.ts +27 -27
  125. package/build/types/services/tasks/index.d.ts +15 -15
  126. package/build/types/services/tasks/logs/index.d.ts +5 -5
  127. package/build/types/services/tasks/logs/types.d.ts +28 -28
  128. package/build/types/services/tasks/schedules/index.d.ts +5 -5
  129. package/build/types/services/tasks/schedules/types.d.ts +88 -88
  130. package/build/types/services/tasks/tasks.d.ts +5 -5
  131. package/build/types/services/tasks/types.d.ts +107 -107
  132. package/build/types/services/templates/index.d.ts +3 -3
  133. package/build/types/services/templates/templates.d.ts +5 -5
  134. package/build/types/services/templates/types.d.ts +202 -202
  135. package/build/types/services/types.d.ts +77 -77
  136. package/build/types/services/users/activationRequests/index.d.ts +4 -4
  137. package/build/types/services/users/activationRequests/types.d.ts +70 -70
  138. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -4
  139. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -70
  140. package/build/types/services/users/globalRoles.d.ts +5 -5
  141. package/build/types/services/users/groupRoles.d.ts +5 -5
  142. package/build/types/services/users/health.d.ts +9 -9
  143. package/build/types/services/users/index.d.ts +16 -16
  144. package/build/types/services/users/settings/index.d.ts +4 -4
  145. package/build/types/services/users/settings/types.d.ts +47 -47
  146. package/build/types/services/users/types.d.ts +1202 -1055
  147. package/build/types/services/users/users.d.ts +5 -5
  148. package/build/types/sha1.d.ts +11 -11
  149. package/build/types/types.d.ts +102 -102
  150. package/build/types/utils.d.ts +4 -4
  151. package/build/types/version.d.ts +1 -1
  152. package/package.json +62 -62
@@ -1,52 +1,52 @@
1
- import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
- export interface AuthOauth2Service {
3
- /**
4
- * Create an OAuth2 authorization
5
- *
6
- * Permission | Scope | Effect
7
- * - | - | -
8
- * none | | Everyone can use this endpoint
9
- * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/post_oauth2_authorizations
10
- * @throws {ApplicationUnknownError}
11
- * @throws {CallbackNotValidError}
12
- * @throws {UnsupportedResponseTypeError}
13
- */
14
- createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2Authorization>;
15
- /**
16
- * Get a list of OAuth2 Authorizations
17
- *
18
- * Permission | Scope | Effect
19
- * - | - | -
20
- * VIEW_AUTHORIZATIONS | global | **Required** for this endpoint
21
- * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/get_oauth2_authorizations
22
- */
23
- getAuthorizations(options?: OptionsWithRql): Promise<PagedResult<OAuth2Authorization>>;
24
- /**
25
- * Delete an OAuth2 Authorization
26
- *
27
- * Permission | Scope | Effect
28
- * - | - | -
29
- * DELETE_AUTHORIZATIONS | global | **Required** for this endpoint
30
- * @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_
31
- * @throws {ResourceUnknownError}
32
- */
33
- deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
34
- }
35
- export interface OAuth2AuthorizationCreation {
36
- responseType: string;
37
- clientId: string;
38
- redirectUri: string;
39
- state: string;
40
- scope: string;
41
- }
42
- export interface OAuth2Authorization {
43
- id: string;
44
- userId: string;
45
- clientId: string;
46
- authorizationCode: string;
47
- state: string;
48
- /** The timestamp when the authorization was last updated */
49
- updateTimestamp?: Date;
50
- /** The timestamp when the authorization was created */
51
- creationTimestamp?: Date;
52
- }
1
+ import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
2
+ export interface AuthOauth2Service {
3
+ /**
4
+ * Create an OAuth2 authorization
5
+ *
6
+ * Permission | Scope | Effect
7
+ * - | - | -
8
+ * none | | Everyone can use this endpoint
9
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/post_oauth2_authorizations
10
+ * @throws {ApplicationUnknownError}
11
+ * @throws {CallbackNotValidError}
12
+ * @throws {UnsupportedResponseTypeError}
13
+ */
14
+ createAuthorization(data: OAuth2AuthorizationCreation, options?: OptionsBase): Promise<OAuth2Authorization>;
15
+ /**
16
+ * Get a list of OAuth2 Authorizations
17
+ *
18
+ * Permission | Scope | Effect
19
+ * - | - | -
20
+ * VIEW_AUTHORIZATIONS | global | **Required** for this endpoint
21
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth2/get_oauth2_authorizations
22
+ */
23
+ getAuthorizations(options?: OptionsWithRql): Promise<PagedResult<OAuth2Authorization>>;
24
+ /**
25
+ * Delete an OAuth2 Authorization
26
+ *
27
+ * Permission | Scope | Effect
28
+ * - | - | -
29
+ * DELETE_AUTHORIZATIONS | global | **Required** for this endpoint
30
+ * @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_
31
+ * @throws {ResourceUnknownError}
32
+ */
33
+ deleteAuthorization(authorizationId: string, options?: OptionsWithRql): Promise<AffectedRecords>;
34
+ }
35
+ export interface OAuth2AuthorizationCreation {
36
+ responseType: string;
37
+ clientId: string;
38
+ redirectUri: string;
39
+ state: string;
40
+ scope: string;
41
+ }
42
+ export interface OAuth2Authorization {
43
+ id: string;
44
+ userId: string;
45
+ clientId: string;
46
+ authorizationCode: string;
47
+ state: string;
48
+ /** The timestamp when the authorization was last updated */
49
+ updateTimestamp?: Date;
50
+ /** The timestamp when the authorization was created */
51
+ creationTimestamp?: Date;
52
+ }
@@ -1,5 +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;
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;
@@ -1,5 +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;
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;
@@ -1,67 +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>;
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
- }
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>;
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
+ }
@@ -1,5 +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;
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;
@@ -1,144 +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>;
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>;