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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/btoa.d.ts +6 -0
  3. package/build/client.d.ts +147 -0
  4. package/build/constants.d.ts +17 -0
  5. package/build/errorHandler.d.ts +1 -0
  6. package/build/errors.d.ts +361 -0
  7. package/build/http/client.d.ts +2 -0
  8. package/build/http/index.d.ts +4 -0
  9. package/build/http/interceptors.d.ts +9 -0
  10. package/build/http/oAuth1Signature.d.ts +18 -0
  11. package/build/http/oauth1.d.ts +3 -0
  12. package/build/http/oauth2.d.ts +3 -0
  13. package/build/http/proxy.d.ts +3 -0
  14. package/build/http/types.d.ts +331 -0
  15. package/build/http/utils.d.ts +21 -0
  16. package/build/index.cjs.js +1 -1
  17. package/build/index.d.ts +9 -0
  18. package/build/index.mjs +1 -1
  19. package/build/mock.d.ts +43 -0
  20. package/build/mockType.d.ts +1721 -0
  21. package/build/parseStoredCredentials.d.ts +11 -0
  22. package/build/rql/index.d.ts +16 -0
  23. package/build/rql/parser.d.ts +1 -0
  24. package/build/rql/types.d.ts +174 -0
  25. package/build/services/auth/applications/index.d.ts +5 -0
  26. package/build/services/auth/applications/types.d.ts +260 -0
  27. package/build/services/auth/index.d.ts +3 -0
  28. package/build/services/auth/oauth1/index.d.ts +5 -0
  29. package/build/services/auth/oauth1/types.d.ts +102 -0
  30. package/build/services/auth/oauth2/index.d.ts +5 -0
  31. package/build/services/auth/oauth2/types.d.ts +100 -0
  32. package/build/services/auth/oidc/index.d.ts +5 -0
  33. package/build/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  34. package/build/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  35. package/build/services/auth/oidc/providers/index.d.ts +5 -0
  36. package/build/services/auth/oidc/providers/types.d.ts +148 -0
  37. package/build/services/auth/oidc/types.d.ts +40 -0
  38. package/build/services/auth/types.d.ts +39 -0
  39. package/build/services/auth/users/index.d.ts +5 -0
  40. package/build/services/auth/users/types.d.ts +121 -0
  41. package/build/services/configurations/general.d.ts +5 -0
  42. package/build/services/configurations/groups.d.ts +5 -0
  43. package/build/services/configurations/index.d.ts +10 -0
  44. package/build/services/configurations/patients.d.ts +5 -0
  45. package/build/services/configurations/staff.d.ts +5 -0
  46. package/build/services/configurations/types.d.ts +222 -0
  47. package/build/services/configurations/users.d.ts +5 -0
  48. package/build/services/data/comments.d.ts +5 -0
  49. package/build/services/data/documents.d.ts +5 -0
  50. package/build/services/data/index.d.ts +13 -0
  51. package/build/services/data/indexes.d.ts +5 -0
  52. package/build/services/data/infrastructure.d.ts +10 -0
  53. package/build/services/data/json-schema.d.ts +121 -0
  54. package/build/services/data/properties.d.ts +5 -0
  55. package/build/services/data/schemas.d.ts +5 -0
  56. package/build/services/data/statuses.d.ts +5 -0
  57. package/build/services/data/transitions.d.ts +5 -0
  58. package/build/services/data/types.d.ts +1500 -0
  59. package/build/services/dispatchers/actions/index.d.ts +5 -0
  60. package/build/services/dispatchers/actions/types.d.ts +78 -0
  61. package/build/services/dispatchers/dispatchers/index.d.ts +5 -0
  62. package/build/services/dispatchers/dispatchers/types.d.ts +111 -0
  63. package/build/services/dispatchers/index.d.ts +7 -0
  64. package/build/services/dispatchers/types.d.ts +2 -0
  65. package/build/services/events/events.d.ts +5 -0
  66. package/build/services/events/index.d.ts +5 -0
  67. package/build/services/events/subscriptions.d.ts +5 -0
  68. package/build/services/events/types.d.ts +107 -0
  69. package/build/services/files/files.d.ts +5 -0
  70. package/build/services/files/formHelpers.d.ts +3 -0
  71. package/build/services/files/index.d.ts +6 -0
  72. package/build/services/files/settings/index.d.ts +5 -0
  73. package/build/services/files/settings/types.d.ts +38 -0
  74. package/build/services/files/tokens.d.ts +5 -0
  75. package/build/services/files/types.d.ts +185 -0
  76. package/build/services/helpers.d.ts +7 -0
  77. package/build/services/http-client.d.ts +22 -0
  78. package/build/services/index.d.ts +16 -0
  79. package/build/services/localizations/countries.d.ts +5 -0
  80. package/build/services/localizations/index.d.ts +3 -0
  81. package/build/services/localizations/languages.d.ts +5 -0
  82. package/build/services/localizations/localizations.d.ts +5 -0
  83. package/build/services/localizations/types.d.ts +150 -0
  84. package/build/services/logs/access/index.d.ts +5 -0
  85. package/build/services/logs/access/types.d.ts +41 -0
  86. package/build/services/logs/index.d.ts +3 -0
  87. package/build/services/logs/types.d.ts +4 -0
  88. package/build/services/mails/index.d.ts +3 -0
  89. package/build/services/mails/mails.d.ts +5 -0
  90. package/build/services/mails/types.d.ts +149 -0
  91. package/build/services/notifications/index.d.ts +6 -0
  92. package/build/services/notifications/notifications.d.ts +5 -0
  93. package/build/services/notifications/settings.d.ts +5 -0
  94. package/build/services/notifications/types.d.ts +235 -0
  95. package/build/services/notificationsV2/index.d.ts +6 -0
  96. package/build/services/notificationsV2/notificationsV2.d.ts +5 -0
  97. package/build/services/notificationsV2/types.d.ts +166 -0
  98. package/build/services/notificationsV2/userSettings/index.d.ts +5 -0
  99. package/build/services/notificationsV2/userSettings/types.d.ts +138 -0
  100. package/build/services/payments/appStore.d.ts +5 -0
  101. package/build/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/services/payments/health.d.ts +9 -0
  103. package/build/services/payments/index.d.ts +15 -0
  104. package/build/services/payments/orders.d.ts +5 -0
  105. package/build/services/payments/playStore.d.ts +5 -0
  106. package/build/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/services/payments/products.d.ts +5 -0
  109. package/build/services/payments/stripe.d.ts +5 -0
  110. package/build/services/payments/subscriptions.d.ts +5 -0
  111. package/build/services/payments/types.d.ts +1198 -0
  112. package/build/services/profiles/groups.d.ts +5 -0
  113. package/build/services/profiles/index.d.ts +8 -0
  114. package/build/services/profiles/logs.d.ts +5 -0
  115. package/build/services/profiles/profiles.d.ts +5 -0
  116. package/build/services/profiles/types.d.ts +375 -0
  117. package/build/services/tasks/api/index.d.ts +5 -0
  118. package/build/services/tasks/api/types.d.ts +146 -0
  119. package/build/services/tasks/apiRequests/index.d.ts +5 -0
  120. package/build/services/tasks/apiRequests/logs/index.d.ts +5 -0
  121. package/build/services/tasks/apiRequests/logs/types.d.ts +25 -0
  122. package/build/services/tasks/apiRequests/types.d.ts +83 -0
  123. package/build/services/tasks/functions/index.d.ts +5 -0
  124. package/build/services/tasks/functions/types.d.ts +171 -0
  125. package/build/services/tasks/index.d.ts +15 -0
  126. package/build/services/tasks/logs/index.d.ts +5 -0
  127. package/build/services/tasks/logs/types.d.ts +28 -0
  128. package/build/services/tasks/schedules/index.d.ts +5 -0
  129. package/build/services/tasks/schedules/types.d.ts +92 -0
  130. package/build/services/tasks/tasks.d.ts +5 -0
  131. package/build/services/tasks/types.d.ts +118 -0
  132. package/build/services/templates/index.d.ts +3 -0
  133. package/build/services/templates/templates.d.ts +5 -0
  134. package/build/services/templates/types.d.ts +237 -0
  135. package/build/services/templatesV2/index.d.ts +3 -0
  136. package/build/services/templatesV2/templatesV2.d.ts +5 -0
  137. package/build/services/templatesV2/types.d.ts +156 -0
  138. package/build/services/types.d.ts +103 -0
  139. package/build/services/users/activationRequests/index.d.ts +4 -0
  140. package/build/services/users/activationRequests/types.d.ts +70 -0
  141. package/build/services/users/forgotPasswordRequests/index.d.ts +4 -0
  142. package/build/services/users/forgotPasswordRequests/types.d.ts +70 -0
  143. package/build/services/users/globalRoles.d.ts +5 -0
  144. package/build/services/users/groupRoles.d.ts +5 -0
  145. package/build/services/users/index.d.ts +14 -0
  146. package/build/services/users/settings/index.d.ts +4 -0
  147. package/build/services/users/settings/types.d.ts +47 -0
  148. package/build/services/users/types.d.ts +1278 -0
  149. package/build/services/users/users.d.ts +5 -0
  150. package/build/sha1.d.ts +11 -0
  151. package/build/types/services/users/types.d.ts +69 -25
  152. package/build/types/version.d.ts +1 -1
  153. package/build/types.d.ts +104 -0
  154. package/build/utils.d.ts +5 -0
  155. package/build/version.d.ts +1 -0
  156. package/package.json +3 -3
@@ -0,0 +1,1278 @@
1
+ import { RQLString } from '../../rql';
2
+ import { FindAllIterator } from '../../services/helpers';
3
+ import { ObjectId, LanguageCode, TimeZone, PagedResult, AffectedRecords, OptionsBase, OptionsWithRql, PagedResultWithPager } from '../types';
4
+ export { VerificationSettings } from './settings/types';
5
+ export { ActivationRequest } from './activationRequests/types';
6
+ export { ForgotPasswordRequest } from './forgotPasswordRequests/types';
7
+ export interface UserData {
8
+ id: string;
9
+ firstName: string;
10
+ lastName: string;
11
+ language: LanguageCode;
12
+ timeZone: TimeZone;
13
+ email: string;
14
+ phoneNumber: string;
15
+ activation: boolean;
16
+ patientEnlistments?: PatientEnlistment[];
17
+ roles?: Role[];
18
+ staffEnlistments?: StaffEnlistment[];
19
+ lastFailedTimestamp?: Date;
20
+ failedCount?: number;
21
+ profileImage?: string;
22
+ creationTimestamp: Date;
23
+ updateTimestamp: Date;
24
+ }
25
+ export declare type User = UserData;
26
+ export declare type UserDataUpdate = Partial<Pick<UserData, 'firstName' | 'lastName' | 'phoneNumber' | 'language' | 'timeZone'>>;
27
+ export interface PatientEnlistment {
28
+ groupId: string;
29
+ expiryTimestamp: Date;
30
+ expired: boolean;
31
+ creationTimestamp: Date;
32
+ }
33
+ export interface Role {
34
+ id: string;
35
+ name: string;
36
+ description: string;
37
+ permissions?: Permission[];
38
+ creationTimestamp: Date;
39
+ updateTimestamp: Date;
40
+ }
41
+ export interface Permission {
42
+ name: string;
43
+ description: string;
44
+ }
45
+ export interface StaffEnlistment {
46
+ groupId: string;
47
+ roles?: GroupRole[];
48
+ creationTimestamp: Date;
49
+ updateTimestamp: Date;
50
+ }
51
+ export interface GroupRole {
52
+ id: ObjectId;
53
+ groupId: string;
54
+ name: string;
55
+ description: string;
56
+ permissions: (GlobalPermissionName | string)[];
57
+ creationTimestamp: Date;
58
+ updateTimestamp: Date;
59
+ }
60
+ export interface RegisterUserData {
61
+ firstName: string;
62
+ lastName: string;
63
+ email: string;
64
+ password: string;
65
+ phoneNumber: string;
66
+ birthday?: string;
67
+ gender?: Gender;
68
+ country?: string;
69
+ region?: string;
70
+ language: string;
71
+ timeZone?: string;
72
+ /** The activation mode to use. Defaults to `hash`. */
73
+ activationMode?: 'hash' | 'pin_code' | 'manual';
74
+ }
75
+ export declare enum Gender {
76
+ Unknown = 0,
77
+ Male = 1,
78
+ Female = 2,
79
+ NotApplicable = 9
80
+ }
81
+ export interface EmailUpdate {
82
+ email: string;
83
+ activationMode?: 'hash' | 'pin_code' | 'manual';
84
+ }
85
+ export interface AddPatientEnlistment {
86
+ groupId: ObjectId;
87
+ expiryTimestamp?: number;
88
+ }
89
+ export interface ChangePassword {
90
+ oldPassword: string;
91
+ newPassword: string;
92
+ }
93
+ export interface Authenticate {
94
+ email: string;
95
+ password: string;
96
+ }
97
+ export declare type ActivationCompletion = ActivationHashCompletion | ActivationPinCodeCompletion;
98
+ export interface ActivationHashCompletion {
99
+ hash: string;
100
+ }
101
+ export interface ActivationPinCodeCompletion {
102
+ email: string;
103
+ pinCode: string;
104
+ }
105
+ export declare type PasswordResetCompletion = PasswordResetHashCompletion | PasswordResetPinCodeCompletion;
106
+ export interface PasswordResetHashCompletion {
107
+ hash: string;
108
+ newPassword: string;
109
+ }
110
+ export interface PasswordResetPinCodeCompletion {
111
+ email: string;
112
+ pinCode: string;
113
+ newPassword: string;
114
+ }
115
+ export interface ConfirmPassword {
116
+ password: string;
117
+ }
118
+ export interface GlobalPermission {
119
+ name?: GlobalPermissionName | string;
120
+ description?: string;
121
+ }
122
+ export interface PasswordPolicy {
123
+ minimumLength: number;
124
+ maximumLength: number;
125
+ upperCaseRequired: boolean;
126
+ lowerCaseRequired: boolean;
127
+ symbolRequired: boolean;
128
+ numberRequired: boolean;
129
+ pattern?: string;
130
+ messageFormat?: string;
131
+ }
132
+ export interface PasswordPolicyUpdate {
133
+ minimumLength?: number;
134
+ maximumLength?: number;
135
+ upperCaseRequired?: boolean;
136
+ lowerCaseRequired?: boolean;
137
+ symbolRequired?: boolean;
138
+ numberRequired?: boolean;
139
+ }
140
+ export declare enum GlobalPermissionName {
141
+ ACTIVATE_PRESCRIPTIONS = "ACTIVATE_PRESCRIPTIONS",
142
+ ADD_CREDITS = "ADD_CREDITS",
143
+ ADD_GROUP_ROLE_PERMISSION = "ADD_GROUP_ROLE_PERMISSION",
144
+ ADD_GROUP_ROLE_TO_STAFF = "ADD_GROUP_ROLE_TO_STAFF",
145
+ ADD_PATIENT = "ADD_PATIENT",
146
+ ADD_ROLE_PERMISSION = "ADD_ROLE_PERMISSION",
147
+ ADD_ROLE_TO_USER = "ADD_ROLE_TO_USER",
148
+ ADD_STAFF = "ADD_STAFF",
149
+ APPROVE_GROUP_REQUESTS = "APPROVE_GROUP_REQUESTS",
150
+ ASSUME_PAYMENT_ENTITY = "ASSUME_PAYMENT_ENTITY",
151
+ CANCEL_TASKS = "CANCEL_TASKS",
152
+ CREATE_APP_STORE_SHARED_SECRET = "CREATE_APP_STORE_SHARED_SECRET",
153
+ CREATE_APP_STORE_SUBSCRIPTION_PRODUCT = "CREATE_APP_STORE_SUBSCRIPTION_PRODUCT",
154
+ CREATE_APPLICATIONS = "CREATE_APPLICATIONS",
155
+ CREATE_DISPATCHERS = "CREATE_DISPATCHERS",
156
+ CREATE_DOCUMENT_COMMENTS = "CREATE_DOCUMENT_COMMENTS",
157
+ CREATE_DOCUMENTS = "CREATE_DOCUMENTS",
158
+ CREATE_EVENTS = "CREATE_EVENTS",
159
+ CREATE_GROUP = "CREATE_GROUP",
160
+ CREATE_GROUP_ROLE = "CREATE_GROUP_ROLE",
161
+ CREATE_LOCALIZATIONS = "CREATE_LOCALIZATIONS",
162
+ CREATE_NOTIFICATIONS = "CREATE_NOTIFICATIONS",
163
+ CREATE_OIDC_PROVIDER = "CREATE_OIDC_PROVIDER",
164
+ CREATE_PACKAGES = "CREATE_PACKAGES",
165
+ CREATE_PAYMENT_INTENTS = "CREATE_PAYMENT_INTENTS",
166
+ CREATE_PLAY_STORE_SUBSCRIPTION_PRODUCT = "CREATE_PLAY_STORE_SUBSCRIPTION_PRODUCT",
167
+ CREATE_PRESCRIPTIONS = "CREATE_PRESCRIPTIONS",
168
+ CREATE_PROFILE_LOG_ENTRIES = "CREATE_PROFILE_LOG_ENTRIES",
169
+ CREATE_PROFILES = "CREATE_PROFILES",
170
+ CREATE_REPORT_SHARES = "CREATE_REPORT_SHARES",
171
+ CREATE_REPORTS = "CREATE_REPORTS",
172
+ CREATE_ROLE = "CREATE_ROLE",
173
+ CREATE_SCHEMAS = "CREATE_SCHEMAS",
174
+ CREATE_SMS_MESSAGE = "CREATE_SMS_MESSAGE",
175
+ CREATE_STRIPE_PRODUCTS = "CREATE_STRIPE_PRODUCTS",
176
+ CREATE_SUBSCRIPTIONS = "CREATE_SUBSCRIPTIONS",
177
+ CREATE_TASK_FUNCTION = "CREATE_TASK_FUNCTION",
178
+ CREATE_TASK_SCHEDULE = "CREATE_TASK_SCHEDULE",
179
+ CREATE_TASKS = "CREATE_TASKS",
180
+ CREATE_TEMPLATES = "CREATE_TEMPLATES",
181
+ DELETE_ACTIVATION_REQUEST = "DELETE_ACTIVATION_REQUEST",
182
+ DELETE_APP_STORE_SHARED_SECRET = "DELETE_APP_STORE_SHARED_SECRET",
183
+ DELETE_APP_STORE_SUBSCRIPTION = "DELETE_APP_STORE_SUBSCRIPTION",
184
+ DELETE_APP_STORE_SUBSCRIPTION_PRODUCT = "DELETE_APP_STORE_SUBSCRIPTION_PRODUCT",
185
+ DELETE_APPLICATIONS = "DELETE_APPLICATIONS",
186
+ DELETE_AUTHORIZATIONS = "DELETE_AUTHORIZATIONS",
187
+ DELETE_DISPATCHERS = "DELETE_DISPATCHERS",
188
+ DELETE_DOCUMENTS = "DELETE_DOCUMENTS",
189
+ DELETE_FORGOT_PASSWORD_REQUEST = "DELETE_FORGOT_PASSWORD_REQUEST",
190
+ DELETE_GROUP = "DELETE_GROUP",
191
+ DELETE_GROUP_ROLE = "DELETE_GROUP_ROLE",
192
+ DELETE_LOCALIZATIONS = "DELETE_LOCALIZATIONS",
193
+ DELETE_MAILS = "DELETE_MAILS",
194
+ DELETE_NOTIFICATIONS = "DELETE_NOTIFICATIONS",
195
+ DELETE_OIDC_PROVIDER = "DELETE_OIDC_PROVIDER",
196
+ DELETE_PACKAGES = "DELETE_PACKAGES",
197
+ DELETE_PLAY_STORE_SUBSCRIPTION = "DELETE_PLAY_STORE_SUBSCRIPTION",
198
+ DELETE_PLAY_STORE_SUBSCRIPTION_PRODUCT = "DELETE_PLAY_STORE_SUBSCRIPTION_PRODUCT",
199
+ DELETE_REPORT_SHARES = "DELETE_REPORT_SHARES",
200
+ DELETE_REPORTS = "DELETE_REPORTS",
201
+ DELETE_ROLE = "DELETE_ROLE",
202
+ DELETE_SCHEMAS = "DELETE_SCHEMAS",
203
+ DELETE_SMS_MESSAGE = "DELETE_SMS_MESSAGE",
204
+ DELETE_STRIPE_PRODUCTS = "DELETE_STRIPE_PRODUCTS",
205
+ DELETE_TASK_FUNCTION = "DELETE_TASK_FUNCTION",
206
+ DELETE_TASK_SCHEDULE = "DELETE_TASK_SCHEDULE",
207
+ DELETE_TEMPLATES = "DELETE_TEMPLATES",
208
+ DELETE_USER = "DELETE_USER",
209
+ DISABLE_SCHEMAS = "DISABLE_SCHEMAS",
210
+ EXECUTE_API_FUNCTION = "EXECUTE_API_FUNCTION",
211
+ EXECUTE_TASK_FUNCTION = "EXECUTE_TASK_FUNCTION",
212
+ PAY_PRESCRIPTIONS = "PAY_PRESCRIPTIONS",
213
+ PRERENDER_REPORTS = "PRERENDER_REPORTS",
214
+ REMOVE_GROUP_ROLE_FROM_STAFF = "REMOVE_GROUP_ROLE_FROM_STAFF",
215
+ REMOVE_GROUP_ROLE_PERMISSION = "REMOVE_GROUP_ROLE_PERMISSION",
216
+ REMOVE_PATIENT = "REMOVE_PATIENT",
217
+ REMOVE_ROLE_FROM_USER = "REMOVE_ROLE_FROM_USER",
218
+ REMOVE_ROLE_PERMISSION = "REMOVE_ROLE_PERMISSION",
219
+ REMOVE_STAFF = "REMOVE_STAFF",
220
+ RESET_FAILED_LOGIN_ATTEMPTS = "RESET_FAILED_LOGIN_ATTEMPTS",
221
+ RESOLVE_TEMPLATES = "RESOLVE_TEMPLATES",
222
+ SEND_MAILS = "SEND_MAILS",
223
+ SYNC_PROFILE_GROUPS = "SYNC_PROFILE_GROUPS",
224
+ TRANSFER_PERIOD = "TRANSFER_PERIOD",
225
+ TRANSITION_DOCUMENTS = "TRANSITION_DOCUMENTS",
226
+ TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION = "TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION",
227
+ TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION = "TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION",
228
+ UNLINK_USER_FROM_OIDC = "UNLINK_USER_FROM_OIDC",
229
+ UPDATE_ACCESS_TO_DOCUMENT = "UPDATE_ACCESS_TO_DOCUMENT",
230
+ UPDATE_APP_STORE_SUBSCRIPTION_PRODUCT = "UPDATE_APP_STORE_SUBSCRIPTION_PRODUCT",
231
+ UPDATE_APPLICATIONS = "UPDATE_APPLICATIONS",
232
+ UPDATE_CONFIGURATIONS = "UPDATE_CONFIGURATIONS",
233
+ UPDATE_DISPATCHERS = "UPDATE_DISPATCHERS",
234
+ UPDATE_DOCUMENT_COMMENTS = "UPDATE_DOCUMENT_COMMENTS",
235
+ UPDATE_DOCUMENTS = "UPDATE_DOCUMENTS",
236
+ UPDATE_FILE_SERVICE_SETTINGS = "UPDATE_FILE_SERVICE_SETTINGS",
237
+ UPDATE_FREE_STATUS = "UPDATE_FREE_STATUS",
238
+ UPDATE_GROUP = "UPDATE_GROUP",
239
+ UPDATE_GROUP_REPORT_CONFIGURATIONS = "UPDATE_GROUP_REPORT_CONFIGURATIONS",
240
+ UPDATE_GROUP_REQUESTS = "UPDATE_GROUP_REQUESTS",
241
+ UPDATE_GROUP_ROLE = "UPDATE_GROUP_ROLE",
242
+ UPDATE_LOCALIZATIONS = "UPDATE_LOCALIZATIONS",
243
+ UPDATE_NOTIFICATION_SETTINGS = "UPDATE_NOTIFICATION_SETTINGS",
244
+ UPDATE_OIDC_PROVIDER = "UPDATE_OIDC_PROVIDER",
245
+ UPDATE_PACKAGES = "UPDATE_PACKAGES",
246
+ UPDATE_PASSWORD_POLICY = "UPDATE_PASSWORD_POLICY",
247
+ UPDATE_PATIENT_CONFIGURATIONS = "UPDATE_PATIENT_CONFIGURATIONS",
248
+ UPDATE_PATIENT_REPORT_CONFIGURATIONS = "UPDATE_PATIENT_REPORT_CONFIGURATIONS",
249
+ UPDATE_PLAY_STORE_SUBSCRIPTION_PRODUCT = "UPDATE_PLAY_STORE_SUBSCRIPTION_PRODUCT",
250
+ UPDATE_PRESCRIPTION_STATUS = "UPDATE_PRESCRIPTION_STATUS",
251
+ UPDATE_PRESCRIPTIONS = "UPDATE_PRESCRIPTIONS",
252
+ UPDATE_PROFILE_IMAGE = "UPDATE_PROFILE_IMAGE",
253
+ UPDATE_PROFILES = "UPDATE_PROFILES",
254
+ UPDATE_REPORTS = "UPDATE_REPORTS",
255
+ UPDATE_ROLE = "UPDATE_ROLE",
256
+ UPDATE_SCHEMAS = "UPDATE_SCHEMAS",
257
+ UPDATE_STAFF_CONFIGURATIONS = "UPDATE_STAFF_CONFIGURATIONS",
258
+ UPDATE_STRIPE_ORDERS = "UPDATE_STRIPE_ORDERS",
259
+ UPDATE_STRIPE_PRODUCTS = "UPDATE_STRIPE_PRODUCTS",
260
+ UPDATE_STRIPE_USERS = "UPDATE_STRIPE_USERS",
261
+ UPDATE_TASK_FUNCTION = "UPDATE_TASK_FUNCTION",
262
+ UPDATE_TEMPLATES = "UPDATE_TEMPLATES",
263
+ UPDATE_USER = "UPDATE_USER",
264
+ UPDATE_USER_EMAIL = "UPDATE_USER_EMAIL",
265
+ UPDATE_USER_MFA_SETTINGS = "UPDATE_USER_MFA_SETTINGS",
266
+ UPDATE_USER_SERVICE_EMAIL_TEMPLATES = "UPDATE_USER_SERVICE_EMAIL_TEMPLATES",
267
+ UPDATE_USER_VERIFICATION_SETTINGS = "UPDATE_USER_VERIFICATION_SETTINGS",
268
+ VIEW_ACCESS_LOGS = "VIEW_ACCESS_LOGS",
269
+ VIEW_ACTIVATION_REQUESTS = "VIEW_ACTIVATION_REQUESTS",
270
+ VIEW_ACTIVE_PERIODS = "VIEW_ACTIVE_PERIODS",
271
+ VIEW_API_FUNCTION_REQUEST_LOGS = "VIEW_API_FUNCTION_REQUEST_LOGS",
272
+ VIEW_API_FUNCTION_REQUESTS = "VIEW_API_FUNCTION_REQUESTS",
273
+ VIEW_APP_STORE_NOTIFICATIONS = "VIEW_APP_STORE_NOTIFICATIONS",
274
+ VIEW_APP_STORE_RECEIPTS = "VIEW_APP_STORE_RECEIPTS",
275
+ VIEW_APP_STORE_SHARED_SECRETS = "VIEW_APP_STORE_SHARED_SECRETS",
276
+ VIEW_APP_STORE_SUBSCRIPTIONS = "VIEW_APP_STORE_SUBSCRIPTIONS",
277
+ VIEW_APPLICATIONS = "VIEW_APPLICATIONS",
278
+ VIEW_AUTHORIZATIONS = "VIEW_AUTHORIZATIONS",
279
+ VIEW_BALANCE = "VIEW_BALANCE",
280
+ VIEW_CONFIGURATIONS = "VIEW_CONFIGURATIONS",
281
+ VIEW_CREDIT_TRANSACTION = "VIEW_CREDIT_TRANSACTION",
282
+ VIEW_DISPATCHERS = "VIEW_DISPATCHERS",
283
+ VIEW_DOCUMENT_COMMENTS = "VIEW_DOCUMENT_COMMENTS",
284
+ VIEW_DOCUMENTS = "VIEW_DOCUMENTS",
285
+ VIEW_EVENTS = "VIEW_EVENTS",
286
+ VIEW_FILE_SERVICE_SETTINGS = "VIEW_FILE_SERVICE_SETTINGS",
287
+ VIEW_FILES = "VIEW_FILES",
288
+ VIEW_FORGOT_PASSWORD_REQUESTS = "VIEW_FORGOT_PASSWORD_REQUESTS",
289
+ VIEW_GROUP = "VIEW_GROUP",
290
+ VIEW_GROUP_REPORT_CONFIGURATIONS = "VIEW_GROUP_REPORT_CONFIGURATIONS",
291
+ VIEW_GROUP_REQUESTS = "VIEW_GROUP_REQUESTS",
292
+ VIEW_GROUPS = "VIEW_GROUP",
293
+ VIEW_MAILS = "VIEW_MAILS",
294
+ VIEW_NOTIFICATION_SETTINGS = "VIEW_NOTIFICATION_SETTINGS",
295
+ VIEW_NOTIFICATIONS = "VIEW_NOTIFICATIONS",
296
+ VIEW_OIDC_LOGIN_ATTEMPTS = "VIEW_OIDC_LOGIN_ATTEMPTS",
297
+ VIEW_OIDC_PROVIDERS = "VIEW_OIDC_PROVIDERS",
298
+ VIEW_PATIENT_CONFIGURATIONS = "VIEW_PATIENT_CONFIGURATIONS",
299
+ VIEW_PATIENT_REPORT_CONFIGURATIONS = "VIEW_PATIENT_REPORT_CONFIGURATIONS",
300
+ VIEW_PATIENTS = "VIEW_PATIENTS",
301
+ VIEW_PERIODS = "VIEW_PERIODS",
302
+ VIEW_PLAY_STORE_NOTIFICATIONS = "VIEW_PLAY_STORE_NOTIFICATIONS",
303
+ VIEW_PLAY_STORE_PURCHASE_INFOS = "VIEW_PLAY_STORE_PURCHASE_INFOS",
304
+ VIEW_PLAY_STORE_PURCHASE_RECEIPTS = "VIEW_PLAY_STORE_PURCHASE_RECEIPTS",
305
+ VIEW_PLAY_STORE_SUBSCRIPTIONS = "VIEW_PLAY_STORE_SUBSCRIPTIONS",
306
+ VIEW_PRESCRIPTIONS = "VIEW_PRESCRIPTIONS",
307
+ VIEW_PROFILE_LOG_ENTRIES = "VIEW_PROFILE_LOG_ENTRIES",
308
+ VIEW_REPORTS = "VIEW_REPORTS",
309
+ VIEW_ROLE = "VIEW_ROLE",
310
+ VIEW_STAFF = "VIEW_STAFF",
311
+ VIEW_STAFF_CONFIGURATIONS = "VIEW_STAFF_CONFIGURATIONS",
312
+ VIEW_STRIPE_ORDERS = "VIEW_STRIPE_ORDERS",
313
+ VIEW_STRIPE_USERS = "VIEW_STRIPE_USERS",
314
+ VIEW_SUBSCRIPTION_ENTITLEMENTS = "VIEW_SUBSCRIPTION_ENTITLEMENTS",
315
+ VIEW_SUBSCRIPTION_EVENTS = "VIEW_SUBSCRIPTION_EVENTS",
316
+ VIEW_SUBSCRIPTIONS = "VIEW_SUBSCRIPTIONS",
317
+ VIEW_TASK_FUNCTION_DETAILS = "VIEW_TASK_FUNCTION_DETAILS",
318
+ VIEW_TASK_FUNCTION_LOGS = "VIEW_TASK_FUNCTION_LOGS",
319
+ VIEW_TASK_FUNCTIONS = "VIEW_TASK_FUNCTIONS",
320
+ VIEW_TASK_LOGS = "VIEW_TASK_LOGS",
321
+ VIEW_TASK_SCHEDULES = "VIEW_TASK_SCHEDULES",
322
+ VIEW_TASKS = "VIEW_TASKS",
323
+ VIEW_TEMPLATES = "VIEW_TEMPLATES",
324
+ VIEW_USER = "VIEW_USER",
325
+ VIEW_USER_MFA_SETTINGS = "VIEW_USER_MFA_SETTINGS",
326
+ VIEW_USER_SERVICE_EMAIL_TEMPLATES = "VIEW_USER_SERVICE_EMAIL_TEMPLATES",
327
+ VIEW_USER_VERIFICATION_SETTINGS = "VIEW_USER_VERIFICATION_SETTINGS",
328
+ /** @deprecated Not in use any longer */
329
+ DELETE_PRESCRIPTIONS = "DELETE_PRESCRIPTIONS",
330
+ /** @deprecated Not in use any longer */
331
+ VIEW_MEASUREMENTS = "VIEW_MEASUREMENTS",
332
+ /** @deprecated Not in use any longer */
333
+ UPDATE_MEASUREMENTS = "UPDATE_MEASUREMENTS",
334
+ /** @deprecated Not in use any longer */
335
+ TRANSITION_MEASUREMENTS = "TRANSITION_MEASUREMENTS",
336
+ /** @deprecated Not in use any longer */
337
+ DELETE_MEASUREMENTS = "DELETE_MEASUREMENTS",
338
+ /** @deprecated Not in use any longer */
339
+ CREATE_MEASUREMENT_COMMENTS = "CREATE_MEASUREMENT_COMMENTS",
340
+ /** @deprecated Not in use any longer */
341
+ VIEW_MEASUREMENT_COMMENTS = "VIEW_MEASUREMENT_COMMENTS",
342
+ /** @deprecated Not in use any longer */
343
+ DELETE_PROFILES = "DELETE_PROFILES",
344
+ /** @deprecated Not in use any longer */
345
+ UPDATE_GROUPS = "UPDATE_GROUPS",
346
+ /** @deprecated Not in use any longer */
347
+ UPDATE_SENTIANCE_DATA = "UPDATE_SENTIANCE_DATA",
348
+ /** @deprecated Not in use any longer */
349
+ CANCEL_TASKS_FUNCTIONS = "CANCEL_TASKS_FUNCTIONS",
350
+ /** @deprecated Not in use any longer */
351
+ CREATE_TASKS_FUNCTIONS = "CREATE_TASKS_FUNCTIONS",
352
+ /** @deprecated Not in use any longer */
353
+ DELETE_CONFIGURATIONS = "DELETE_CONFIGURATIONS",
354
+ /** @deprecated Not in use any longer */
355
+ ADD_APPLICATION_VERSION = "ADD_APPLICATION_VERSION",
356
+ /** @deprecated Not in use any longer */
357
+ VIEW_TASKS_FUNCTIONS = "VIEW_TASKS_FUNCTIONS",
358
+ /** @deprecated Not in use any longer */
359
+ REMOVE_APPLICATION_VERSION = "REMOVE_APPLICATION_VERSION",
360
+ /** @deprecated Not in use any longer */
361
+ MANAGE_SERVICE_ALERTS = "MANAGE_SERVICE_ALERTS",
362
+ /** @deprecated Not in use any longer */
363
+ VIEW_AWS_SES_STATISTICS = "VIEW_AWS_SES_STATISTICS",
364
+ /** @deprecated Not in use any longer */
365
+ CREATE_USER_PERIODS = "CREATE_USER_PERIODS",
366
+ /** @deprecated Not in use any longer */
367
+ VIEW_PLAY_STORE_PURCHASES = "VIEW_PLAY_STORE_PURCHASES"
368
+ }
369
+ export interface GroupRolePermissions {
370
+ permissions: (GlobalPermissionName | string)[];
371
+ }
372
+ export interface Hash {
373
+ hash: string;
374
+ }
375
+ export interface Patient {
376
+ id?: ObjectId;
377
+ firstName?: string;
378
+ lastName?: string;
379
+ email?: string;
380
+ activation?: boolean;
381
+ phoneNumber?: string;
382
+ profileImage?: string;
383
+ language?: LanguageCode;
384
+ timeZone?: TimeZone;
385
+ patientEnlistments?: PatientEnlistment[];
386
+ }
387
+ export interface RoleCreation {
388
+ name: string;
389
+ description: string;
390
+ }
391
+ export interface RoleUpdate {
392
+ name?: string;
393
+ description?: string;
394
+ }
395
+ export interface AddRole {
396
+ name: string;
397
+ description: string;
398
+ }
399
+ export interface RolePermissions {
400
+ permissions: (GlobalPermissionName | string)[];
401
+ }
402
+ export interface StaffGroups {
403
+ groups: ObjectId[];
404
+ }
405
+ export interface StaffMember {
406
+ id?: ObjectId;
407
+ firstName?: string;
408
+ lastName?: string;
409
+ profileImage?: string;
410
+ email?: string;
411
+ phoneNumber?: string;
412
+ timeZone?: TimeZone;
413
+ staffEnlistments?: StaffEnlistment[];
414
+ }
415
+ export interface StaffRoles {
416
+ roles: ObjectId[];
417
+ }
418
+ export interface UserRoles {
419
+ roles: ObjectId[];
420
+ }
421
+ export interface EmailTemplates {
422
+ /**
423
+ * Template id used by the User Service for the account activation email.
424
+ * @deprecated activationEmailTemplateId is deprecated in favor of activationEmailTemplateName
425
+ */
426
+ activationEmailTemplateId: string;
427
+ /**
428
+ * Template name used by the User Service for the account activation email.
429
+ */
430
+ activationEmailTemplateName: string;
431
+ /**
432
+ * Template id used by the User Service for the account reactivation email.
433
+ * @deprecated reactivationEmailTemplateId is deprecated in favor of reactivationEmailTemplateName
434
+ */
435
+ reactivationEmailTemplateId: string;
436
+ /** Template name used by the User Service for the account reactivation email. */
437
+ reactivationEmailTemplateName: string;
438
+ /**
439
+ * Template id used by the User Service for the password reset email.
440
+ * @deprecated passwordResetEmailTemplateId is deprecated in favor of passwordResetEmailTemplateName
441
+ */
442
+ passwordResetEmailTemplateId: string;
443
+ /** Template name used by the User Service for the password reset email. */
444
+ passwordResetEmailTemplateName: string;
445
+ /**
446
+ * Template id used by the User Service for the OIDC unlink email.
447
+ * @deprecated oidcUnlinkEmailTemplateId is deprecated in favor of oidcUnlinkEmailTemplateName
448
+ */
449
+ oidcUnlinkEmailTemplateId: string;
450
+ /** Template name used by the User Service for the OIDC unlink email. */
451
+ oidcUnlinkEmailTemplateName: string;
452
+ /**
453
+ * Template id used by the User Service for the OIDC unlink pin code email.
454
+ * @deprecated oidcUnlinkPinEmailTemplateId is deprecated in favor of oidcUnlinkPinEmailTemplateName
455
+ */
456
+ oidcUnlinkPinEmailTemplateId: string;
457
+ /** Template name used by the User Service for the OIDC unlink pin code email. */
458
+ oidcUnlinkPinEmailTemplateName: string;
459
+ /**
460
+ * Template id used by the User Service for the account activation pin code email.
461
+ * @deprecated activationPinEmailTemplateId is deprecated in favor of activationPinEmailTemplateName
462
+ */
463
+ activationPinEmailTemplateId: string;
464
+ /** Template name used by the User Service for the account activation pin code email. */
465
+ activationPinEmailTemplateName: string;
466
+ /**
467
+ * Template id used by the User Service for the account reactivation pin code email.
468
+ * @deprecated reactivationPinEmailTemplateId is deprecated in favor of reactivationPinEmailTemplateName
469
+ */
470
+ reactivationPinEmailTemplateId: string;
471
+ /** Template name used by the User Service for the account reactivation pin code email. */
472
+ reactivationPinEmailTemplateName: string;
473
+ /**
474
+ * Template id used by the User Service for the password reset pin code email.
475
+ * @deprecated passwordResetPinEmailTemplateId is deprecated in favor of passwordResetPinEmailTemplateName
476
+ */
477
+ passwordResetPinEmailTemplateId: string;
478
+ /** Template name used by the User Service for the password reset pin code email. */
479
+ passwordResetPinEmailTemplateName: string;
480
+ }
481
+ export interface PasswordResetRequestData {
482
+ email: string;
483
+ /** The verification mode to use. Defaults to `hash`. */
484
+ mode?: 'hash' | 'pin_code';
485
+ }
486
+ export interface ActivationRequestData {
487
+ email: string;
488
+ /** The verification mode to use. Defaults to `hash`. */
489
+ mode?: 'hash' | 'pin_code';
490
+ }
491
+ export interface UsersGlobalRolesService {
492
+ /**
493
+ * Retrieve a list of permissions
494
+ *
495
+ * Permission | Scope | Effect
496
+ * - | - | -
497
+ * none | | Everyone can use this endpoint
498
+ * @returns PagedResult<GlobalPermission>
499
+ */
500
+ getPermissions(options?: OptionsBase): Promise<PagedResult<GlobalPermission>>;
501
+ /**
502
+ * Retrieve a list of roles
503
+ *
504
+ * Permission | Scope | Effect
505
+ * - | - | -
506
+ * `VIEW_ROLE` | `global` | **Required** for this endpoint
507
+ */
508
+ find(options?: OptionsWithRql): Promise<PagedResult<Role>>;
509
+ /**
510
+ * Returns the first role found
511
+ *
512
+ * Permission | Scope | Effect
513
+ * - | - | -
514
+ * `VIEW_ROLE` | `global` | **Required** for this endpoint
515
+ */
516
+ findFirst(options?: OptionsWithRql): Promise<Role | undefined>;
517
+ /**
518
+ * Returns the first role with a specific id
519
+ *
520
+ * Permission | Scope | Effect
521
+ * - | - | -
522
+ * `VIEW_ROLE` | `global` | **Required** for this endpoint
523
+ */
524
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<Role | undefined>;
525
+ /**
526
+ * Returns the first role with a specific name
527
+ *
528
+ * Permission | Scope | Effect
529
+ * - | - | -
530
+ * `VIEW_ROLE` | `global` | **Required** for this endpoint
531
+ */
532
+ findByName(name: string, options?: OptionsWithRql): Promise<Role | undefined>;
533
+ /**
534
+ * @deprecated Use `find` instead
535
+ *
536
+ * Retrieve a list of roles
537
+ *
538
+ * Permission | Scope | Effect
539
+ * - | - | -
540
+ * `VIEW_ROLE` | `global` | **Required** for this endpoint
541
+ * @returns PagedResult<Role>
542
+ */
543
+ get(options?: OptionsWithRql): Promise<PagedResult<Role>>;
544
+ /**
545
+ * Create a role
546
+ *
547
+ * Permission | Scope | Effect
548
+ * - | - | -
549
+ * `CREATE_ROLE` | `global` | **Required** for this endpoint
550
+ * @param requestBody The role data
551
+ * @returns Role
552
+ */
553
+ create(requestBody: RoleCreation, options?: OptionsBase): Promise<Role>;
554
+ /**
555
+ * Delete a role
556
+ *
557
+ * Permission | Scope | Effect
558
+ * - | - | -
559
+ * `DELETE_ROLE` | `global` | **Required** for this endpoint
560
+ * @param rql Add filters to the requested list.
561
+ * @returns AffectedRecords
562
+ * @throws {ResourceUnknownError}
563
+ */
564
+ remove(rql: RQLString, options?: OptionsBase): Promise<AffectedRecords>;
565
+ /**
566
+ * Update a role
567
+ *
568
+ * Permission | Scope | Effect
569
+ * - | - | -
570
+ * `UPDATE_ROLE` | `global` | **Required** for this endpoint
571
+ * @param id Id of the targeted role
572
+ * @param requestBody RoleUpdate
573
+ * @returns Promise<Role>
574
+ */
575
+ update(id: ObjectId, requestBody: RoleUpdate, options?: OptionsBase): Promise<Role>;
576
+ /**
577
+ * Add permissions to a role
578
+ *
579
+ * Permission | Scope | Effect
580
+ * - | - | -
581
+ * `ADD_ROLE_PERMISSION` | `global` | **Required** for this endpoint
582
+ * @param requestBody RolePermissions
583
+ * @returns AffectedRecords
584
+ * @throws {ResourceUnknownError}
585
+ */
586
+ addPermissions(rql: RQLString, requestBody: RolePermissions, options?: OptionsBase): Promise<AffectedRecords>;
587
+ /**
588
+ * Remove permissions from roles
589
+ *
590
+ * Permission | Scope | Effect
591
+ * - | - | -
592
+ * `REMOVE_ROLE_PERMISSION` | `global` | **Required** for this endpoint
593
+ * @param rql Add filters to the requested list.
594
+ * @param requestBody RolePermissions
595
+ * @returns AffectedRecords
596
+ * @throws {ResourceUnknownError}
597
+ */
598
+ removePermissions(rql: RQLString, requestBody: RolePermissions, options?: OptionsBase): Promise<AffectedRecords>;
599
+ /**
600
+ * Add roles to users
601
+ *
602
+ * Permission | Scope | Effect
603
+ * - | - | -
604
+ * `ADD_ROLE_TO_USER` | `global` | **Required** for this endpoint
605
+ * @param requestBody UserRoles
606
+ * @returns AffectedRecords
607
+ */
608
+ addToUsers(rql: RQLString, requestBody: UserRoles, options?: OptionsBase): Promise<AffectedRecords>;
609
+ /**
610
+ * Remove roles from users
611
+ *
612
+ * Permission | Scope | Effect
613
+ * - | - | -
614
+ * `REMOVE_ROLE_FROM_USER` | `global` | **Required** for this endpoint
615
+ * @param rql Add filters to the requested list.
616
+ * @param requestBody UserRoles
617
+ * @returns AffectedRecords
618
+ */
619
+ removeFromUser(rql: RQLString, requestBody: UserRoles, options?: OptionsBase): Promise<AffectedRecords>;
620
+ }
621
+ export interface UsersGroupRolesService {
622
+ /**
623
+ * Retrieve a list of group permissions
624
+ *
625
+ * Permission | Scope | Effect
626
+ * - | - | -
627
+ * none | | Everyone can use this endpoint
628
+ * @returns PagedResult<GlobalPermission>
629
+ */
630
+ getPermissions(options?: OptionsBase): Promise<PagedResult<GlobalPermission>>;
631
+ /**
632
+ * Retrieve a list of group roles
633
+ *
634
+ * Permission | Scope | Effect
635
+ * - | - | -
636
+ * none | `staff enlistment` | View the roles for the group
637
+ * `VIEW_GROUP` | `global` | View any group its roles
638
+ */
639
+ find(groupId: ObjectId, options?: OptionsWithRql): Promise<PagedResult<GroupRole>>;
640
+ /**
641
+ * Returns the first group role found
642
+ *
643
+ * Permission | Scope | Effect
644
+ * - | - | -
645
+ * none | `staff enlistment` | View the roles for the group
646
+ * `VIEW_GROUP` | `global` | View any group its roles
647
+ */
648
+ findFirst(groupId: ObjectId, options?: OptionsWithRql): Promise<GroupRole | undefined>;
649
+ /**
650
+ * Finds a group role by its id
651
+ *
652
+ * Permission | Scope | Effect
653
+ * - | - | -
654
+ * none | `staff enlistment` | View the roles for the group
655
+ * `VIEW_GROUP` | `global` | View any group its roles
656
+ */
657
+ findById(groupId: ObjectId, roleId: ObjectId, options?: OptionsWithRql): Promise<GroupRole | undefined>;
658
+ /**
659
+ * Returns the first group role found by a specific name
660
+ *
661
+ * Permission | Scope | Effect
662
+ * - | - | -
663
+ * none | `staff enlistment` | View the roles for the group
664
+ * `VIEW_GROUP` | `global` | View any group its roles
665
+ */
666
+ findByName(groupId: ObjectId, roleName: string, options?: OptionsWithRql): Promise<GroupRole | undefined>;
667
+ /**
668
+ * @deprecated Use `find` instead
669
+ *
670
+ * Retrieve a list of group roles
671
+ *
672
+ * Permission | Scope | Effect
673
+ * - | - | -
674
+ * none | `staff enlistment` | View the roles for the group
675
+ * `VIEW_GROUP` | `global` | View any group its roles
676
+ * @param groupId Id of the targeted group
677
+ * @returns PagedResult<GroupRole>
678
+ */
679
+ get(groupId: ObjectId, options?: OptionsWithRql): Promise<PagedResult<GroupRole>>;
680
+ /**
681
+ * Add role to a group
682
+ *
683
+ * Permission | Scope | Effect
684
+ * - | - | -
685
+ * `CREATE_GROUP_ROLE` | `staff enlistment` | Create a role for any group
686
+ * `CREATE_GROUP_ROLE` | `global` | Create a role for the group
687
+ * @param groupId Id of the targeted group
688
+ * @param requestBody The role to add
689
+ * @returns GroupRole
690
+ */
691
+ add(groupId: ObjectId, requestBody: AddRole, options?: OptionsBase): Promise<GroupRole>;
692
+ /**
693
+ * Update a group role
694
+ *
695
+ * Permission | Scope | Effect
696
+ * - | - | -
697
+ * `UPDATE_GROUP_ROLE` | `staff enlistment` | Update a role for the group
698
+ * `UPDATE_GROUP_ROLE` | `global` | Update a role for any group
699
+ * @param groupId Id of the targeted group
700
+ * @param roleId Id of the targeted role
701
+ * @param requestBody The role data to update
702
+ * @returns GroupRole
703
+ * @throws {ResourceUnknownError}
704
+ */
705
+ update(groupId: ObjectId, roleId: ObjectId, requestBody: AddRole, options?: OptionsBase): Promise<GroupRole>;
706
+ /**
707
+ * Remove a role from a group
708
+ *
709
+ * Permission | Scope | Effect
710
+ * - | - | -
711
+ * `DELETE_GROUP_ROLE` | `staff enlistment` | Delete a role for the group
712
+ * `DELETE_GROUP_ROLE` | `global` | Delete a role from any group
713
+ * @param rql Add filters to the requested list.
714
+ * @param groupId Id of the targeted group
715
+ * @returns AffectedRecords
716
+ * @throws {ResourceUnknownError}
717
+ */
718
+ remove(rql: RQLString, groupId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
719
+ /**
720
+ * Add permissions to group roles
721
+ *
722
+ * Permission | Scope | Effect
723
+ * - | - | -
724
+ * `ADD_GROUP_ROLE_PERMISSION` | `staff enlistment` | Add permissions to roles of the group
725
+ * `ADD_GROUP_ROLE_PERMISSION` | `global` | Add permissions to roles of any group
726
+ * @param groupId Id of the targeted group
727
+ * @param requestBody GroupRolePermissions
728
+ * @returns AffectedRecords
729
+ * @throws {ResourceUnknownError}
730
+ */
731
+ addPermissions(groupId: ObjectId, requestBody: GroupRolePermissions, options?: OptionsWithRql): Promise<AffectedRecords>;
732
+ /**
733
+ * Remove permissions from group roles
734
+ *
735
+ * Permission | Scope | Effect
736
+ * - | - | -
737
+ * `REMOVE_GROUP_ROLE_PERMISSION` | `staff enlistment` | Remove permissions from roles of the group
738
+ * `REMOVE_GROUP_ROLE_PERMISSION` | `global` | Remove permissions from roles of any group
739
+ * @param rql Add filters to the requested list.
740
+ * @param groupId Id of the targeted group
741
+ * @param requestBody GroupRolePermissions
742
+ * @returns AffectedRecords
743
+ * @throws {ResourceUnknownError}
744
+ */
745
+ removePermissions(rql: RQLString, groupId: ObjectId, requestBody: GroupRolePermissions, options?: OptionsBase): Promise<AffectedRecords>;
746
+ /**
747
+ * Assign roles to staff members of a group
748
+ *
749
+ * Permission | Scope | Effect
750
+ * - | - | -
751
+ * `ADD_GROUP_ROLE_TO_STAFF` | `staff enlistment` | Assign roles for the group
752
+ * `ADD_GROUP_ROLE_TO_STAFF` | `global` | Assign roles for any group
753
+ * @param groupId Id of the targeted group
754
+ * @param requestBody StaffRoles
755
+ * @returns AffectedRecords
756
+ * @throws {ResourceUnknownError}
757
+ */
758
+ assignToStaff(groupId: ObjectId, requestBody: StaffRoles, options?: OptionsWithRql): Promise<AffectedRecords>;
759
+ /**
760
+ * Remove roles from staff members of a group
761
+ *
762
+ * Permission | Scope | Effect
763
+ * - | - | -
764
+ * `REMOVE_GROUP_ROLE_FROM_STAFF` | `staff enlistment` | Remove roles from staff of the group
765
+ * `REMOVE_GROUP_ROLE_FROM_STAFF` | `global` | Remove roles from staff of any group
766
+ * @param rql Add filters to the requested list.
767
+ * @param groupId Id of the targeted group
768
+ * @param requestBody StaffRoles
769
+ * @returns AffectedRecords
770
+ * @throws {ResourceUnknownError}
771
+ */
772
+ removeFromStaff(rql: RQLString, groupId: ObjectId, requestBody: StaffRoles, options?: OptionsBase): Promise<AffectedRecords>;
773
+ /**
774
+ * Add users to staff
775
+ *
776
+ * Permission | Scope | Effect
777
+ * - | - | -
778
+ * `ADD_STAFF` | `staff enlistment` | Add staff to the group
779
+ * `ADD_STAFF` | `global` | Add staff to any group
780
+ * @param requestBody StaffGroups
781
+ * @returns AffectedRecords
782
+ * @throws {ResourceUnknownError}
783
+ */
784
+ addUsersToStaff(requestBody: StaffGroups, options?: OptionsWithRql): Promise<AffectedRecords>;
785
+ /**
786
+ * Remove users from staff
787
+ *
788
+ * Permission | Scope | Effect
789
+ * - | - | -
790
+ * `REMOVE_STAFF` | `staff enlistment` | Remove staff from the group
791
+ * `REMOVE_STAFF` | `global` | Remove staff from any group
792
+ * @param rql Add filters to the requested list.
793
+ * @param requestBody StaffGroups
794
+ * @returns AffectedRecords
795
+ * @throws {ResourceUnknownError}
796
+ */
797
+ removeUsersFromStaff(rql: RQLString, requestBody: StaffGroups, options?: OptionsBase): Promise<AffectedRecords>;
798
+ }
799
+ export interface UsersService {
800
+ /**
801
+ * Retrieve the current logged in user
802
+ *
803
+ * Permission | Scope | Effect
804
+ * - | - | -
805
+ * none | | Everyone can use this endpoint
806
+ * @returns {UserData} UserData
807
+ */
808
+ me(options?: OptionsBase): Promise<User>;
809
+ /**
810
+ * Retrieve a specific user
811
+ * @params {string} userId of the targeted user (required)
812
+ *
813
+ * Permission | Scope | Effect
814
+ * - | - | -
815
+ * none | | See your own user object
816
+ * none | group | See a subset of the fields for any staff member or patient of the group
817
+ * VIEW_PATIENTS | global | See a subset of fields for any user with a patient enlistment
818
+ * VIEW_STAFF | global | See a subset of fields for any user with a staff enlistment
819
+ * VIEW_USER | global | See any user object
820
+ * @throws {ResourceUnknownError}
821
+ * @returns {UserData} UserData
822
+ */
823
+ findById(userId: string, options?: OptionsBase): Promise<User>;
824
+ /**
825
+ * Update a specific user
826
+ * @params {string} userId of the targeted user (required)
827
+ * @params {Pick<UserData,'firstName' | 'lastName' | 'phoneNumber' | 'language' | 'timeZone'>} data Fields to update
828
+ *
829
+ * Permission | Scope | Effect
830
+ * - | - | -
831
+ * none | | Update your own data
832
+ * `UPDATE_USER` | global | Update any user
833
+ * @throws {ResourceUnknownError}
834
+ * @returns {UserData} UserData
835
+ */
836
+ update(userId: string, userData: UserDataUpdate, options?: OptionsBase): Promise<UserData>;
837
+ /**
838
+ * Retrieve a list of users
839
+ *
840
+ * Permission | Scope | Effect
841
+ * - | - | -
842
+ * none | `patient enlistment` | See a limited set of fields of the staff members (of the groups where you are enlisted as a patient)
843
+ * none | `staff enlistment` | See a limited set of fields of all patients and staff members (of the groups where you are enlisted as staff member)
844
+ * `VIEW_USER` | `global` | See all fields of all users
845
+ * @returns PagedResultWithPager<User>
846
+ */
847
+ find(options?: OptionsWithRql): Promise<PagedResultWithPager<User>>;
848
+ /**
849
+ * Request a list of all users
850
+ *
851
+ * Do not pass in an rql with limit operator!
852
+ *
853
+ * Permission | Scope | Effect
854
+ * - | - | -
855
+ * none | `patient enlistment` | See a limited set of fields of the staff members (of the groups where you are enlisted as a patient)
856
+ * none | `staff enlistment` | See a limited set of fields of all patients and staff members (of the groups where you are enlisted as staff member)
857
+ * `VIEW_USER` | `global` | See all fields of all users
858
+ * @returns User[]
859
+ */
860
+ findAll(options?: OptionsWithRql): Promise<User[]>;
861
+ /**
862
+ * Request a list of all users
863
+ *
864
+ * Permission | Scope | Effect
865
+ * - | - | -
866
+ * none | `patient enlistment` | See a limited set of fields of the staff members (of the groups where you are enlisted as a patient)
867
+ * none | `staff enlistment` | See a limited set of fields of all patients and staff members (of the groups where you are enlisted as staff member)
868
+ * `VIEW_USER` | `global` | See all fields of all users
869
+ * @returns User[]
870
+ */
871
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<User>;
872
+ /**
873
+ * Find the first user matching the rql query
874
+ *
875
+ * Permission | Scope | Effect
876
+ * - | - | -
877
+ * none | `patient enlistment` | See a limited set of fields of the staff members (of the groups where you are enlisted as a patient)
878
+ * none | `staff enlistment` | See a limited set of fields of all patients and staff members (of the groups where you are enlisted as staff member)
879
+ * `VIEW_USER` | `global` | See all fields of all users
880
+ */
881
+ findFirst(options?: OptionsWithRql): Promise<User | undefined>;
882
+ /**
883
+ * Find a user by their email address
884
+ *
885
+ * Permission | Scope | Effect
886
+ * - | - | -
887
+ * none | `patient enlistment` | See a limited set of fields of the staff members (of the groups where you are enlisted as a patient)
888
+ * none | `staff enlistment` | See a limited set of fields of all patients and staff members (of the groups where you are enlisted as staff member)
889
+ * `VIEW_USER` | `global` | See all fields of all users
890
+ */
891
+ findByEmail(email: string, options?: OptionsWithRql): Promise<User | undefined>;
892
+ /**
893
+ * @deprecated
894
+ * Delete a list of users
895
+ *
896
+ * Permission | Scope | Effect
897
+ * - | - | -
898
+ * none | | Delete your own user (object)
899
+ * `DELETE_USER` | `global` | Delete any user
900
+ * @param rql Add filters to the requested list.
901
+ * @returns AffectedRecords
902
+ */
903
+ removeUsers(rql: RQLString, options?: OptionsBase): Promise<AffectedRecords>;
904
+ /**
905
+ * Retrieve a list of users that have a patient enlistment
906
+ *
907
+ * Permission | Scope | Effect
908
+ * - | - | -
909
+ * none | `staff enlistment` | View the patients of the group
910
+ * `VIEW_PATIENTS` | `global` | View all patients
911
+ * @returns Patient Success
912
+ */
913
+ patients(options?: OptionsWithRql): Promise<PagedResult<Patient>>;
914
+ /**
915
+ * Retrieve a list of users that have a staff enlistment
916
+ *
917
+ * Permission | Scope | Effect
918
+ * - | - | -
919
+ * none | `staff enlistment` | View the other staff members of the group
920
+ * `VIEW_STAFF` | `global` | View all staff members
921
+ * @returns StaffMember Success
922
+ */
923
+ staff(options?: OptionsWithRql): Promise<PagedResult<StaffMember>>;
924
+ /**
925
+ * Delete a specific user
926
+ *
927
+ * Permission | Scope | Effect
928
+ * - | - | -
929
+ * none | | Delete your own user object
930
+ * `DELETE_USER` | `global` | Delete any user
931
+ * @param userId Id of the targeted user
932
+ * @returns AffectedRecords
933
+ * @throws {ResourceUnknownError}
934
+ */
935
+ remove(userId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
936
+ /**
937
+ * Update the email address of a specific user.
938
+ *
939
+ * An email is send to the new email address with a token and instructions to reactivate the account.
940
+ * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
941
+ *
942
+ * By default the email send to the user is the email template configured by `reactivationEmailTemplateName`.
943
+ * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
944
+ * The hash should be used within 60 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
945
+ *
946
+ * If enabled, a pin code can be used rather than a hash.
947
+ * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
948
+ * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
949
+ * Then the email send to the user is the email template configured by `reactivationPinEmailTemplateName`.
950
+ * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
951
+ * The pin code should be used within 15 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
952
+ *
953
+ * If a custom (or no) account activation flow is desired, the `activationMode` field can be set to `manual`.
954
+ * No email will be send.
955
+ *
956
+ * Permission | Scope | Effect
957
+ * - | - | -
958
+ * none | | Update your own data
959
+ * `UPDATE_USER_EMAIL` | `global` | Update any user
960
+ *
961
+ * @throws {EmailUsedError}
962
+ * @throws {ResourceUnknownError}
963
+ * @throws {PinCodesNotEnabledError} Pin codes are not enabled, please check the verification settings
964
+ */
965
+ updateEmail(userId: ObjectId, requestBody: EmailUpdate, options?: OptionsBase): Promise<User>;
966
+ /**
967
+ * Add a patient enlistment to a user
968
+ *
969
+ * Permission | Scope | Effect
970
+ * - | - | -
971
+ * `ADD_PATIENT` | `global` | **Required** for this endpoint
972
+ * @param userId Id of the targeted user
973
+ * @param requestBody AddPatientEnlistment
974
+ * @returns AffectedRecords
975
+ * @throws {ResourceAlreadyExistsError}
976
+ */
977
+ addPatientEnlistment(userId: ObjectId, requestBody: AddPatientEnlistment, options?: OptionsBase): Promise<AffectedRecords>;
978
+ /**
979
+ * Remove a patient enlistment from a user
980
+ *
981
+ * Permission | Scope | Effect
982
+ * - | - | -
983
+ * none | | Remove a patient enlistment from yourself
984
+ * `REMOVE_PATIENT` | `staff enlistment` | Remove a patient enlistment for the group
985
+ * `REMOVE_PATIENT` | `global` | Remove any patient enlistment
986
+ * @param userId Id of the targeted user
987
+ * @param groupId Id of the targeted group
988
+ * @returns AffectedRecords
989
+ * @throws {ResourceUnknownError}
990
+ */
991
+ removePatientEnlistment(userId: ObjectId, groupId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
992
+ /**
993
+ * Create an account.
994
+ *
995
+ * An email is send to the supplied email address with a token and instructions to activate the account.
996
+ * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
997
+ *
998
+ * By default the email send to the user is the email template configured by `activationEmailTemplateName`.
999
+ * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
1000
+ * The hash should be used within 60 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
1001
+ *
1002
+ * If enabled, a pin code can be used rather than a hash.
1003
+ * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
1004
+ * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
1005
+ * Then the email send to the user is the email template configured by `activationPinEmailTemplateName`.
1006
+ * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
1007
+ * The pin code should be used within 15 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
1008
+ *
1009
+ * If a custom (or no) account activation flow is desired, the `activationMode` field can be set to `manual`.
1010
+ * No email will be send.
1011
+ *
1012
+ * Permission | Scope | Effect
1013
+ * - | - | -
1014
+ * none | | Everyone can use this endpoint
1015
+ *
1016
+ * @throws {EmailUsedError}
1017
+ * @throws {PinCodesNotEnabledError} Pin codes are not enabled, please check the verification settings
1018
+ */
1019
+ createAccount(requestBody: RegisterUserData, options?: OptionsBase): Promise<User>;
1020
+ /**
1021
+ * Change your password
1022
+ *
1023
+ * Permission | Scope | Effect
1024
+ * - | - | -
1025
+ * none | | Everyone can use this endpoint
1026
+ * @param requestBody ChangePassword
1027
+ * @returns User
1028
+ * @throws {PasswordError}
1029
+ */
1030
+ changePassword(requestBody: ChangePassword, options?: OptionsBase): Promise<boolean>;
1031
+ /**
1032
+ * Authenticate a user
1033
+ *
1034
+ * Permission | Scope | Effect
1035
+ * - | - | -
1036
+ * none | | Everyone can use this endpoint
1037
+ * @param requestBody Authenticate
1038
+ * @returns User
1039
+ * @throws {AuthenticationError}
1040
+ * @throws {LoginTimeoutError}
1041
+ * @throws {LoginFreezeError}
1042
+ * @throws {TooManyFailedAttemptsError}
1043
+ */
1044
+ authenticate(requestBody: Authenticate, options?: OptionsBase): Promise<User>;
1045
+ /**
1046
+ * Request an email activation.
1047
+ *
1048
+ * An email is send to the supplied email address with a token and instructions to activate the account.
1049
+ * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
1050
+ *
1051
+ * The email send to the user is the email template configured by `activationEmailTemplateName`.
1052
+ * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
1053
+ * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1054
+ *
1055
+ * Permission | Scope | Effect
1056
+ * - | - | -
1057
+ * none | | Everyone can use this endpoint
1058
+ *
1059
+ * @throws {EmailUnknownError}
1060
+ * @throws {AlreadyActivatedError}
1061
+ * @throws {IllegalStateError} Attempting to use `activationEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1062
+ * @throws {ActivationRequestLimitError} The maximum allowed consecutive activation requests is reached
1063
+ * @throws {ActivationRequestTimeoutError} Activation request too short after the previous one
1064
+ */
1065
+ requestEmailActivation(email: string, options?: OptionsBase): Promise<boolean>;
1066
+ /**
1067
+ * Request an email activation.
1068
+ *
1069
+ * An email is send to the supplied email address with a token and instructions to activate the account.
1070
+ * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
1071
+ *
1072
+ * By default the email send to the user is the email template configured by `activationEmailTemplateName`.
1073
+ * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
1074
+ * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1075
+ *
1076
+ * If enabled, a pin code can be used rather than a hash.
1077
+ * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
1078
+ * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
1079
+ * Then the email send to the user is the email template configured by `activationPinEmailTemplateName`.
1080
+ * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
1081
+ * The pin code should be used within 15 minutes, otherwise this method should be called again to request a new email.
1082
+ *
1083
+ * Permission | Scope | Effect
1084
+ * - | - | -
1085
+ * none | | Everyone can use this endpoint
1086
+ *
1087
+ * @throws {EmailUnknownError}
1088
+ * @throws {AlreadyActivatedError}
1089
+ * @throws {IllegalStateError} Attempting to use either `activationEmailTemplateName` or `activationPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1090
+ * @throws {ActivationRequestLimitError} The maximum allowed consecutive activation requests is reached
1091
+ * @throws {ActivationRequestTimeoutError} Activation request too short after the previous one
1092
+ */
1093
+ requestEmailActivation(data: ActivationRequestData, options?: OptionsBase): Promise<boolean>;
1094
+ /**
1095
+ * Complete an email activation.
1096
+ *
1097
+ * Either a hash activation with just the `hash` field.
1098
+ * Or a pin code activation with the `email` and `pinCode` fields.
1099
+ *
1100
+ * Permission | Scope | Effect
1101
+ * - | - | -
1102
+ * none | | Everyone can use this endpoint
1103
+ *
1104
+ * @throws {ActivationUnknownError}
1105
+ * @throws {TooManyFailedAttemptsError} Attempts are blocked due to too many failed attempts, a new activation request needs to be generated before new attempts can be made
1106
+ * @throws {IncorrectPinCodeError} The provided pin code was incorrect
1107
+ */
1108
+ validateEmailActivation(requestBody: ActivationCompletion, options?: OptionsBase): Promise<boolean>;
1109
+ /**
1110
+ * Request a password reset.
1111
+ *
1112
+ * An email is send to the targeted user with a token and instructions to reset their password.
1113
+ * The token should be used to complete the password reset via `exh.users.validatePasswordReset`.
1114
+ *
1115
+ * The email send to the user is the email template configured by `passwordResetEmailTemplateName`.
1116
+ * The template receives a 40 hexadecimal character hash in the `content.reset_hash` variable.
1117
+ * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1118
+ *
1119
+ * Permission | Scope | Effect
1120
+ * - | - | -
1121
+ * none | | Everyone can use this endpoint
1122
+ *
1123
+ * @throws {EmailUnknownError}
1124
+ * @throws {NotActivatedError}
1125
+ * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateName` or `passwordResetPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1126
+ * @throws {ForgotPasswordRequestLimitError} The maximum allowed consecutive forgot password requests is reached
1127
+ * @throws {ForgotPasswordRequestTimeoutError} Forgot password request too short after the previous one
1128
+ */
1129
+ requestPasswordReset(email: string, options?: OptionsBase): Promise<boolean>;
1130
+ /**
1131
+ * Request a password reset.
1132
+ *
1133
+ * An email is send to the targeted user with a token and instructions to reset their password.
1134
+ * The token should be used to complete the password reset via `exh.users.validatePasswordReset`.
1135
+ *
1136
+ * By default the email send to the user is the email template configured by `passwordResetEmailTemplateName`.
1137
+ * The template receives a 40 hexadecimal character hash in the `content.reset_hash` variable.
1138
+ * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1139
+ *
1140
+ * If enabled, a pin code can be used rather than a hash.
1141
+ * The pin code mode must be enabled by the `enablePinCodeForgotPasswordRequests` verification setting.
1142
+ * To use the pin code mode, the `mode` field can be set to `pin_code`.
1143
+ * Then the email send to the user is the email template configured by `passwordResetPinEmailTemplateName`.
1144
+ * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
1145
+ * The pin code should be used within 15 minutes, otherwise this method should be called again to request a new email.
1146
+ *
1147
+ * Permission | Scope | Effect
1148
+ * - | - | -
1149
+ * none | | Everyone can use this endpoint
1150
+ *
1151
+ * @throws {EmailUnknownError}
1152
+ * @throws {NotActivatedError}
1153
+ * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateName` or `passwordResetPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1154
+ * @throws {DisabledForOidcUsersError}
1155
+ * @throws {PinCodesNotEnabledError} Pin codes are not enabled, please check the verification settings
1156
+ * @throws {ForgotPasswordRequestLimitError} The maximum allowed consecutive forgot password requests is reached
1157
+ * @throws {ForgotPasswordRequestTimeoutError} Forgot password request too short after the previous one
1158
+ */
1159
+ requestPasswordReset(data: PasswordResetRequestData, options?: OptionsBase): Promise<boolean>;
1160
+ /**
1161
+ * Complete a password reset.
1162
+ *
1163
+ * Either a hash password reset with the `hash` and `newPassword` fields.
1164
+ * Or a pin code password reset with the `email`, `pinCode` and `newPassword` fields.
1165
+ *
1166
+ * Permission | Scope | Effect
1167
+ * - | - | -
1168
+ * none | | Everyone can use this endpoint
1169
+ *
1170
+ * @throws {NotActivatedError}
1171
+ * @throws {NewPasswordHashUnknownError} The provided hash either does not exist or is expired
1172
+ * @throws {NewPasswordPinCodeUnknownError} No password reset request was found or it is expired for the provided email
1173
+ * @throws {TooManyFailedAttemptsError} Attempts are blocked due to too many failed attempts, a new password reset request needs to be generated before new attempts can be made
1174
+ * @throws {IncorrectPinCodeError} The provided pin code was incorrect
1175
+ * @throws {DisabledForOidcUsersError}
1176
+ */
1177
+ validatePasswordReset(requestBody: PasswordResetCompletion, options?: OptionsBase): Promise<boolean>;
1178
+ /**
1179
+ * Confirm the password for the user making the request
1180
+ *
1181
+ * Permission | Scope | Effect
1182
+ * - | - | -
1183
+ * none | | Everyone can use this endpoint
1184
+ * @param requestBody the password to confirm
1185
+ * @returns {boolean} true if password was confirmed
1186
+ * @throws {AuthenticationError}
1187
+ * @throws {LoginTimeoutError}
1188
+ * @throws {LoginFreezeError}
1189
+ * @throws {TooManyFailedAttemptsError}
1190
+ */
1191
+ confirmPassword(requestBody: ConfirmPassword, options?: OptionsBase): Promise<boolean>;
1192
+ /**
1193
+ * Check if an email address is still available
1194
+ *
1195
+ * Permission | Scope | Effect
1196
+ * - | - | -
1197
+ * none | | Everyone can use this endpoint
1198
+ * @param email
1199
+ * @returns emailAvailable will be true on success
1200
+ */
1201
+ isEmailAvailable(email: string, options?: OptionsBase): Promise<{
1202
+ emailAvailable: boolean;
1203
+ }>;
1204
+ /**
1205
+ * Update the profile image of a user
1206
+ *
1207
+ * Permission | Scope | Effect
1208
+ * - | - | -
1209
+ * none | | Update your own profile image
1210
+ * `UPDATE_PROFILE_IMAGE` | `global` | Update any user its profile image
1211
+ * @deprecated this method is deprecated in swagger
1212
+ * @param userId Id of the targeted user
1213
+ * @param requestBody Hash
1214
+ * @returns User
1215
+ * @throws {ResourceUnknownError}
1216
+ */
1217
+ updateProfileImage(userId: ObjectId, requestBody: Hash, options?: OptionsBase): Promise<User>;
1218
+ /**
1219
+ * Delete the profile image of a user
1220
+ *
1221
+ * Permission | Scope | Effect
1222
+ * - | - | -
1223
+ * none | | Delete your own profile image
1224
+ * `UPDATE_PROFILE_IMAGE` | `global` | Delete any user its profile image
1225
+ * @param userId Id of the targeted user
1226
+ * @returns User
1227
+ * @throws {ResourceUnknownError}
1228
+ */
1229
+ deleteProfileImage(userId: ObjectId, options?: OptionsBase): Promise<User>;
1230
+ /**
1231
+ * Retrieve the current pasword policy
1232
+ *
1233
+ * Permission | Scope | Effect
1234
+ * - | - | -
1235
+ * none | | Everyone can use this endpoint
1236
+ * @returns {PasswordPolicy} PasswordPolicy
1237
+ */
1238
+ passwordPolicy(options?: OptionsBase): Promise<PasswordPolicy>;
1239
+ /**
1240
+ * Update the current password policy
1241
+ *
1242
+ * Permission | Scope | Effect
1243
+ * - | - | -
1244
+ * `UPDATE_PASSWORD_POLICY` | `global` | Update password policy
1245
+ */
1246
+ updatePasswordPolicy(requestBody: PasswordPolicyUpdate, options?: OptionsBase): Promise<PasswordPolicyUpdate>;
1247
+ /**
1248
+ * ## Retrieve a list of email templates
1249
+ *
1250
+ * **Global Permissions:**
1251
+ * - `VIEW_USER_SERVICE_EMAIL_TEMPLATES` - Allows a user to view the email templates configuration
1252
+ *
1253
+ * **Notes:**
1254
+ * - If an email template has not been set, it will not appear in the response
1255
+ * @param options {@link OptionsBase} - Add options to the request
1256
+ * @returns A list of email templates {@link EmailTemplates}
1257
+ */
1258
+ getEmailTemplates(options?: OptionsBase): Promise<Partial<EmailTemplates>>;
1259
+ /**
1260
+ * ## Set the list of email templates
1261
+ *
1262
+ * **Global Permissions:**
1263
+ * - `UPDATE_USER_SERVICE_EMAIL_TEMPLATES` - Allows a user to update the email templates configuration
1264
+ *
1265
+ * **Notes:**
1266
+ * - This operation works as an update and will only update the templates that are provided
1267
+ * - id fields are deprecated and will be removed in a future release, it is recommended to use the name fields instead
1268
+ * - name and id fields are mutually exclusive, e.g., setting `activation_email_template_name` will remove `activation_email_template_id` and vice versa
1269
+ * @param templates {@link EmailTemplates} - A partial list of email templates to update
1270
+ * @returns A list of email templates {@link EmailTemplates}
1271
+ */
1272
+ setEmailTemplates(templates: Partial<EmailTemplates>): Promise<Partial<EmailTemplates>>;
1273
+ /**
1274
+ * Perform a health check
1275
+ * @returns {boolean} success
1276
+ */
1277
+ health(): Promise<boolean>;
1278
+ }