@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,190 +1,260 @@
1
- import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../../types';
2
- export interface AuthApplicationsService {
3
- /**
4
- * ## Create a new application
5
- * You can use this function to create a new `oAuth1` or `oAuth2` application.
6
- *
7
- * You need permissions to use this function.
8
- *
9
- * #### Global Permissions
10
- * `CREATE_APPLICATIONS` - Provides the ability to create new applications.
11
- *
12
- * @param data {@link OAuth1ApplicationCreation} or {@link OAuth2ApplicationCreation}
13
- * @returns The newly created {@link OAuth1Application} or {@link OAuth2Application}.
14
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
15
- * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
16
- */
17
- create<T extends OAuth1ApplicationCreation | OAuth2ApplicationCreation>(data: T, options?: OptionsBase): Promise<T extends OAuth1ApplicationCreation ? OAuth1Application : OAuth2Application>;
18
- /**
19
- * ## Get a list of applications
20
- * Provides a paginated list of applications currently registered in the cluster.
21
- *
22
- * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type').
23
- *
24
- * #### Global Permissions
25
- * `VIEW_APPLICATIONS` - Returns all applications fields
26
- *
27
- * #### Function details
28
- * @param options {@link OptionsWithRql} addional options with rql that can be set for your request to the cluster.
29
- *
30
- * @returns Provides a paginated list of applications currently registered in the cluster.
31
- *
32
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
33
- * */
34
- get(options?: OptionsWithRql): Promise<PagedResult<OAuth1Application | OAuth2Application>>;
35
- /**
36
- * ## Update an existing application
37
- * You can use this function to update an existing `oAuth1` or `oAuth2` application.
38
- *
39
- * You need permissions to use this function.
40
- *
41
- * #### Global Permissions
42
- * `UPDATE_APPLICATIONS` - Provides the ability to update existing applications.
43
- *
44
- * #### Function details
45
- * @param applicationId A hexadecimal identifier of 24 characters of the application you want to update.
46
- * @param data {@link OAuth1ApplicationUpdate} or {@link OAuth2ApplicationUpdate} containing the fields you want to update.
47
- * The fields that are left undefined will not be updated.
48
- * @param options {@link OptionsBase} addional options that can be set for your request to the cluster.
49
- *
50
- * @returns {Promise} A Promise with the number of affected records.
51
- *
52
- * @throws {@link ResourceUnknownError} when no application is found for the specified application Id.
53
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
54
- * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
55
- */
56
- update<T extends OAuth1ApplicationUpdate | OAuth2ApplicationUpdate>(applicationId: string, data: T, options?: OptionsBase): Promise<AffectedRecords>;
57
- /**
58
- * ## Delete an application
59
- * You can use this function to remove an existing `oAuth1` or `oAuth2` application.
60
- *
61
- * You need permissions to use this function.
62
- *
63
- * #### Global permisions
64
- * `DELETE_APPLICATIONS` - Provides the ability to remove the applications.
65
- *
66
- * #### Function details
67
- * @param applicationId A hexadecimal identifier of 24 characters of the application you want to remove.
68
- * @param options {@link OptionsBase} addional options that can be set for your request to the cluster.
69
- *
70
- * @returns {Promise} A Promise with the number of affected records.
71
- *
72
- * @throws {@link ResourceUnknownError} when no application is found for the specified application Id.
73
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
74
- */
75
- remove(applicationId: string, options?: OptionsBase): Promise<AffectedRecords>;
76
- /**
77
- * ## Create an application version
78
- * You can use this function to create a new application version.
79
- *
80
- * You need permissions to use this function.
81
- *
82
- * #### Global permissions
83
- * `CREATE_APPLICATIONS`- Provides the ability to create new application versions.
84
- *
85
- * #### Function details
86
- * @param applicationId A hexadecimal identifier of 24 characters of the application.
87
- * @param data An {@link ApplicationVersionCreation} object
88
- * @param options {@link OptionsBase} addional options that can be set for your request to the cluster.
89
- *
90
- * @returns The newly created {@link OAuth1ApplicationVersion} or {@link OAuth2ApplicationVersion}.
91
- *
92
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
93
- * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
94
- */
95
- createVersion(applicationId: string, data: ApplicationVersionCreation, options?: OptionsBase): Promise<ApplicationVersion>;
96
- /**
97
- * ## Delete an application version
98
- * You can use this function to remove an existing appliction version.
99
- *
100
- * When you remove an application version users with existing oAuth1 tokens trying to communicate with the cluster will receive a `OAUTH_KEY_EXCEPTION`.
101
- * In case of oAuth2 tokens users will receive a `OAUTH2_CLIENT_ID_EXCEPTION` when trying to use their refresh token to get new access tokens.
102
- * You can use the error's above to force users to switch to a newer version of your applications in case the backend no longer recoginizes them.
103
- *
104
- * You need permissions to execute this function
105
- *
106
- * #### Global permissions
107
- * `DELETE_APPLICATIONS` - Provides the ability to remove application versions.
108
- *
109
- * #### Function details
110
- * @param applicationId A hexadecimal identifier of 24 characters of the application.
111
- * @param versionId the version Identifier or `name` of the application version.
112
- * @param options {@link OptionsBase} addional options that can be set for your request to the cluster.
113
- *
114
- * @returns {Promise} A Promise with the number of affected records.
115
- *
116
- * @throws {ResourceUnknownError} when the specified application or version could not be found
117
- * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
118
- */
119
- deleteVersion(applicationId: string, versionId: string, options?: OptionsBase): Promise<AffectedRecords>;
120
- }
121
- /**
122
- * @name Application
123
- */
124
- export interface Application {
125
- /** A 24 character long hexadecimal value acting as the identifier of your application */
126
- id: string;
127
- /** The name of your application. A minimum 1 and maximm of 100 characters is accepted */
128
- name: string;
129
- /** A Description of your application. A minimum 1 and maximm of 250 characters is accepted */
130
- description: string;
131
- /** The timestamp when the application was last updated */
132
- updateTimestamp: Date;
133
- /** The timestamp when the application was created */
134
- creationTimestamp: Date;
135
- }
136
- export interface OAuth1Application extends Application {
137
- /** type of the application */
138
- type: ApplicationType.oauth1;
139
- /** A List cointaining the different versions of the application */
140
- versions?: OAuth1ApplicationVersion[];
141
- }
142
- export interface OAuth2Application extends Application {
143
- /** type of the application */
144
- type: ApplicationType.oauth2;
145
- /** A List containing the different versions of the application */
146
- versions?: OAuth2ApplicationVersion[];
147
- /**
148
- * @deprecated
149
- * The logo of the application. Can be used in the oAuth2.0 authorization code grant to indicate the user what application he is authorizing.
150
- * A hexadecimal value with a minimum of 1 and maximum of 100 characters is allowed.
151
- * */
152
- logo?: string;
153
- /** A list of approved uri's that can be used when authenticating with [an authorization code grant flow](https://www.rfc-editor.org/rfc/rfc6749#section-1.3.1). Can only be used in an oAuth2 application type. A minimum of 1 uri and maximum 50 uri's can be provided. This field is required upon creation to the application */
154
- redirectUris?: string[];
155
- /**
156
- * Defines wether your application should be considered a confidential app according to the [oAuth2.0 spec](https://www.rfc-editor.org/rfc/rfc6749). If not provided upon creation this value defaults to false.
157
- */
158
- confidential: boolean;
159
- }
160
- export declare enum ApplicationType {
161
- oauth1 = "oauth1",
162
- oauth2 = "oauth2"
163
- }
164
- export declare type ApplicationCreation = Required<Pick<Application, 'name' | 'description'>>;
165
- export declare type OAuth1ApplicationCreation = ApplicationCreation & Required<Pick<OAuth1Application, 'type'>>;
166
- export declare type OAuth2ApplicationCreation = ApplicationCreation & Required<Pick<OAuth2Application, 'type' | 'redirectUris'>> & Partial<Pick<OAuth2Application, 'logo' | 'confidential'>>;
167
- export interface ApplicationVersion {
168
- /** The identifier of this version */
169
- id: string;
170
- /** The name of the application version. We suggest using semantic versioning vX.X.X (e.g. v1.2.0) */
171
- name: string;
172
- /** The timestap when this version was created */
173
- creationTimestamp: Date;
174
- }
175
- export interface OAuth1ApplicationVersion extends ApplicationVersion {
176
- /** the oAuth1 consumerKey */
177
- consumerKey: string;
178
- /** the oAuth1 consumerSecret */
179
- consumerSecret: string;
180
- }
181
- export interface OAuth2ApplicationVersion extends ApplicationVersion {
182
- /** The oAuth2 clientId */
183
- clientId: string;
184
- /** The oAuth2 clientSecret */
185
- clientSecret: string;
186
- }
187
- export declare type ApplicationUpdate = Partial<Pick<Application, 'name' | 'description'>>;
188
- export declare type OAuth1ApplicationUpdate = ApplicationUpdate & Required<Pick<OAuth1Application, 'type'>>;
189
- export declare type OAuth2ApplicationUpdate = ApplicationUpdate & Required<Pick<OAuth2Application, 'type'>> & Partial<Pick<OAuth2Application, 'logo' | 'redirectUris'>>;
190
- export declare type ApplicationVersionCreation = Required<Partial<Pick<ApplicationVersion, 'name'>>>;
1
+ import { AffectedRecords, ObjectId, OptionsBase, OptionsWithRql, PagedResult } from '../../../types';
2
+ export interface AuthApplicationsService {
3
+ /**
4
+ * ## Create a new application
5
+ * You can use this function to create a new `oAuth1` or `oAuth2` application.
6
+ *
7
+ * You need permissions to use this function.
8
+ *
9
+ * #### Global Permissions
10
+ * `CREATE_APPLICATIONS` - Provides the ability to create new applications.
11
+ *
12
+ * @param data {@link OAuth1ApplicationCreation} or {@link OAuth2ApplicationCreation}
13
+ * @returns The newly created {@link OAuth1Application} or {@link OAuth2Application}.
14
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
15
+ * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
16
+ */
17
+ create<T extends OAuth1ApplicationCreation | OAuth2ApplicationCreation>(data: T, options?: OptionsBase): Promise<T extends OAuth1ApplicationCreation ? OAuth1Application : OAuth2Application>;
18
+ /**
19
+ * ## Get a list of applications
20
+ * Provides a paginated list of applications currently registered in the cluster.
21
+ *
22
+ * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type`).
23
+ *
24
+ * #### Global Permissions
25
+ * `VIEW_APPLICATIONS` - Returns all applications fields
26
+ *
27
+ * #### Function details
28
+ * @param options {@link OptionsWithRql} additional options with rql that can be set for your request to the cluster.
29
+ *
30
+ * @returns Provides a paginated list of applications currently registered in the cluster.
31
+ *
32
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
33
+ * */
34
+ find(options?: OptionsWithRql): Promise<PagedResult<OAuth1Application | OAuth2Application>>;
35
+ /**
36
+ * ## Get the first application found
37
+ * Gets the first application from the paginated list of applications currently registered in the cluster.
38
+ *
39
+ * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type`).
40
+ *
41
+ * #### Global Permissions
42
+ * `VIEW_APPLICATIONS` - Returns all applications fields
43
+ *
44
+ * #### Function details
45
+ * @param options {@link OptionsWithRql} additional options with rql that can be set for your request to the cluster.
46
+ *
47
+ * @returns Provides a paginated list of applications currently registered in the cluster.
48
+ *
49
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
50
+ * */
51
+ findFirst(options?: OptionsWithRql): Promise<OAuth1Application | OAuth2Application>;
52
+ /**
53
+ * ## Get an application by its id
54
+ * Gets the application currently registered in the cluster by its id.
55
+ *
56
+ * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type`).
57
+ *
58
+ * #### Global Permissions
59
+ * `VIEW_APPLICATIONS` - Returns all applications fields
60
+ *
61
+ * #### Function details
62
+ * @param options {@link OptionsWithRql} additional options with rql that can be set for your request to the cluster.
63
+ *
64
+ * @returns Provides a paginated list of applications currently registered in the cluster.
65
+ *
66
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
67
+ * */
68
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<OAuth1Application | OAuth2Application>;
69
+ /**
70
+ * ## Get an application by its name
71
+ * Gets the application currently registered in the cluster by its name.
72
+ *
73
+ * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type`).
74
+ *
75
+ * #### Global Permissions
76
+ * `VIEW_APPLICATIONS` - Returns all applications fields
77
+ *
78
+ * #### Function details
79
+ * @param options {@link OptionsWithRql} additional options with rql that can be set for your request to the cluster.
80
+ *
81
+ * @returns Provides a paginated list of applications currently registered in the cluster.
82
+ *
83
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
84
+ * */
85
+ findByName(name: string, options?: OptionsWithRql): Promise<OAuth1Application | OAuth2Application>;
86
+ /**
87
+ * @deprecated Use `find` instead
88
+ *
89
+ * ## Get a list of applications
90
+ * Provides a paginated list of applications currently registered in the cluster.
91
+ *
92
+ * Every logged-in user is able to retrieve a limited set of fields (only `name`, `description`, `logo` and `type`).
93
+ *
94
+ * #### Global Permissions
95
+ * `VIEW_APPLICATIONS` - Returns all applications fields
96
+ *
97
+ * #### Function details
98
+ * @param options {@link OptionsWithRql} additional options with rql that can be set for your request to the cluster.
99
+ *
100
+ * @returns Provides a paginated list of applications currently registered in the cluster.
101
+ *
102
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
103
+ * */
104
+ get(options?: OptionsWithRql): Promise<PagedResult<OAuth1Application | OAuth2Application>>;
105
+ /**
106
+ * ## Update an existing application
107
+ * You can use this function to update an existing `oAuth1` or `oAuth2` application.
108
+ *
109
+ * You need permissions to use this function.
110
+ *
111
+ * #### Global Permissions
112
+ * `UPDATE_APPLICATIONS` - Provides the ability to update existing applications.
113
+ *
114
+ * #### Function details
115
+ * @param applicationId A hexadecimal identifier of 24 characters of the application you want to update.
116
+ * @param data {@link OAuth1ApplicationUpdate} or {@link OAuth2ApplicationUpdate} containing the fields you want to update.
117
+ * The fields that are left undefined will not be updated.
118
+ * @param options {@link OptionsBase} additional options that can be set for your request to the cluster.
119
+ *
120
+ * @returns {Promise} A Promise with the number of affected records.
121
+ *
122
+ * @throws {@link ResourceUnknownError} when no application is found for the specified application Id.
123
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
124
+ * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
125
+ */
126
+ update<T extends OAuth1ApplicationUpdate | OAuth2ApplicationUpdate>(applicationId: string, data: T, options?: OptionsBase): Promise<AffectedRecords>;
127
+ /**
128
+ * ## Delete an application
129
+ * You can use this function to remove an existing `oAuth1` or `oAuth2` application.
130
+ *
131
+ * You need permissions to use this function.
132
+ *
133
+ * #### Global permisions
134
+ * `DELETE_APPLICATIONS` - Provides the ability to remove the applications.
135
+ *
136
+ * #### Function details
137
+ * @param applicationId A hexadecimal identifier of 24 characters of the application you want to remove.
138
+ * @param options {@link OptionsBase} additional options that can be set for your request to the cluster.
139
+ *
140
+ * @returns {Promise} A Promise with the number of affected records.
141
+ *
142
+ * @throws {@link ResourceUnknownError} when no application is found for the specified application Id.
143
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
144
+ */
145
+ remove(applicationId: string, options?: OptionsBase): Promise<AffectedRecords>;
146
+ /**
147
+ * ## Create an application version
148
+ * You can use this function to create a new application version.
149
+ *
150
+ * You need permissions to use this function.
151
+ *
152
+ * #### Global permissions
153
+ * `CREATE_APPLICATIONS`- Provides the ability to create new application versions.
154
+ *
155
+ * #### Function details
156
+ * @param applicationId A hexadecimal identifier of 24 characters of the application.
157
+ * @param data An {@link ApplicationVersionCreation} object
158
+ * @param options {@link OptionsBase} additional options that can be set for your request to the cluster.
159
+ *
160
+ * @returns The newly created {@link OAuth1ApplicationVersion} or {@link OAuth2ApplicationVersion}.
161
+ *
162
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
163
+ * @throws {@link FieldFormatError} when one of the provided parameters is not correctly formatted according to the documentation.
164
+ */
165
+ createVersion(applicationId: string, data: ApplicationVersionCreation, options?: OptionsBase): Promise<ApplicationVersion>;
166
+ /**
167
+ * ## Delete an application version
168
+ * You can use this function to remove an existing appliction version.
169
+ *
170
+ * When you remove an application version users with existing oAuth1 tokens trying to communicate with the cluster will receive a `OAUTH_KEY_EXCEPTION`.
171
+ * In case of oAuth2 tokens users will receive a `OAUTH2_CLIENT_ID_EXCEPTION` when trying to use their refresh token to get new access tokens.
172
+ * You can use the error's above to force users to switch to a newer version of your applications in case the backend no longer recoginizes them.
173
+ *
174
+ * You need permissions to execute this function
175
+ *
176
+ * #### Global permissions
177
+ * `DELETE_APPLICATIONS` - Provides the ability to remove application versions.
178
+ *
179
+ * #### Function details
180
+ * @param applicationId A hexadecimal identifier of 24 characters of the application.
181
+ * @param versionId the version Identifier or `name` of the application version.
182
+ * @param options {@link OptionsBase} additional options that can be set for your request to the cluster.
183
+ *
184
+ * @returns {Promise} A Promise with the number of affected records.
185
+ *
186
+ * @throws {ResourceUnknownError} when the specified application or version could not be found
187
+ * @throws {@link NoPermissionError} when the user doesn't have the required permissions to execute the function.
188
+ */
189
+ deleteVersion(applicationId: string, versionId: string, options?: OptionsBase): Promise<AffectedRecords>;
190
+ }
191
+ /**
192
+ * @name Application
193
+ */
194
+ export interface Application {
195
+ /** A 24 character long hexadecimal value acting as the identifier of your application */
196
+ id: string;
197
+ /** The name of your application. A minimum 1 and maximm of 100 characters is accepted */
198
+ name: string;
199
+ /** A Description of your application. A minimum 1 and maximm of 250 characters is accepted */
200
+ description: string;
201
+ /** The timestamp when the application was last updated */
202
+ updateTimestamp: Date;
203
+ /** The timestamp when the application was created */
204
+ creationTimestamp: Date;
205
+ }
206
+ export interface OAuth1Application extends Application {
207
+ /** type of the application */
208
+ type: ApplicationType.oauth1;
209
+ /** A List cointaining the different versions of the application */
210
+ versions?: OAuth1ApplicationVersion[];
211
+ }
212
+ export interface OAuth2Application extends Application {
213
+ /** type of the application */
214
+ type: ApplicationType.oauth2;
215
+ /** A List containing the different versions of the application */
216
+ versions?: OAuth2ApplicationVersion[];
217
+ /**
218
+ * @deprecated
219
+ * The logo of the application. Can be used in the oAuth2.0 authorization code grant to indicate the user what application he is authorizing.
220
+ * A hexadecimal value with a minimum of 1 and maximum of 100 characters is allowed.
221
+ * */
222
+ logo?: string;
223
+ /** A list of approved uri's that can be used when authenticating with [an authorization code grant flow](https://www.rfc-editor.org/rfc/rfc6749#section-1.3.1). Can only be used in an oAuth2 application type. A minimum of 1 uri and maximum 50 uri's can be provided. This field is required upon creation to the application */
224
+ redirectUris?: string[];
225
+ /**
226
+ * Defines wether your application should be considered a confidential app according to the [oAuth2.0 spec](https://www.rfc-editor.org/rfc/rfc6749). If not provided upon creation this value defaults to false.
227
+ */
228
+ confidential: boolean;
229
+ }
230
+ export declare enum ApplicationType {
231
+ oauth1 = "oauth1",
232
+ oauth2 = "oauth2"
233
+ }
234
+ export declare type ApplicationCreation = Required<Pick<Application, 'name' | 'description'>>;
235
+ export declare type OAuth1ApplicationCreation = ApplicationCreation & Required<Pick<OAuth1Application, 'type'>>;
236
+ export declare type OAuth2ApplicationCreation = ApplicationCreation & Required<Pick<OAuth2Application, 'type' | 'redirectUris'>> & Partial<Pick<OAuth2Application, 'logo' | 'confidential'>>;
237
+ export interface ApplicationVersion {
238
+ /** The identifier of this version */
239
+ id: string;
240
+ /** The name of the application version. We suggest using semantic versioning vX.X.X (e.g. v1.2.0) */
241
+ name: string;
242
+ /** The timestap when this version was created */
243
+ creationTimestamp: Date;
244
+ }
245
+ export interface OAuth1ApplicationVersion extends ApplicationVersion {
246
+ /** the oAuth1 consumerKey */
247
+ consumerKey: string;
248
+ /** the oAuth1 consumerSecret */
249
+ consumerSecret: string;
250
+ }
251
+ export interface OAuth2ApplicationVersion extends ApplicationVersion {
252
+ /** The oAuth2 clientId */
253
+ clientId: string;
254
+ /** The oAuth2 clientSecret */
255
+ clientSecret: string;
256
+ }
257
+ export declare type ApplicationUpdate = Partial<Pick<Application, 'name' | 'description'>>;
258
+ export declare type OAuth1ApplicationUpdate = ApplicationUpdate & Required<Pick<OAuth1Application, 'type'>>;
259
+ export declare type OAuth2ApplicationUpdate = ApplicationUpdate & Required<Pick<OAuth2Application, 'type'>> & Partial<Pick<OAuth2Application, 'logo' | 'redirectUris'>>;
260
+ export declare type ApplicationVersionCreation = Required<Partial<Pick<ApplicationVersion, 'name'>>>;
@@ -1,3 +1,3 @@
1
- import type { HttpInstance } from '../../types';
2
- import type { AuthService } from './types';
3
- export declare function authService(httpWithAuth: HttpInstance): AuthService;
1
+ import type { HttpInstance } from '../../types';
2
+ import type { AuthService } from './types';
3
+ export declare function authService(httpWithAuth: HttpInstance): AuthService;
@@ -1,5 +1,5 @@
1
- import type { HttpInstance } from '../../../types';
2
- import { HttpClient } from '../../http-client';
3
- import type { AuthOauth1Service } from './types';
4
- declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth1Service;
5
- export default _default;
1
+ import type { HttpInstance } from '../../../types';
2
+ import { HttpClient } from '../../http-client';
3
+ import type { AuthOauth1Service } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth1Service;
5
+ export default _default;
@@ -1,63 +1,63 @@
1
- import { AffectedRecords, OptionsWithRql, PagedResult } from '../../types';
2
- export interface AuthOauth1Service {
3
- /**
4
- * Generate an SSO token with OAuth 1 authentication
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#/SSO/post_oauth1_ssoTokens_generate
10
- * @throws {ApplicationNotAuthenticatedError}
11
- * @throws {UserNotAuthenticatedError}
12
- */
13
- generateSsoToken(): Promise<SsoToken>;
14
- /**
15
- * Consume an SSO token to get OAuth 1 tokens
16
- *
17
- * Permission | Scope | Effect
18
- * - | - | -
19
- * none | | Everyone can use this endpoint
20
- * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO/post_oauth1_ssoTokens_generate
21
- * @throws {ApplicationNotAuthenticatedError}
22
- * @throws {ResourceUnknownError}
23
- */
24
- consumeSsoToken(ssoToken: string): Promise<OAuth1Token>;
25
- /**
26
- * Get a list of OAuth1 tokens
27
- *
28
- * Permission | Scope | Effect
29
- * - | - | -
30
- * none | | Can only see a list of OAuth1 tokens for this account
31
- * VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
32
- * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/get_oauth1_tokens
33
- */
34
- getTokens(options?: OptionsWithRql): Promise<PagedResult<OAuth1Token>>;
35
- /**
36
- * Delete a token
37
- *
38
- * Permission | Scope | Effect
39
- * - | - | -
40
- * none | | Can only see a list of OAuth1 tokens for this account
41
- * VIEW_AUTHORIZATIONS | | Can remove any OAuth1 tokens of any account
42
- * * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/post_oauth1_tokens_mfa
43
- */
44
- removeToken(tokenId: string): Promise<AffectedRecords>;
45
- }
46
- export interface SsoToken {
47
- id: string;
48
- ssoToken: string;
49
- userId: string;
50
- createdByApplicationId: string;
51
- expiryTimestamp: Date;
52
- creationTimestamp: Date;
53
- updateTimestamp: Date;
54
- }
55
- export interface OAuth1Token {
56
- id: string;
57
- userId: string;
58
- applicationId: string;
59
- token: string;
60
- tokenSecret: string;
61
- lastUsedTimestamp: Date;
62
- creationTimestamp: Date;
63
- }
1
+ import { AffectedRecords, OptionsWithRql, PagedResult } from '../../types';
2
+ export interface AuthOauth1Service {
3
+ /**
4
+ * Generate an SSO token with OAuth 1 authentication
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#/SSO/post_oauth1_ssoTokens_generate
10
+ * @throws {ApplicationNotAuthenticatedError}
11
+ * @throws {UserNotAuthenticatedError}
12
+ */
13
+ generateSsoToken(): Promise<SsoToken>;
14
+ /**
15
+ * Consume an SSO token to get OAuth 1 tokens
16
+ *
17
+ * Permission | Scope | Effect
18
+ * - | - | -
19
+ * none | | Everyone can use this endpoint
20
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO/post_oauth1_ssoTokens_generate
21
+ * @throws {ApplicationNotAuthenticatedError}
22
+ * @throws {ResourceUnknownError}
23
+ */
24
+ consumeSsoToken(ssoToken: string): Promise<OAuth1Token>;
25
+ /**
26
+ * Get a list of OAuth1 tokens
27
+ *
28
+ * Permission | Scope | Effect
29
+ * - | - | -
30
+ * none | | Can only see a list of OAuth1 tokens for this account
31
+ * VIEW_AUTHORIZATIONS | global | Can see a list of OAuth1 tokens for any account
32
+ * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/get_oauth1_tokens
33
+ */
34
+ getTokens(options?: OptionsWithRql): Promise<PagedResult<OAuth1Token>>;
35
+ /**
36
+ * Delete a token
37
+ *
38
+ * Permission | Scope | Effect
39
+ * - | - | -
40
+ * none | | Can only see a list of OAuth1 tokens for this account
41
+ * VIEW_AUTHORIZATIONS | | Can remove any OAuth1 tokens of any account
42
+ * * @see https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/OAuth1/post_oauth1_tokens_mfa
43
+ */
44
+ removeToken(tokenId: string): Promise<AffectedRecords>;
45
+ }
46
+ export interface SsoToken {
47
+ id: string;
48
+ ssoToken: string;
49
+ userId: string;
50
+ createdByApplicationId: string;
51
+ expiryTimestamp: Date;
52
+ creationTimestamp: Date;
53
+ updateTimestamp: Date;
54
+ }
55
+ export interface OAuth1Token {
56
+ id: string;
57
+ userId: string;
58
+ applicationId: string;
59
+ token: string;
60
+ tokenSecret: string;
61
+ lastUsedTimestamp: Date;
62
+ creationTimestamp: Date;
63
+ }
@@ -1,5 +1,5 @@
1
- import type { HttpInstance } from '../../../types';
2
- import { HttpClient } from '../../http-client';
3
- import type { AuthOauth2Service } from './types';
4
- declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2Service;
5
- export default _default;
1
+ import type { HttpInstance } from '../../../types';
2
+ import { HttpClient } from '../../http-client';
3
+ import type { AuthOauth2Service } from './types';
4
+ declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => AuthOauth2Service;
5
+ export default _default;