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