@extrahorizon/javascript-sdk 8.2.0-test

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 (153) hide show
  1. package/CHANGELOG.md +1161 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -0
  4. package/build/index.cjs.js +1 -0
  5. package/build/index.mjs +1 -0
  6. package/build/types/btoa.d.ts +6 -0
  7. package/build/types/client.d.ts +136 -0
  8. package/build/types/constants.d.ts +15 -0
  9. package/build/types/errorHandler.d.ts +2 -0
  10. package/build/types/errors.d.ts +332 -0
  11. package/build/types/http/client.d.ts +2 -0
  12. package/build/types/http/index.d.ts +4 -0
  13. package/build/types/http/interceptors.d.ts +9 -0
  14. package/build/types/http/oAuth1Signature.d.ts +14 -0
  15. package/build/types/http/oauth1.d.ts +3 -0
  16. package/build/types/http/oauth2.d.ts +3 -0
  17. package/build/types/http/proxy.d.ts +3 -0
  18. package/build/types/http/types.d.ts +331 -0
  19. package/build/types/http/utils.d.ts +21 -0
  20. package/build/types/index.d.ts +9 -0
  21. package/build/types/mock.d.ts +43 -0
  22. package/build/types/mockType.d.ts +1511 -0
  23. package/build/types/parseStoredCredentials.d.ts +11 -0
  24. package/build/types/rql/index.d.ts +16 -0
  25. package/build/types/rql/parser.d.ts +1 -0
  26. package/build/types/rql/types.d.ts +168 -0
  27. package/build/types/services/auth/applications/index.d.ts +5 -0
  28. package/build/types/services/auth/applications/types.d.ts +190 -0
  29. package/build/types/services/auth/index.d.ts +3 -0
  30. package/build/types/services/auth/oauth1/index.d.ts +5 -0
  31. package/build/types/services/auth/oauth1/types.d.ts +63 -0
  32. package/build/types/services/auth/oauth2/index.d.ts +5 -0
  33. package/build/types/services/auth/oauth2/types.d.ts +52 -0
  34. package/build/types/services/auth/oidc/index.d.ts +5 -0
  35. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -0
  36. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -0
  37. package/build/types/services/auth/oidc/providers/index.d.ts +5 -0
  38. package/build/types/services/auth/oidc/providers/types.d.ts +144 -0
  39. package/build/types/services/auth/oidc/types.d.ts +40 -0
  40. package/build/types/services/auth/types.d.ts +39 -0
  41. package/build/types/services/auth/users/index.d.ts +5 -0
  42. package/build/types/services/auth/users/types.d.ts +121 -0
  43. package/build/types/services/configurations/general.d.ts +5 -0
  44. package/build/types/services/configurations/groups.d.ts +5 -0
  45. package/build/types/services/configurations/index.d.ts +10 -0
  46. package/build/types/services/configurations/patients.d.ts +5 -0
  47. package/build/types/services/configurations/staff.d.ts +5 -0
  48. package/build/types/services/configurations/types.d.ts +222 -0
  49. package/build/types/services/configurations/users.d.ts +5 -0
  50. package/build/types/services/data/comments.d.ts +5 -0
  51. package/build/types/services/data/documents.d.ts +5 -0
  52. package/build/types/services/data/index.d.ts +13 -0
  53. package/build/types/services/data/indexes.d.ts +5 -0
  54. package/build/types/services/data/infrastructure.d.ts +10 -0
  55. package/build/types/services/data/json-schema.d.ts +121 -0
  56. package/build/types/services/data/properties.d.ts +5 -0
  57. package/build/types/services/data/schemas.d.ts +5 -0
  58. package/build/types/services/data/statuses.d.ts +5 -0
  59. package/build/types/services/data/transitions.d.ts +5 -0
  60. package/build/types/services/data/types.d.ts +899 -0
  61. package/build/types/services/dispatchers/actions/index.d.ts +5 -0
  62. package/build/types/services/dispatchers/actions/types.d.ts +78 -0
  63. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -0
  64. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -0
  65. package/build/types/services/dispatchers/index.d.ts +7 -0
  66. package/build/types/services/dispatchers/types.d.ts +2 -0
  67. package/build/types/services/events/events.d.ts +5 -0
  68. package/build/types/services/events/health.d.ts +9 -0
  69. package/build/types/services/events/index.d.ts +6 -0
  70. package/build/types/services/events/subscriptions.d.ts +5 -0
  71. package/build/types/services/events/types.d.ts +90 -0
  72. package/build/types/services/files/files.d.ts +5 -0
  73. package/build/types/services/files/formHelpers.d.ts +3 -0
  74. package/build/types/services/files/index.d.ts +6 -0
  75. package/build/types/services/files/settings/index.d.ts +5 -0
  76. package/build/types/services/files/settings/types.d.ts +38 -0
  77. package/build/types/services/files/tokens.d.ts +5 -0
  78. package/build/types/services/files/types.d.ts +185 -0
  79. package/build/types/services/helpers.d.ts +7 -0
  80. package/build/types/services/http-client.d.ts +22 -0
  81. package/build/types/services/index.d.ts +15 -0
  82. package/build/types/services/localizations/countries.d.ts +5 -0
  83. package/build/types/services/localizations/health.d.ts +9 -0
  84. package/build/types/services/localizations/index.d.ts +4 -0
  85. package/build/types/services/localizations/languages.d.ts +5 -0
  86. package/build/types/services/localizations/localizations.d.ts +5 -0
  87. package/build/types/services/localizations/types.d.ts +145 -0
  88. package/build/types/services/logs/access/index.d.ts +5 -0
  89. package/build/types/services/logs/access/types.d.ts +41 -0
  90. package/build/types/services/logs/index.d.ts +3 -0
  91. package/build/types/services/logs/types.d.ts +4 -0
  92. package/build/types/services/mails/index.d.ts +3 -0
  93. package/build/types/services/mails/mails.d.ts +5 -0
  94. package/build/types/services/mails/types.d.ts +141 -0
  95. package/build/types/services/notifications/health.d.ts +9 -0
  96. package/build/types/services/notifications/index.d.ts +7 -0
  97. package/build/types/services/notifications/notifications.d.ts +5 -0
  98. package/build/types/services/notifications/settings.d.ts +5 -0
  99. package/build/types/services/notifications/types.d.ts +222 -0
  100. package/build/types/services/payments/appStore.d.ts +5 -0
  101. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -0
  102. package/build/types/services/payments/health.d.ts +9 -0
  103. package/build/types/services/payments/index.d.ts +15 -0
  104. package/build/types/services/payments/orders.d.ts +5 -0
  105. package/build/types/services/payments/playStore.d.ts +5 -0
  106. package/build/types/services/payments/playStoreHistory.d.ts +5 -0
  107. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -0
  108. package/build/types/services/payments/products.d.ts +5 -0
  109. package/build/types/services/payments/stripe.d.ts +5 -0
  110. package/build/types/services/payments/subscriptions.d.ts +5 -0
  111. package/build/types/services/payments/types.d.ts +1189 -0
  112. package/build/types/services/profiles/groups.d.ts +5 -0
  113. package/build/types/services/profiles/health.d.ts +9 -0
  114. package/build/types/services/profiles/index.d.ts +9 -0
  115. package/build/types/services/profiles/logs.d.ts +5 -0
  116. package/build/types/services/profiles/profiles.d.ts +5 -0
  117. package/build/types/services/profiles/types.d.ts +369 -0
  118. package/build/types/services/tasks/api/index.d.ts +5 -0
  119. package/build/types/services/tasks/api/types.d.ts +146 -0
  120. package/build/types/services/tasks/apiRequests/index.d.ts +5 -0
  121. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -0
  122. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -0
  123. package/build/types/services/tasks/apiRequests/types.d.ts +83 -0
  124. package/build/types/services/tasks/functions/index.d.ts +5 -0
  125. package/build/types/services/tasks/functions/types.d.ts +27 -0
  126. package/build/types/services/tasks/index.d.ts +15 -0
  127. package/build/types/services/tasks/logs/index.d.ts +5 -0
  128. package/build/types/services/tasks/logs/types.d.ts +28 -0
  129. package/build/types/services/tasks/schedules/index.d.ts +5 -0
  130. package/build/types/services/tasks/schedules/types.d.ts +88 -0
  131. package/build/types/services/tasks/tasks.d.ts +5 -0
  132. package/build/types/services/tasks/types.d.ts +107 -0
  133. package/build/types/services/templates/index.d.ts +3 -0
  134. package/build/types/services/templates/templates.d.ts +5 -0
  135. package/build/types/services/templates/types.d.ts +202 -0
  136. package/build/types/services/types.d.ts +77 -0
  137. package/build/types/services/users/activationRequests/index.d.ts +4 -0
  138. package/build/types/services/users/activationRequests/types.d.ts +70 -0
  139. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -0
  140. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -0
  141. package/build/types/services/users/globalRoles.d.ts +5 -0
  142. package/build/types/services/users/groupRoles.d.ts +5 -0
  143. package/build/types/services/users/health.d.ts +9 -0
  144. package/build/types/services/users/index.d.ts +16 -0
  145. package/build/types/services/users/settings/index.d.ts +4 -0
  146. package/build/types/services/users/settings/types.d.ts +47 -0
  147. package/build/types/services/users/types.d.ts +1055 -0
  148. package/build/types/services/users/users.d.ts +5 -0
  149. package/build/types/sha1.d.ts +11 -0
  150. package/build/types/types.d.ts +102 -0
  151. package/build/types/utils.d.ts +4 -0
  152. package/build/types/version.d.ts +1 -0
  153. package/package.json +57 -0
@@ -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,9 @@
1
+ import type { HttpInstance } from '../../types';
2
+ declare const _default: (client: any, httpAuth: HttpInstance) => {
3
+ /**
4
+ * Perform a health check for profiles service
5
+ * @returns {boolean} success
6
+ */
7
+ health(): Promise<boolean>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { HttpInstance } from '../../types';
2
+ import groups from './groups';
3
+ import health from './health';
4
+ import logs from './logs';
5
+ import { ProfilesGroupsService, ProfilesLogsService, ProfilesService } from './types';
6
+ export declare const profilesService: (httpWithAuth: HttpInstance) => ReturnType<typeof health> & ProfilesService & {
7
+ groups: ProfilesGroupsService;
8
+ logs: ProfilesLogsService;
9
+ };
@@ -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,369 @@
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 enum ProfileActivity {
46
+ NOT_ACTIVE = "NOT_ACTIVE",
47
+ SLIGHTLY_ACTIVE = "SLIGHTLY_ACTIVE",
48
+ MODERATELY_ACTIVE = "MODERATELY_ACTIVE",
49
+ ACTIVE = "ACTIVE",
50
+ VERY_ACTIVE = "VERY_ACTIVE"
51
+ }
52
+ export declare enum Comorbidities {
53
+ HEART_FAILURE = "HEART_FAILURE",
54
+ DIABETES = "DIABETES",
55
+ COPD = "COPD",
56
+ HYPERTENSION = "HYPERTENSION",
57
+ VASCULAR_DISEASE = "VASCULAR_DISEASE",
58
+ HISTORY_OF_TIA_STROKE = "HISTORY_OF_TIA_STROKE"
59
+ }
60
+ export declare enum Impediments {
61
+ TREMOR = "TREMOR",
62
+ PERNIOSIS = "PERNIOSIS",
63
+ CALLUS = "CALLUS"
64
+ }
65
+ export interface Medication {
66
+ name: string;
67
+ dosis: {
68
+ number?: number;
69
+ unit?: MedicationUnit;
70
+ };
71
+ medicationFrequency?: MedicationFrequency;
72
+ count: number;
73
+ }
74
+ export declare enum MedicationUnit {
75
+ MG = "mg",
76
+ ML = "ml",
77
+ PILL = "pill"
78
+ }
79
+ export declare enum MedicationFrequency {
80
+ AS_NEEDED = "AS_NEEDED",
81
+ EVERY_DAY = "EVERY_DAY",
82
+ EVERY_WEEK = "EVERY_WEEK",
83
+ EVERY_MONTH = "EVERY_MONTH",
84
+ BIRTH_CONTROL = "BIRTH_CONTROL"
85
+ }
86
+ export interface Group {
87
+ groupId: ObjectId;
88
+ reason?: string;
89
+ /**
90
+ * 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.
91
+ *
92
+ */
93
+ patientId?: string;
94
+ customFields?: Record<string, string>;
95
+ }
96
+ export declare type GroupCreation = Group;
97
+ export interface LogEntry {
98
+ id?: ObjectId;
99
+ profileId?: ObjectId;
100
+ groupId?: ObjectId;
101
+ userId?: ObjectId;
102
+ text?: string;
103
+ creationTimestamp?: Date;
104
+ updateTimestamp?: Date;
105
+ }
106
+ export interface ProfileComment {
107
+ text: string;
108
+ }
109
+ export interface ProfilesGroupsService {
110
+ /**
111
+ * Add a group enlistment to a profile
112
+ *
113
+ * Permission | Scope | Effect
114
+ * - | - | -
115
+ * none | | Add a group enlistment for your profile only
116
+ * `ADD_PATIENT` | `staff enlistment` | Add a group enlistment for any profile of this group
117
+ * `ADD_PATIENT` & `ACTIVATE_PRESCRIPTIONS` | `global` | Add a group enlistment for any profile for any group
118
+ * @param profileId Id of the targeted profile
119
+ * @param requestBody Group data
120
+ * @returns Group
121
+ * @throws {ResourceAlreadyExistsError}
122
+ * @throws {ResourceUnknownError}
123
+ */
124
+ create(profileId: ObjectId, requestBody: GroupCreation, options?: OptionsBase): Promise<Group>;
125
+ /**
126
+ * Update a group enlistment on a profile
127
+ *
128
+ * Permission | Scope | Effect
129
+ * - | - | -
130
+ * `UPDATE_PROFILES` | `staff enlistment` | Update a group enlistment for any profile for this group
131
+ * `UPDATE_PROFILES` | `global` | Update a group enlistment for any profile for any group
132
+ * @param profileId Id of the targeted profile
133
+ * @param groupId Id of the targeted group
134
+ * @param requestBody Group data to update
135
+ * @returns Group
136
+ * @throws {ResourceUnknownError}
137
+ */
138
+ update(profileId: ObjectId, groupId: ObjectId, requestBody: Omit<Group, 'groupId'>, options?: OptionsBase): Promise<Group>;
139
+ /**
140
+ * Delete a group from a profile
141
+ *
142
+ * Permission | Scope | Effect
143
+ * - | - | -
144
+ * none | | Delete a group from your profile only
145
+ * `UPDATE_PROFILES` | `staff enlistment` | Delete a group from any profile in this group
146
+ * `UPDATE_PROFILES` | `global` | Delete a group from any profile in any group
147
+ * @param profileId Id of the targeted profile
148
+ * @param groupId Id of the targeted group
149
+ * @returns AffectedRecords
150
+ * @throws {ResourceUnknownError}
151
+ */
152
+ remove(profileId: ObjectId, groupId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
153
+ /**
154
+ * Remove a field on a group enlistment object in a profile
155
+ *
156
+ * Permission | Scope | Effect
157
+ * - | - | -
158
+ * `UPDATE_PROFILES` | `staff enlistment` | Remove a field for this group
159
+ * `UPDATE_PROFILES` | `global` | Remove a field for any group
160
+ * @param profileId Id of the targeted profile
161
+ * @param groupId Id of the targeted group
162
+ * @param requestBody list of fields to remove
163
+ * @returns Group
164
+ * @throws {ResourceUnknownError}
165
+ */
166
+ removeFields(profileId: ObjectId, groupId: ObjectId, requestBody: {
167
+ fields: Array<string>;
168
+ }, options?: OptionsBase): Promise<Group>;
169
+ }
170
+ export interface ProfilesLogsService {
171
+ /**
172
+ * Create a profile log entry
173
+ *
174
+ * Permission | Scope | Effect
175
+ * - | - | -
176
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Create a log entry for any profile of this group
177
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Create a log entry for any profile of any group
178
+ * @param profileId Id of the targeted profile
179
+ * @param groupId Id of the targeted group
180
+ * @param requestBody ProfileComment
181
+ * @returns LogEntry
182
+ * @throws {ResourceUnknownError}
183
+ */
184
+ create(profileId: ObjectId, groupId: ObjectId, requestBody: ProfileComment, options?: OptionsBase): Promise<LogEntry>;
185
+ /**
186
+ * Retrieve all profile log entries
187
+ *
188
+ * Permission | Scope | Effect
189
+ * - | - | -
190
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
191
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
192
+ * @param profileId Id of the targeted profile
193
+ * @param groupId Id of the targeted group
194
+ * @param rql Add filters to the requested list.
195
+ * @returns PagedResult<LogEntry>
196
+ * @throws {ResourceUnknownError}
197
+ */
198
+ find(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): Promise<PagedResult<LogEntry>>;
199
+ /**
200
+ * Request a list of all profile log entries
201
+ *
202
+ * Do not pass in an rql with limit operator!
203
+ *
204
+ * Permission | Scope | Effect
205
+ * - | - | -
206
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
207
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
208
+ * @param profileId Id of the targeted profile
209
+ * @param groupId Id of the targeted group
210
+ * @param rql Add filters to the requested list.
211
+ * @returns LogEntry[]
212
+ */
213
+ findAll(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): Promise<LogEntry[]>;
214
+ /**
215
+ * Request a list of all profile log entries
216
+ *
217
+ * Permission | Scope | Effect
218
+ * - | - | -
219
+ * `VIEW_PROFILE_LOG_ENTRIES` | `staff enlistment` | Retrieve a list of log entries for any profile of this group
220
+ * `VIEW_PROFILE_LOG_ENTRIES` | `global` | Retrieve a list of log entries for any profile of any group
221
+ * @param profileId Id of the targeted profile
222
+ * @param groupId Id of the targeted group
223
+ * @param rql Add filters to the requested list.
224
+ * @returns LogEntry[]
225
+ */
226
+ findAllIterator(profileId: ObjectId, groupId: ObjectId, options?: OptionsWithRql): FindAllIterator<LogEntry>;
227
+ /**
228
+ * Update a profile log entry
229
+ *
230
+ * Permission | Scope | Effect
231
+ * - | - | -
232
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Update a log entry, created by the current user, for any profile of this group
233
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Update a log entry, created by the current user, for any profile of any group
234
+ * @param profileId Id of the targeted profile
235
+ * @param groupId Id of the targeted group
236
+ * @param entryId Id of the targeted log entry
237
+ * @param requestBody ProfileComment
238
+ * @returns LogEntry
239
+ * @throws {ResourceUnknownError}
240
+ */
241
+ update(profileId: ObjectId, groupId: ObjectId, entryId: ObjectId, requestBody: ProfileComment, options?: OptionsBase): Promise<LogEntry>;
242
+ /**
243
+ * Delete a profile log entry
244
+ *
245
+ * Permission | Scope | Effect
246
+ * - | - | -
247
+ * `CREATE_PROFILE_LOG_ENTRIES` | `staff enlistment` | Delete a log entry, created by the current user, for any profile of this group
248
+ * `CREATE_PROFILE_LOG_ENTRIES` | `global` | Delete a log entry, created by the current user, for any profile of any group
249
+ * @param profileId Id of the targeted profile
250
+ * @param groupId Id of the targeted group
251
+ * @param entryId Id of the targeted log entry
252
+ * @returns AffectedRecords
253
+ * @throws {ResourceUnknownError}
254
+ */
255
+ remove(profileId: ObjectId, groupId: ObjectId, entryId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
256
+ }
257
+ export interface ProfilesService {
258
+ /**
259
+ * Get a list of profiles
260
+ *
261
+ * Permission | Scope | Effect
262
+ * - | - | -
263
+ * none | | View your profile
264
+ * none | `staff enlistment` | View all the profiles of the group
265
+ * `VIEW_PATIENTS` | `global` | View all profiles
266
+ * @param rql an optional rql string
267
+ * @returns PagedResult<Profile>
268
+ */
269
+ find(options?: OptionsWithRql): Promise<PagedResult<Profile>>;
270
+ /**
271
+ * Request a list of all profiles
272
+ *
273
+ * Do not pass in an rql with limit operator!
274
+ *
275
+ * Permission | Scope | Effect
276
+ * - | - | -
277
+ * none | | View your profile
278
+ * none | `staff enlistment` | View all the profiles of the group
279
+ * `VIEW_PATIENTS` | `global` | View all profiles
280
+ * @param rql Add filters to the requested list.
281
+ * @returns Profile[]
282
+ */
283
+ findAll(options?: OptionsWithRql): Promise<Profile[]>;
284
+ /**
285
+ * Request a list of all profiles
286
+ *
287
+ * Permission | Scope | Effect
288
+ * - | - | -
289
+ * none | | View your profile
290
+ * none | `staff enlistment` | View all the profiles of the group
291
+ * `VIEW_PATIENTS` | `global` | View all profiles
292
+ * @param rql Add filters to the requested list.
293
+ * @returns Profile[]
294
+ */
295
+ findAllIterator(options?: OptionsWithRql): FindAllIterator<Profile>;
296
+ /**
297
+ * Find By Id
298
+ * @param id the Id to search for
299
+ * @param rql an optional rql string
300
+ * @returns the first element found
301
+ */
302
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<Profile>;
303
+ /**
304
+ * Find First
305
+ * @param rql an optional rql string
306
+ * @returns the first element found
307
+ */
308
+ findFirst(options?: OptionsWithRql): Promise<Profile>;
309
+ /**
310
+ * Create a new profile
311
+ *
312
+ * Permission | Scope | Effect
313
+ * - | - | -
314
+ * none | | Create a profile for the current user
315
+ * `CREATE_PROFILES` | `global` | Create a profile for any user
316
+ * @param requestBody ProfileCreation
317
+ * @returns Profile
318
+ * @throws {ProfileAlreadyExistsError}
319
+ */
320
+ create(requestBody: ProfileCreation, options?: OptionsBase): Promise<Profile>;
321
+ /**
322
+ * Update an existing profile
323
+ *
324
+ * Permission | Scope | Effect
325
+ * - | - | -
326
+ * none | | Update your profile
327
+ * `UPDATE_PROFILES` | `staff enlistment` | Update the profile of any group member
328
+ * `UPDATE_PROFILES` | `global` | Update any profile
329
+ * @param rql Add filters to the requested list, **required**.
330
+ * @param requestBody The Profile data to update
331
+ * @returns AffectedRecords
332
+ */
333
+ update(rql: RQLString, requestBody: Profile, options?: OptionsBase): Promise<AffectedRecords>;
334
+ /**
335
+ * Remove a given field from all profile records
336
+ *
337
+ * To make a selection of profiles, use RQL.
338
+ * Permission | Scope | Effect
339
+ * - | - | -
340
+ * none | | Remove a given field from your profile
341
+ * `UPDATE_PROFILES` | `staff enlistment` | Remove a given field from any group member
342
+ * `UPDATE_PROFILES` | `global` | Remove a given field from any profile
343
+ * @param rql Add filters to the requested list, **required**.
344
+ * @param requestBody the list of fields to remove
345
+ * @returns AffectedRecords
346
+ * @throws {RemoveFieldError}
347
+ */
348
+ removeFields(rql: RQLString, requestBody: {
349
+ fields: Array<string>;
350
+ }, options?: OptionsBase): Promise<AffectedRecords>;
351
+ /**
352
+ * Retrieve a list of all the defined comorbidities
353
+ *
354
+ * Permission | Scope | Effect
355
+ * - | - | -
356
+ * none | | Everyone can use this endpoint
357
+ * @returns PagedResult<Comorbidities>
358
+ */
359
+ getComorbidities(options?: OptionsBase): Promise<PagedResult<Comorbidities>>;
360
+ /**
361
+ * Retrieve a list of all the defined impediments
362
+ *
363
+ * Permission | Scope | Effect
364
+ * - | - | -
365
+ * none | | Everyone can use this endpoint
366
+ * @returns PagedResult<Impediments>
367
+ */
368
+ getImpediments(options?: OptionsBase): Promise<PagedResult<Impediments>>;
369
+ }
@@ -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>;
25
+ }