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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/btoa.d.ts +6 -0
  3. package/build/client.d.ts +147 -0
  4. package/build/constants.d.ts +17 -0
  5. package/build/errorHandler.d.ts +1 -0
  6. package/build/errors.d.ts +361 -0
  7. package/build/http/client.d.ts +2 -0
  8. package/build/http/index.d.ts +4 -0
  9. package/build/http/interceptors.d.ts +9 -0
  10. package/build/http/oAuth1Signature.d.ts +18 -0
  11. package/build/http/oauth1.d.ts +3 -0
  12. package/build/http/oauth2.d.ts +3 -0
  13. package/build/http/proxy.d.ts +3 -0
  14. package/build/http/types.d.ts +331 -0
  15. package/build/http/utils.d.ts +21 -0
  16. package/build/index.cjs.js +1 -1
  17. package/build/index.d.ts +9 -0
  18. package/build/index.mjs +1 -1
  19. package/build/mock.d.ts +43 -0
  20. package/build/mockType.d.ts +1721 -0
  21. package/build/parseStoredCredentials.d.ts +11 -0
  22. package/build/rql/index.d.ts +16 -0
  23. package/build/rql/parser.d.ts +1 -0
  24. package/build/rql/types.d.ts +174 -0
  25. package/build/services/auth/applications/index.d.ts +5 -0
  26. package/build/services/auth/applications/types.d.ts +260 -0
  27. package/build/services/auth/index.d.ts +3 -0
  28. package/build/services/auth/oauth1/index.d.ts +5 -0
  29. package/build/services/auth/oauth1/types.d.ts +102 -0
  30. package/build/services/auth/oauth2/index.d.ts +5 -0
  31. package/build/services/auth/oauth2/types.d.ts +100 -0
  32. package/build/services/auth/oidc/index.d.ts +5 -0
  33. package/build/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  34. package/build/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  35. package/build/services/auth/oidc/providers/index.d.ts +5 -0
  36. package/build/services/auth/oidc/providers/types.d.ts +148 -0
  37. package/build/services/auth/oidc/types.d.ts +40 -0
  38. package/build/services/auth/types.d.ts +39 -0
  39. package/build/services/auth/users/index.d.ts +5 -0
  40. package/build/services/auth/users/types.d.ts +121 -0
  41. package/build/services/configurations/general.d.ts +5 -0
  42. package/build/services/configurations/groups.d.ts +5 -0
  43. package/build/services/configurations/index.d.ts +10 -0
  44. package/build/services/configurations/patients.d.ts +5 -0
  45. package/build/services/configurations/staff.d.ts +5 -0
  46. package/build/services/configurations/types.d.ts +222 -0
  47. package/build/services/configurations/users.d.ts +5 -0
  48. package/build/services/data/comments.d.ts +5 -0
  49. package/build/services/data/documents.d.ts +5 -0
  50. package/build/services/data/index.d.ts +13 -0
  51. package/build/services/data/indexes.d.ts +5 -0
  52. package/build/services/data/infrastructure.d.ts +10 -0
  53. package/build/services/data/json-schema.d.ts +121 -0
  54. package/build/services/data/properties.d.ts +5 -0
  55. package/build/services/data/schemas.d.ts +5 -0
  56. package/build/services/data/statuses.d.ts +5 -0
  57. package/build/services/data/transitions.d.ts +5 -0
  58. package/build/services/data/types.d.ts +1500 -0
  59. package/build/services/dispatchers/actions/index.d.ts +5 -0
  60. package/build/services/dispatchers/actions/types.d.ts +78 -0
  61. package/build/services/dispatchers/dispatchers/index.d.ts +5 -0
  62. package/build/services/dispatchers/dispatchers/types.d.ts +111 -0
  63. package/build/services/dispatchers/index.d.ts +7 -0
  64. package/build/services/dispatchers/types.d.ts +2 -0
  65. package/build/services/events/events.d.ts +5 -0
  66. package/build/services/events/index.d.ts +5 -0
  67. package/build/services/events/subscriptions.d.ts +5 -0
  68. package/build/services/events/types.d.ts +107 -0
  69. package/build/services/files/files.d.ts +5 -0
  70. package/build/services/files/formHelpers.d.ts +3 -0
  71. package/build/services/files/index.d.ts +6 -0
  72. package/build/services/files/settings/index.d.ts +5 -0
  73. package/build/services/files/settings/types.d.ts +38 -0
  74. package/build/services/files/tokens.d.ts +5 -0
  75. package/build/services/files/types.d.ts +185 -0
  76. package/build/services/helpers.d.ts +7 -0
  77. package/build/services/http-client.d.ts +22 -0
  78. package/build/services/index.d.ts +16 -0
  79. package/build/services/localizations/countries.d.ts +5 -0
  80. package/build/services/localizations/index.d.ts +3 -0
  81. package/build/services/localizations/languages.d.ts +5 -0
  82. package/build/services/localizations/localizations.d.ts +5 -0
  83. package/build/services/localizations/types.d.ts +150 -0
  84. package/build/services/logs/access/index.d.ts +5 -0
  85. package/build/services/logs/access/types.d.ts +41 -0
  86. package/build/services/logs/index.d.ts +3 -0
  87. package/build/services/logs/types.d.ts +4 -0
  88. package/build/services/mails/index.d.ts +3 -0
  89. package/build/services/mails/mails.d.ts +5 -0
  90. package/build/services/mails/types.d.ts +149 -0
  91. package/build/services/notifications/index.d.ts +6 -0
  92. package/build/services/notifications/notifications.d.ts +5 -0
  93. package/build/services/notifications/settings.d.ts +5 -0
  94. package/build/services/notifications/types.d.ts +235 -0
  95. package/build/services/notificationsV2/index.d.ts +6 -0
  96. package/build/services/notificationsV2/notificationsV2.d.ts +5 -0
  97. package/build/services/notificationsV2/types.d.ts +166 -0
  98. package/build/services/notificationsV2/userSettings/index.d.ts +5 -0
  99. package/build/services/notificationsV2/userSettings/types.d.ts +138 -0
  100. package/build/services/payments/appStore.d.ts +5 -0
  101. package/build/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/services/payments/health.d.ts +9 -0
  103. package/build/services/payments/index.d.ts +15 -0
  104. package/build/services/payments/orders.d.ts +5 -0
  105. package/build/services/payments/playStore.d.ts +5 -0
  106. package/build/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/services/payments/products.d.ts +5 -0
  109. package/build/services/payments/stripe.d.ts +5 -0
  110. package/build/services/payments/subscriptions.d.ts +5 -0
  111. package/build/services/payments/types.d.ts +1198 -0
  112. package/build/services/profiles/groups.d.ts +5 -0
  113. package/build/services/profiles/index.d.ts +8 -0
  114. package/build/services/profiles/logs.d.ts +5 -0
  115. package/build/services/profiles/profiles.d.ts +5 -0
  116. package/build/services/profiles/types.d.ts +375 -0
  117. package/build/services/tasks/api/index.d.ts +5 -0
  118. package/build/services/tasks/api/types.d.ts +146 -0
  119. package/build/services/tasks/apiRequests/index.d.ts +5 -0
  120. package/build/services/tasks/apiRequests/logs/index.d.ts +5 -0
  121. package/build/services/tasks/apiRequests/logs/types.d.ts +25 -0
  122. package/build/services/tasks/apiRequests/types.d.ts +83 -0
  123. package/build/services/tasks/functions/index.d.ts +5 -0
  124. package/build/services/tasks/functions/types.d.ts +171 -0
  125. package/build/services/tasks/index.d.ts +15 -0
  126. package/build/services/tasks/logs/index.d.ts +5 -0
  127. package/build/services/tasks/logs/types.d.ts +28 -0
  128. package/build/services/tasks/schedules/index.d.ts +5 -0
  129. package/build/services/tasks/schedules/types.d.ts +92 -0
  130. package/build/services/tasks/tasks.d.ts +5 -0
  131. package/build/services/tasks/types.d.ts +118 -0
  132. package/build/services/templates/index.d.ts +3 -0
  133. package/build/services/templates/templates.d.ts +5 -0
  134. package/build/services/templates/types.d.ts +237 -0
  135. package/build/services/templatesV2/index.d.ts +3 -0
  136. package/build/services/templatesV2/templatesV2.d.ts +5 -0
  137. package/build/services/templatesV2/types.d.ts +156 -0
  138. package/build/services/types.d.ts +103 -0
  139. package/build/services/users/activationRequests/index.d.ts +4 -0
  140. package/build/services/users/activationRequests/types.d.ts +70 -0
  141. package/build/services/users/forgotPasswordRequests/index.d.ts +4 -0
  142. package/build/services/users/forgotPasswordRequests/types.d.ts +70 -0
  143. package/build/services/users/globalRoles.d.ts +5 -0
  144. package/build/services/users/groupRoles.d.ts +5 -0
  145. package/build/services/users/index.d.ts +14 -0
  146. package/build/services/users/settings/index.d.ts +4 -0
  147. package/build/services/users/settings/types.d.ts +47 -0
  148. package/build/services/users/types.d.ts +1278 -0
  149. package/build/services/users/users.d.ts +5 -0
  150. package/build/sha1.d.ts +11 -0
  151. package/build/types/services/users/types.d.ts +69 -25
  152. package/build/types/version.d.ts +1 -1
  153. package/build/types.d.ts +104 -0
  154. package/build/utils.d.ts +5 -0
  155. package/build/version.d.ts +1 -0
  156. package/package.json +3 -3
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { ProfilesGroupsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ProfilesGroupsService;
5
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import groups from './groups';
3
+ import logs from './logs';
4
+ import { ProfilesGroupsService, ProfilesLogsService, ProfilesService } from './types';
5
+ export declare const profilesService: (httpWithAuth: HttpInstance) => ProfilesService & {
6
+ groups: ProfilesGroupsService;
7
+ logs: ProfilesLogsService;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { ProfilesLogsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ProfilesLogsService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import { HttpClient } from '../http-client';
3
+ import { ProfilesService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ProfilesService;
5
+ export default _default;
@@ -0,0 +1,375 @@
1
+ import { RQLString } from '../../rql';
2
+ import { FindAllIterator } from '../../services/helpers';
3
+ import { AffectedRecords, ObjectId, OptionsBase, OptionsWithRql, PagedResult } from '../types';
4
+ export interface Profile {
5
+ id: ObjectId;
6
+ addressLine1?: string;
7
+ addressLine2?: string;
8
+ country: string;
9
+ region?: string;
10
+ city?: string;
11
+ postalCode?: string;
12
+ birthday: string;
13
+ /**
14
+ * See ISO 5218
15
+ */
16
+ gender: number;
17
+ length?: number;
18
+ weight?: number;
19
+ afHistory?: boolean;
20
+ comorbidities?: Array<Comorbidities>;
21
+ physician?: string;
22
+ smoker?: boolean;
23
+ activity?: ProfileActivity;
24
+ impediments?: Array<Impediments>;
25
+ medication?: Array<Medication>;
26
+ groups?: Array<Group>;
27
+ customFields?: Record<string, string>;
28
+ fibricheckInfo?: {
29
+ app?: {
30
+ version?: string;
31
+ build?: string;
32
+ branch?: string;
33
+ };
34
+ device?: {
35
+ os?: string;
36
+ model?: string;
37
+ type?: 'android' | 'ios';
38
+ manufacturer?: string;
39
+ };
40
+ };
41
+ creationTimestamp?: Date;
42
+ updateTimestamp?: Date;
43
+ }
44
+ export declare type ProfileCreation = Pick<Profile, 'id' | 'country' | 'region' | 'birthday' | 'gender'>;
45
+ export declare type ProfileUpdate = Partial<Omit<Profile, 'id' | 'groups' | 'medication' | 'creationTimestamp' | 'updateTimestamp'>>;
46
+ export declare enum ProfileActivity {
47
+ NOT_ACTIVE = "NOT_ACTIVE",
48
+ SLIGHTLY_ACTIVE = "SLIGHTLY_ACTIVE",
49
+ MODERATELY_ACTIVE = "MODERATELY_ACTIVE",
50
+ ACTIVE = "ACTIVE",
51
+ VERY_ACTIVE = "VERY_ACTIVE"
52
+ }
53
+ export declare enum Comorbidities {
54
+ HEART_FAILURE = "HEART_FAILURE",
55
+ DIABETES = "DIABETES",
56
+ COPD = "COPD",
57
+ HYPERTENSION = "HYPERTENSION",
58
+ VASCULAR_DISEASE = "VASCULAR_DISEASE",
59
+ HISTORY_OF_TIA_STROKE = "HISTORY_OF_TIA_STROKE"
60
+ }
61
+ export declare enum Impediments {
62
+ TREMOR = "TREMOR",
63
+ PERNIOSIS = "PERNIOSIS",
64
+ CALLUS = "CALLUS"
65
+ }
66
+ export interface Medication {
67
+ name: string;
68
+ dosis: {
69
+ number?: number;
70
+ unit?: MedicationUnit;
71
+ };
72
+ medicationFrequency?: MedicationFrequency;
73
+ count: number;
74
+ }
75
+ export declare enum MedicationUnit {
76
+ MG = "mg",
77
+ ML = "ml",
78
+ PILL = "pill"
79
+ }
80
+ export declare enum MedicationFrequency {
81
+ AS_NEEDED = "AS_NEEDED",
82
+ EVERY_DAY = "EVERY_DAY",
83
+ EVERY_WEEK = "EVERY_WEEK",
84
+ EVERY_MONTH = "EVERY_MONTH",
85
+ BIRTH_CONTROL = "BIRTH_CONTROL"
86
+ }
87
+ export interface Group {
88
+ groupId: ObjectId;
89
+ reason?: string;
90
+ /**
91
+ * This serves as a field to link a patient to the medical record of a hospital/physician. This field therefor accepts any string, not just an ObjectId.
92
+ *
93
+ */
94
+ patientId?: string;
95
+ customFields?: Record<string, string>;
96
+ }
97
+ export declare type GroupCreation = Group;
98
+ export interface LogEntry {
99
+ id?: ObjectId;
100
+ profileId?: ObjectId;
101
+ groupId?: ObjectId;
102
+ userId?: ObjectId;
103
+ text?: string;
104
+ creationTimestamp?: Date;
105
+ updateTimestamp?: Date;
106
+ }
107
+ export interface ProfileComment {
108
+ text: string;
109
+ }
110
+ export interface ProfilesGroupsService {
111
+ /**
112
+ * Add a group enlistment to a profile
113
+ *
114
+ * Permission | Scope | Effect
115
+ * - | - | -
116
+ * none | | Add a group enlistment for your profile only
117
+ * `ADD_PATIENT` | `staff enlistment` | Add a group enlistment for any profile of this group
118
+ * `ADD_PATIENT` & `ACTIVATE_PRESCRIPTIONS` | `global` | Add a group enlistment for any profile for any group
119
+ * @param profileId Id of the targeted profile
120
+ * @param requestBody Group data
121
+ * @returns Group
122
+ * @throws {ResourceAlreadyExistsError}
123
+ * @throws {ResourceUnknownError}
124
+ */
125
+ create(profileId: ObjectId, requestBody: GroupCreation, options?: OptionsBase): Promise<Group>;
126
+ /**
127
+ * Update a group enlistment on a profile
128
+ *
129
+ * Permission | Scope | Effect
130
+ * - | - | -
131
+ * `UPDATE_PROFILES` | `staff enlistment` | Update a group enlistment for any profile for this group
132
+ * `UPDATE_PROFILES` | `global` | Update a group enlistment for any profile for any group
133
+ * @param profileId Id of the targeted profile
134
+ * @param groupId Id of the targeted group
135
+ * @param requestBody Group data to update
136
+ * @returns Group
137
+ * @throws {ResourceUnknownError}
138
+ */
139
+ update(profileId: ObjectId, groupId: ObjectId, requestBody: Omit<Group, 'groupId'>, options?: OptionsBase): Promise<Group>;
140
+ /**
141
+ * Delete a group from a profile
142
+ *
143
+ * Permission | Scope | Effect
144
+ * - | - | -
145
+ * none | | Delete a group from your profile only
146
+ * `UPDATE_PROFILES` | `staff enlistment` | Delete a group from any profile in this group
147
+ * `UPDATE_PROFILES` | `global` | Delete a group from any profile in any group
148
+ * @param profileId Id of the targeted profile
149
+ * @param groupId Id of the targeted group
150
+ * @returns AffectedRecords
151
+ * @throws {ResourceUnknownError}
152
+ */
153
+ remove(profileId: ObjectId, groupId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
154
+ /**
155
+ * Remove a field on a group enlistment object in a profile
156
+ *
157
+ * Permission | Scope | Effect
158
+ * - | - | -
159
+ * `UPDATE_PROFILES` | `staff enlistment` | Remove a field for this group
160
+ * `UPDATE_PROFILES` | `global` | Remove a field for any group
161
+ * @param profileId Id of the targeted profile
162
+ * @param groupId Id of the targeted group
163
+ * @param requestBody list of fields to remove
164
+ * @returns Group
165
+ * @throws {ResourceUnknownError}
166
+ */
167
+ removeFields(profileId: ObjectId, groupId: ObjectId, requestBody: {
168
+ fields: Array<string>;
169
+ }, options?: OptionsBase): Promise<Group>;
170
+ }
171
+ export interface ProfilesLogsService {
172
+ /**
173
+ * Create a profile log entry
174
+ *
175
+ * Permission | Scope | Effect
176
+ * - | - | -
177
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Create a log entry for any profile of this group
178
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Create a log entry for any profile of any group
179
+ * @param profileId Id of the targeted profile
180
+ * @param groupId Id of the targeted group
181
+ * @param requestBody ProfileComment
182
+ * @returns LogEntry
183
+ * @throws {ResourceUnknownError}
184
+ */
185
+ create(profileId: ObjectId, groupId: ObjectId, requestBody: ProfileComment, options?: OptionsBase): Promise<LogEntry>;
186
+ /**
187
+ * Retrieve all profile log entries
188
+ *
189
+ * Permission | Scope | Effect
190
+ * - | - | -
191
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
192
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
193
+ * @param profileId Id of the targeted profile
194
+ * @param groupId Id of the targeted group
195
+ * @param rql Add filters to the requested list.
196
+ * @returns PagedResult<LogEntry>
197
+ * @throws {ResourceUnknownError}
198
+ */
199
+ find(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): Promise<PagedResult<LogEntry>>;
200
+ /**
201
+ * Request a list of all profile log entries
202
+ *
203
+ * Do not pass in an rql with limit operator!
204
+ *
205
+ * Permission | Scope | Effect
206
+ * - | - | -
207
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
208
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
209
+ * @param profileId Id of the targeted profile
210
+ * @param groupId Id of the targeted group
211
+ * @param rql Add filters to the requested list.
212
+ * @returns LogEntry[]
213
+ */
214
+ findAll(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): Promise<LogEntry[]>;
215
+ /**
216
+ * Request a list of all profile log entries
217
+ *
218
+ * Permission | Scope | Effect
219
+ * - | - | -
220
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
221
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
222
+ * @param profileId Id of the targeted profile
223
+ * @param groupId Id of the targeted group
224
+ * @param rql Add filters to the requested list.
225
+ * @returns LogEntry[]
226
+ */
227
+ findAllIterator(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): FindAllIterator<LogEntry>;
228
+ /**
229
+ * Update a profile log entry
230
+ *
231
+ * Permission | Scope | Effect
232
+ * - | - | -
233
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Update a log entry, created by the current user, for any profile of this group
234
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Update a log entry, created by the current user, for any profile of any group
235
+ * @param profileId Id of the targeted profile
236
+ * @param groupId Id of the targeted group
237
+ * @param entryId Id of the targeted log entry
238
+ * @param requestBody ProfileComment
239
+ * @returns LogEntry
240
+ * @throws {ResourceUnknownError}
241
+ */
242
+ update(profileId: ObjectId, groupId: ObjectId, entryId: ObjectId, requestBody: ProfileComment, options?: OptionsBase): Promise<LogEntry>;
243
+ /**
244
+ * Delete a profile log entry
245
+ *
246
+ * Permission | Scope | Effect
247
+ * - | - | -
248
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Delete a log entry, created by the current user, for any profile of this group
249
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Delete a log entry, created by the current user, for any profile of any group
250
+ * @param profileId Id of the targeted profile
251
+ * @param groupId Id of the targeted group
252
+ * @param entryId Id of the targeted log entry
253
+ * @returns AffectedRecords
254
+ * @throws {ResourceUnknownError}
255
+ */
256
+ remove(profileId: ObjectId, groupId: ObjectId, entryId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
257
+ }
258
+ export interface ProfilesService {
259
+ /**
260
+ * Get a list of profiles
261
+ *
262
+ * Permission | Scope | Effect
263
+ * - | - | -
264
+ * none | | View your profile
265
+ * none | `staff enlistment` | View all the profiles of the group
266
+ * `VIEW_PATIENTS` | `global` | View all profiles
267
+ * @param rql an optional rql string
268
+ * @returns PagedResult<Profile>
269
+ */
270
+ find(options?: OptionsWithRql): Promise<PagedResult<Profile>>;
271
+ /**
272
+ * Request a list of all profiles
273
+ *
274
+ * Do not pass in an rql with limit operator!
275
+ *
276
+ * Permission | Scope | Effect
277
+ * - | - | -
278
+ * none | | View your profile
279
+ * none | `staff enlistment` | View all the profiles of the group
280
+ * `VIEW_PATIENTS` | `global` | View all profiles
281
+ * @param rql Add filters to the requested list.
282
+ * @returns Profile[]
283
+ */
284
+ findAll(options?: OptionsWithRql): Promise<Profile[]>;
285
+ /**
286
+ * Request a list of all profiles
287
+ *
288
+ * Permission | Scope | Effect
289
+ * - | - | -
290
+ * none | | View your profile
291
+ * none | `staff enlistment` | View all the profiles of the group
292
+ * `VIEW_PATIENTS` | `global` | View all profiles
293
+ * @param rql Add filters to the requested list.
294
+ * @returns Profile[]
295
+ */
296
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<Profile>;
297
+ /**
298
+ * Find By Id
299
+ * @param id the Id to search for
300
+ * @param rql an optional rql string
301
+ * @returns the first element found
302
+ */
303
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<Profile | undefined>;
304
+ /**
305
+ * Find First
306
+ * @param rql an optional rql string
307
+ * @returns the first element found
308
+ */
309
+ findFirst(options?: OptionsWithRql): Promise<Profile | undefined>;
310
+ /**
311
+ * Create a new profile
312
+ *
313
+ * Permission | Scope | Effect
314
+ * - | - | -
315
+ * none | | Create a profile for the current user
316
+ * `CREATE_PROFILES` | `global` | Create a profile for any user
317
+ * @param requestBody ProfileCreation
318
+ * @returns Profile
319
+ * @throws {ProfileAlreadyExistsError}
320
+ */
321
+ create(requestBody: ProfileCreation, options?: OptionsBase): Promise<Profile>;
322
+ /**
323
+ * Update an existing profile
324
+ *
325
+ * Permission | Scope | Effect
326
+ * - | - | -
327
+ * none | | Update your profile
328
+ * `UPDATE_PROFILES` | `staff enlistment` | Update the profile of any group member
329
+ * `UPDATE_PROFILES` | `global` | Update any profile
330
+ * @param rql Add filters to the requested list, **required**.
331
+ * @param requestBody The Profile data to update
332
+ * @returns AffectedRecords
333
+ */
334
+ update(rql: RQLString, requestBody: ProfileUpdate, options?: OptionsBase): Promise<AffectedRecords>;
335
+ /**
336
+ * Remove a given field from all profile records
337
+ *
338
+ * To make a selection of profiles, use RQL.
339
+ * Permission | Scope | Effect
340
+ * - | - | -
341
+ * none | | Remove a given field from your profile
342
+ * `UPDATE_PROFILES` | `staff enlistment` | Remove a given field from any group member
343
+ * `UPDATE_PROFILES` | `global` | Remove a given field from any profile
344
+ * @param rql Add filters to the requested list, **required**.
345
+ * @param requestBody the list of fields to remove
346
+ * @returns AffectedRecords
347
+ * @throws {RemoveFieldError}
348
+ */
349
+ removeFields(rql: RQLString, requestBody: {
350
+ fields: Array<string>;
351
+ }, options?: OptionsBase): Promise<AffectedRecords>;
352
+ /**
353
+ * Retrieve a list of all the defined comorbidities
354
+ *
355
+ * Permission | Scope | Effect
356
+ * - | - | -
357
+ * none | | Everyone can use this endpoint
358
+ * @returns PagedResult<Comorbidities>
359
+ */
360
+ getComorbidities(options?: OptionsBase): Promise<PagedResult<Comorbidities>>;
361
+ /**
362
+ * Retrieve a list of all the defined impediments
363
+ *
364
+ * Permission | Scope | Effect
365
+ * - | - | -
366
+ * none | | Everyone can use this endpoint
367
+ * @returns PagedResult<Impediments>
368
+ */
369
+ getImpediments(options?: OptionsBase): Promise<PagedResult<Impediments>>;
370
+ /**
371
+ * Perform a health check for profiles service
372
+ * @returns {boolean} success
373
+ */
374
+ health(): Promise<boolean>;
375
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../http/types';
2
+ import { HttpClient } from '../../http-client';
3
+ import { ApiService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ApiService;
5
+ export default _default;
@@ -0,0 +1,146 @@
1
+ import { OptionsBase } from '../../types';
2
+ export interface ApiService {
3
+ /**
4
+ * ## Execute a GET request towards an API function
5
+ *
6
+ * **Default Permissions:**
7
+ * - Any party may execute API functions with the `public` permission mode
8
+ * - Any authenticated user may execute API functions with the `allUsers` permission mode
9
+ *
10
+ * **Global Permissions:**
11
+ * - `EXECUTE_API_FUNCTION` - A user may execute all API functions
12
+ * - `EXECUTE_API_FUNCTION:{FUNCTION_NAME}` - A user may execute the API function specified by the FUNCTION_NAME
13
+ *
14
+ * @template T
15
+ * @param functionName {@link string} - The functionName property serves as the unique identifier amongst all Functions
16
+ * @param path {@link string} - The targeted route within the Function
17
+ * @param options {@link OptionsBase} - Additional options for the request.
18
+ * @returns {T} - A user defined type defining the response from the API function
19
+ */
20
+ get<T>(functionName: string, path: string, options: OptionsBase): Promise<T>;
21
+ /**
22
+ * ## Execute a POST request towards an API function
23
+ *
24
+ * **Default Permissions:**
25
+ * - Any party may execute API functions with the `public` permission mode
26
+ * - Any authenticated user may execute API functions with the `allUsers` permission mode
27
+ *
28
+ * **Global Permissions:**
29
+ * - `EXECUTE_API_FUNCTION` - A user may execute all API functions
30
+ * - `EXECUTE_API_FUNCTION:{FUNCTION_NAME}` - A user may execute the API function specified by the FUNCTION_NAME
31
+ *
32
+ * @param functionName {@link string} - The functionName property serves as the unique identifier amongst all Functions
33
+ * @param path {@link string} - The targeted route within the Function
34
+ * @param data {@link U} - The data to be sent to the Function, the type may be user defined
35
+ * @param options {@link OptionsBase} - Additional options for the request
36
+ * @returns {@link T} - The response return from the Function, the type may be user defined
37
+ */
38
+ post<T, U>(functionName: string, path: string, data: U, options: OptionsBase): Promise<T>;
39
+ /**
40
+ * ## Execute a PUT request towards an API function
41
+ *
42
+ * **Default Permissions:**
43
+ * - Any party may execute API functions with the `public` permission mode
44
+ * - Any authenticated user may execute API functions with the `allUsers` permission mode
45
+ *
46
+ * **Global Permissions:**
47
+ * - `EXECUTE_API_FUNCTION` - A user may execute all API functions
48
+ * - `EXECUTE_API_FUNCTION:{FUNCTION_NAME}` - A user may execute the API function specified by the FUNCTION_NAME
49
+ *
50
+ * @param functionName {@link string} - The functionName property serves as the unique identifier amongst all Functions
51
+ * @param path {@link string} - The targeted route within the Function
52
+ * @param data {@link U} - The data to be sent to the Function, the type may be user defined
53
+ * @param options {@link OptionsBase} - Additional options for the request
54
+ * @returns {@link T} - The response return from the Function, the type may be user defined
55
+ */
56
+ put<T, U>(functionName: string, path: string, data: U, options: OptionsBase): Promise<T>;
57
+ /**
58
+ * ## Execute a DELETE request towards an API function
59
+ *
60
+ * **Default Permissions:**
61
+ * - Any party may execute API functions with the `public` permission mode
62
+ * - Any authenticated user may execute API functions with the `allUsers` permission mode
63
+ *
64
+ * **Global Permissions:**
65
+ * - `EXECUTE_API_FUNCTION` - A user may execute all API functions
66
+ * - `EXECUTE_API_FUNCTION:{FUNCTION_NAME}` - A user may execute the API function specified by the FUNCTION_NAME
67
+ *
68
+ * @param functionName {@link string} - The functionName property serves as the unique identifier amongst all Functions
69
+ * @param path {@link string} - The targeted route within the Function
70
+ * @param options {@link OptionsBase} - Additional options for the request
71
+ * @returns {@link T} - The response return from the Function, the type may be user defined
72
+ */
73
+ delete<T>(functionName: string, path: string, options: OptionsBase): Promise<T>;
74
+ /**
75
+ * ## Execute a PATCH request towards an API function
76
+ *
77
+ * **Default Permissions:**
78
+ * - Any party may execute API functions with the `public` permission mode
79
+ * - Any authenticated user may execute API functions with the `allUsers` permission mode
80
+ *
81
+ * **Global Permissions:**
82
+ * - `EXECUTE_API_FUNCTION` - A user may execute all API functions
83
+ * - `EXECUTE_API_FUNCTION:{FUNCTION_NAME}` - A user may execute the API function specified by the FUNCTION_NAME
84
+ *
85
+ * @param functionName {@link string} - The functionName property serves as the unique identifier amongst all Functions
86
+ * @param path {@link string} - The targeted route within the Function
87
+ * @param data {@link U} - The data to be sent to the Function, the type may be user defined
88
+ * @param options {@link OptionsBase} - Additional options for the request
89
+ * @returns {@link T} - The response return from the Function, the type may be user defined
90
+ */
91
+ patch<T, U>(functionName: string, path: string, data: U, options: OptionsBase): Promise<T>;
92
+ }
93
+ export interface ApiFunctionRequestObject {
94
+ /** The payload formation version of the AWS API Gateway. */
95
+ version: '2.0';
96
+ /** The path portion of the URL that comes after the Function name. */
97
+ rawPath: string;
98
+ /** The unprocessed query string of the incoming HTTP request including the starting question mark. */
99
+ rawQueryString: string;
100
+ /**
101
+ * The headers of the incoming HTTP request.
102
+ * It is structured as an object, where each key-value pair corresponds to a header name and its value.
103
+ * */
104
+ headers: Record<string, string>;
105
+ requestContext: {
106
+ http: {
107
+ /** The HTTP method used to target the API function. */
108
+ method: ApiFunctionRequestMethod;
109
+ };
110
+ };
111
+ /** The body of the incoming HTTP request as string. It can be Base64-encoded based on the isBase64Encoded property. */
112
+ body: string;
113
+ /** The isBase64Encoded property indicates if the body property of the request object has been Base64-encoded. */
114
+ isBase64Encoded: boolean;
115
+ }
116
+ export interface ApiFunctionResponseObject {
117
+ /**
118
+ * The statusCode field resolves to the status code in the HTTP response.
119
+ * The value can be in the 200 - 499 range.
120
+ * */
121
+ statusCode: number;
122
+ /**
123
+ * The headers field resolves to the headers in the HTTP response.
124
+ * It is structured as an object, where each key-value pair corresponds to a header name and its value.
125
+ * */
126
+ headers?: Record<string, string>;
127
+ /**
128
+ * The body field resolves to the body in the HTTP response.
129
+ * In order to include binary data within a body, such as images or audio files, it is necessary to convert it into a Base64 string and assign it to the body field of the response object. Additionally, the isBase64Encoded field must be set to true.
130
+ * If the response body does not contain binary data, you can directly include the data in its original format.
131
+ */
132
+ body?: any;
133
+ /**
134
+ * The isBase64Encoded field must be set to true if the body field of the response object is a Base64 encoded string representing the raw response body.
135
+ * */
136
+ isBase64Encoded?: boolean;
137
+ }
138
+ export declare enum ApiFunctionRequestMethod {
139
+ 'GET' = "GET",
140
+ 'POST' = "POST",
141
+ 'PUT' = "PUT",
142
+ 'DELETE' = "DELETE",
143
+ 'PATCH' = "PATCH",
144
+ 'OPTIONS' = "OPTIONS",
145
+ 'HEAD' = "HEAD"
146
+ }
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../http/types';
2
+ import { HttpClient } from '../../http-client';
3
+ import { ApiRequestService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ApiRequestService;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { HttpInstance } from '../../../../http/types';
2
+ import { HttpClient } from '../../../http-client';
3
+ import { ApiRequestLogsService } from './types';
4
+ declare const _default: (client: HttpClient, httpAuth: HttpInstance) => ApiRequestLogsService;
5
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { ObjectId, OptionsWithRql } from '../../../types';
2
+ import { LogLine } from '../../logs/types';
3
+ export interface ApiRequestLogsService {
4
+ /**
5
+ * ## Retrieve a list of logs for an API Request
6
+ *
7
+ * **Global Permissions:**
8
+ * - `VIEW_API_FUNCTION_REQUEST_LOGS` - **Required** for this endpoint
9
+ *
10
+ * @param apiRequestId {@link string} The id of the targeted API Request
11
+ * @param options {@link OptionsWithRql} - Additional options for the request
12
+ * @returns An array of API Request logs {@link LogLine LineLog[]}
13
+ */
14
+ find(apiRequestId: ObjectId, options?: OptionsWithRql): Promise<LogLine[]>;
15
+ /**
16
+ * ## Retrieve the first queried API Request log
17
+ *
18
+ * **Global Permissions:**
19
+ * - `VIEW_API_FUNCTION_REQUEST_LOGS` - **Required** for this endpoint
20
+ *
21
+ * @param apiRequestId {@link string} The id of the targeted API Request
22
+ * @param options {@link OptionsWithRql} - Additional options for the request
23
+ * @returns The first element of the queried API Request logs {@link LogLine} */
24
+ findFirst(apiRequestId: ObjectId, options?: OptionsWithRql): Promise<LogLine | undefined>;
25
+ }
@@ -0,0 +1,83 @@
1
+ import { FindAllIterator } from '../../helpers';
2
+ import { ObjectId, OptionsWithRql, PagedResultWithPager } from '../../types';
3
+ import { ApiFunctionRequestMethod } from '../api/types';
4
+ import { ApiRequestLogsService } from './logs/types';
5
+ export interface ApiRequestService {
6
+ /**
7
+ * ## Retrieve a paged list of API Requests
8
+ *
9
+ * **Global Permissions:**
10
+ * - `VIEW_API_FUNCTION_REQUESTS` - Allows a user to view API Requests
11
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
12
+ * @returns A paged list of API Requests {@link PagedResultWithPager PagedResultWithPager<ApiRequest>}
13
+ */
14
+ find(options?: OptionsWithRql): Promise<PagedResultWithPager<ApiRequest>>;
15
+ /**
16
+ * ## Retrieve a list of all API Requests
17
+ *
18
+ * **Global Permissions:**
19
+ * - `VIEW_API_FUNCTION_REQUESTS` - Allows a user to view API Requests
20
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
21
+ * @returns An array of API Requests {@link ApiRequest ApiRequest[]}
22
+ * @throws {@link Error} Do not pass in limit operator with findAll
23
+ */
24
+ findAll(options?: OptionsWithRql): Promise<ApiRequest[]>;
25
+ /**
26
+ * ## Retrieve a paged list of API Requests
27
+ *
28
+ * **Global Permissions:**
29
+ * - `VIEW_API_FUNCTION_REQUESTS` - Allows a user to view API Requests
30
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
31
+ * @returns An iterator for the queried API Requests {@link FindAllIterator FindAllIterator<ApiRequest>}
32
+ */
33
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<ApiRequest>;
34
+ /**
35
+ * ## Retrieve the first queried API Request
36
+ *
37
+ * **Global Permissions:**
38
+ * - `VIEW_API_FUNCTION_REQUESTS` - Allows a user to view API Requests
39
+ * @param options {@link OptionsWithRql} - Add filters to the requested list
40
+ * @returns The first element of the queried API Requests {@link ApiRequest}
41
+ */
42
+ findFirst(options?: OptionsWithRql): Promise<ApiRequest | undefined>;
43
+ logs: ApiRequestLogsService;
44
+ }
45
+ export interface ApiRequest {
46
+ /** The Extra Horizon document id */
47
+ id: ObjectId;
48
+ /** The unique identifier amongst all Functions */
49
+ functionName: string;
50
+ /** The HTTP method used to target the API function. */
51
+ method: ApiFunctionRequestMethod;
52
+ /** The path portion of the URL that comes after the Function name. */
53
+ path: string;
54
+ /** The id of the user making the request */
55
+ userId?: ObjectId;
56
+ /** The application id of the oAuth application */
57
+ applicationId?: ObjectId;
58
+ /** The status code of the API Function's response or of a thrown error during its lifecycle */
59
+ statusCode: number;
60
+ /** The time the API Function was executed */
61
+ timestamp: Date;
62
+ /** The duration of the API Function execution in seconds */
63
+ duration: number;
64
+ /** An error thrown during the lifecycle of the API Function's execution */
65
+ error?: ApiRequestError;
66
+ }
67
+ export interface ApiRequestError {
68
+ /** The name of the caught error */
69
+ name: string;
70
+ /** The message of the caught error */
71
+ message: string;
72
+ /** The error type defines where the error occurred during the API Function lifecycle and can have one of the following values:
73
+ * - `invocation` - errors that occur before invocation of the API Function
74
+ * - `runtime` - errors that occur during the execution of the API Function
75
+ * - `response` - errors that occur during the response validation after the API Function has been executed
76
+ */
77
+ type: ApiRequestErrorType;
78
+ }
79
+ export declare enum ApiRequestErrorType {
80
+ INVOCATION = "invocation",
81
+ RUNTIME = "runtime",
82
+ RESPONSE = "response"
83
+ }