@persei/perseed-api 4.34.2

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 (52) hide show
  1. package/README.md +260 -0
  2. package/dist/perseed-api.mjs +177 -0
  3. package/dist/perseed-api.umd.js +1 -0
  4. package/dist/schemas/authentication_security/index.d.ts +1 -0
  5. package/dist/schemas/authentication_security/types.d.ts +29 -0
  6. package/dist/schemas/dashboard/create_dashboard_payload.schema.json +487 -0
  7. package/dist/schemas/dashboard/data_loaders/Outcomes.d.ts +6 -0
  8. package/dist/schemas/dashboard/data_loaders/index.d.ts +1 -0
  9. package/dist/schemas/dashboard/i18n.d.ts +6 -0
  10. package/dist/schemas/dashboard/index.d.ts +10 -0
  11. package/dist/schemas/dashboard/types.d.ts +51 -0
  12. package/dist/schemas/dashboard/update_dashboard_payload.schema.json +486 -0
  13. package/dist/schemas/dashboard/widgets/PatientListProps.d.ts +9 -0
  14. package/dist/schemas/dashboard/widgets/SectionCardProps.d.ts +9 -0
  15. package/dist/schemas/dashboard/widgets/ValueCardProps.d.ts +13 -0
  16. package/dist/schemas/dashboard/widgets/index.d.ts +3 -0
  17. package/dist/schemas/forms/create.schema.json +12 -0
  18. package/dist/schemas/forms/update.schema.json +22 -0
  19. package/dist/schemas/hospital/create.schema.json +23 -0
  20. package/dist/schemas/index.d.ts +15 -0
  21. package/dist/schemas/mfa/mfa-login-data.schema.json +33 -0
  22. package/dist/schemas/mobile/searchnotificationstatus.schema.json +9 -0
  23. package/dist/schemas/notification_configuration/create_trigger_payload.schema.json +170 -0
  24. package/dist/schemas/notification_configuration/index.d.ts +2 -0
  25. package/dist/schemas/notification_configuration/introspectionShema.d.ts +3 -0
  26. package/dist/schemas/notification_configuration/types.d.ts +91 -0
  27. package/dist/schemas/notification_configuration/update_trigger_payload.schema.json +169 -0
  28. package/dist/schemas/outcomes/index.d.ts +1 -0
  29. package/dist/schemas/outcomes/types.d.ts +35 -0
  30. package/dist/schemas/patient/createFullPatient.schema.json +17 -0
  31. package/dist/schemas/patient/createPatient.schema.json +12 -0
  32. package/dist/schemas/project/createCategory.schema.json +12 -0
  33. package/dist/schemas/project/export.schema.json +25 -0
  34. package/dist/schemas/project/uploadDocument.schema.json +23 -0
  35. package/dist/schemas/query/patch.schema.json +22 -0
  36. package/dist/schemas/questionnaire/createQuestionnaire.schema.json +29 -0
  37. package/dist/schemas/questionnaire/index.d.ts +1 -0
  38. package/dist/schemas/questionnaire/types.d.ts +7 -0
  39. package/dist/schemas/subform/create.schema.json +12 -0
  40. package/dist/schemas/subform/update.schema.json +12 -0
  41. package/dist/schemas/user_settings/APP_FONT_FACTOR.schema.json +10 -0
  42. package/dist/schemas/user_settings/AUTH_SECURITY_CONFIG.schema.json +41 -0
  43. package/dist/schemas/user_settings/GenericBooleanSetting.schema.json +9 -0
  44. package/dist/schemas/user_settings/index.d.ts +1 -0
  45. package/dist/schemas/user_settings/types.d.ts +5 -0
  46. package/dist/schemas/users/activate.schema.json +24 -0
  47. package/dist/schemas/users/contact.schema.json +15 -0
  48. package/dist/schemas/users/create.schema.json +92 -0
  49. package/dist/schemas/users/password.schema.json +12 -0
  50. package/dist/schemas/users/selfregister.schema.json +15 -0
  51. package/dist/schemas/users/unlinkProject.schema.json +18 -0
  52. package/package.json +176 -0
@@ -0,0 +1,486 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/UpdateDashboardPayload",
4
+ "definitions": {
5
+ "UpdateDashboardPayload": {
6
+ "type": "object",
7
+ "properties": {
8
+ "title": {
9
+ "type": "string"
10
+ },
11
+ "active": {
12
+ "type": "boolean"
13
+ },
14
+ "config": {
15
+ "$ref": "#/definitions/DashboardConfig"
16
+ },
17
+ "icon": {
18
+ "type": ["string", "null"]
19
+ },
20
+ "weight": {
21
+ "type": "number"
22
+ }
23
+ },
24
+ "additionalProperties": false
25
+ },
26
+ "DashboardConfig": {
27
+ "type": "object",
28
+ "properties": {
29
+ "widgets": {
30
+ "type": "array",
31
+ "items": {
32
+ "$ref": "#/definitions/Widget"
33
+ }
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "Widget": {
39
+ "anyOf": [
40
+ {
41
+ "type": "object",
42
+ "additionalProperties": false,
43
+ "properties": {
44
+ "type": {
45
+ "type": "string",
46
+ "const": "SectionCard"
47
+ },
48
+ "params": {
49
+ "$ref": "#/definitions/SectionCardProps"
50
+ },
51
+ "size": {
52
+ "anyOf": [
53
+ {
54
+ "type": "number"
55
+ },
56
+ {
57
+ "$ref": "#/definitions/ColProps"
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ "required": ["params", "type"]
63
+ },
64
+ {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "type": {
69
+ "type": "string",
70
+ "const": "ValueCard"
71
+ },
72
+ "params": {
73
+ "$ref": "#/definitions/ValueCardProps"
74
+ },
75
+ "size": {
76
+ "anyOf": [
77
+ {
78
+ "type": "number"
79
+ },
80
+ {
81
+ "$ref": "#/definitions/ColProps"
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ "required": ["params", "type"]
87
+ },
88
+ {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "properties": {
92
+ "type": {
93
+ "type": "string",
94
+ "const": "PatientList"
95
+ },
96
+ "params": {
97
+ "$ref": "#/definitions/PatientListProps"
98
+ },
99
+ "size": {
100
+ "anyOf": [
101
+ {
102
+ "type": "number"
103
+ },
104
+ {
105
+ "$ref": "#/definitions/ColProps"
106
+ }
107
+ ]
108
+ }
109
+ },
110
+ "required": ["params", "type"]
111
+ }
112
+ ]
113
+ },
114
+ "SectionCardProps": {
115
+ "type": "object",
116
+ "properties": {
117
+ "icon": {
118
+ "type": "string"
119
+ },
120
+ "background": {
121
+ "type": "string"
122
+ },
123
+ "titleBackground": {
124
+ "type": "string"
125
+ },
126
+ "title": {
127
+ "$ref": "#/definitions/I18nTextTranslation"
128
+ },
129
+ "widgets": {
130
+ "type": "array",
131
+ "items": {
132
+ "$ref": "#/definitions/Widget"
133
+ }
134
+ }
135
+ },
136
+ "required": ["icon", "title", "widgets"],
137
+ "additionalProperties": false
138
+ },
139
+ "I18nTextTranslation": {
140
+ "anyOf": [
141
+ {
142
+ "type": "object",
143
+ "properties": {
144
+ "default": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": ["default"],
149
+ "additionalProperties": {
150
+ "type": "string"
151
+ }
152
+ },
153
+ {
154
+ "type": "string"
155
+ }
156
+ ]
157
+ },
158
+ "ColProps": {
159
+ "type": "object",
160
+ "properties": {
161
+ "flex": {
162
+ "$ref": "#/definitions/FlexType"
163
+ },
164
+ "span": {
165
+ "$ref": "#/definitions/ColSpanType"
166
+ },
167
+ "order": {
168
+ "$ref": "#/definitions/ColSpanType"
169
+ },
170
+ "offset": {
171
+ "$ref": "#/definitions/ColSpanType"
172
+ },
173
+ "push": {
174
+ "$ref": "#/definitions/ColSpanType"
175
+ },
176
+ "pull": {
177
+ "$ref": "#/definitions/ColSpanType"
178
+ },
179
+ "xs": {
180
+ "anyOf": [
181
+ {
182
+ "$ref": "#/definitions/ColSpanType"
183
+ },
184
+ {
185
+ "$ref": "#/definitions/ColSize"
186
+ }
187
+ ]
188
+ },
189
+ "sm": {
190
+ "anyOf": [
191
+ {
192
+ "$ref": "#/definitions/ColSpanType"
193
+ },
194
+ {
195
+ "$ref": "#/definitions/ColSize"
196
+ }
197
+ ]
198
+ },
199
+ "md": {
200
+ "anyOf": [
201
+ {
202
+ "$ref": "#/definitions/ColSpanType"
203
+ },
204
+ {
205
+ "$ref": "#/definitions/ColSize"
206
+ }
207
+ ]
208
+ },
209
+ "lg": {
210
+ "anyOf": [
211
+ {
212
+ "$ref": "#/definitions/ColSpanType"
213
+ },
214
+ {
215
+ "$ref": "#/definitions/ColSize"
216
+ }
217
+ ]
218
+ },
219
+ "xl": {
220
+ "anyOf": [
221
+ {
222
+ "$ref": "#/definitions/ColSpanType"
223
+ },
224
+ {
225
+ "$ref": "#/definitions/ColSize"
226
+ }
227
+ ]
228
+ },
229
+ "xxl": {
230
+ "anyOf": [
231
+ {
232
+ "$ref": "#/definitions/ColSpanType"
233
+ },
234
+ {
235
+ "$ref": "#/definitions/ColSize"
236
+ }
237
+ ]
238
+ },
239
+ "prefixCls": {
240
+ "type": "string"
241
+ }
242
+ },
243
+ "additionalProperties": false
244
+ },
245
+ "FlexType": {
246
+ "anyOf": [
247
+ {
248
+ "type": "number"
249
+ },
250
+ {
251
+ "type": "string",
252
+ "const": "none"
253
+ },
254
+ {
255
+ "type": "string",
256
+ "const": "auto"
257
+ },
258
+ {
259
+ "type": "string"
260
+ }
261
+ ]
262
+ },
263
+ "ColSpanType": {
264
+ "type": ["number", "string"]
265
+ },
266
+ "ColSize": {
267
+ "type": "object",
268
+ "properties": {
269
+ "flex": {
270
+ "$ref": "#/definitions/FlexType"
271
+ },
272
+ "span": {
273
+ "$ref": "#/definitions/ColSpanType"
274
+ },
275
+ "order": {
276
+ "$ref": "#/definitions/ColSpanType"
277
+ },
278
+ "offset": {
279
+ "$ref": "#/definitions/ColSpanType"
280
+ },
281
+ "push": {
282
+ "$ref": "#/definitions/ColSpanType"
283
+ },
284
+ "pull": {
285
+ "$ref": "#/definitions/ColSpanType"
286
+ }
287
+ },
288
+ "additionalProperties": false
289
+ },
290
+ "ValueCardProps": {
291
+ "type": "object",
292
+ "properties": {
293
+ "title": {
294
+ "$ref": "#/definitions/I18nTextTranslation"
295
+ },
296
+ "icon": {
297
+ "type": "string"
298
+ },
299
+ "text": {
300
+ "$ref": "#/definitions/I18nTextTranslation"
301
+ },
302
+ "subtext": {
303
+ "$ref": "#/definitions/I18nTextTranslation"
304
+ },
305
+ "titleTextColor": {
306
+ "type": "string"
307
+ },
308
+ "bodyTextColor": {
309
+ "type": "string"
310
+ },
311
+ "data": {
312
+ "type": "object"
313
+ },
314
+ "dataLoader": {
315
+ "$ref": "#/definitions/WidgetDataLoader%3CWidgetOutcomesDataLoader%3E"
316
+ }
317
+ },
318
+ "required": ["title", "icon", "text"],
319
+ "additionalProperties": false
320
+ },
321
+ "WidgetDataLoader<WidgetOutcomesDataLoader>": {
322
+ "type": "object",
323
+ "properties": {
324
+ "type": {
325
+ "type": "string",
326
+ "const": "outcomes"
327
+ },
328
+ "params": {
329
+ "type": "object",
330
+ "properties": {
331
+ "ecosystem": {
332
+ "type": "string"
333
+ },
334
+ "projectName": {
335
+ "type": "string"
336
+ },
337
+ "clinicId": {
338
+ "type": "number"
339
+ },
340
+ "name": {
341
+ "anyOf": [
342
+ {
343
+ "type": "string"
344
+ },
345
+ {
346
+ "type": "array",
347
+ "items": {
348
+ "type": "string"
349
+ }
350
+ }
351
+ ]
352
+ },
353
+ "identifier": {
354
+ "anyOf": [
355
+ {
356
+ "type": "string"
357
+ },
358
+ {
359
+ "type": "array",
360
+ "items": {
361
+ "type": "string"
362
+ }
363
+ }
364
+ ]
365
+ },
366
+ "from": {
367
+ "type": "string"
368
+ },
369
+ "to": {
370
+ "type": "string"
371
+ },
372
+ "datesContained": {
373
+ "type": "boolean"
374
+ },
375
+ "aggType": {
376
+ "type": "string",
377
+ "enum": ["avg", "count", "max", "min", "sum"]
378
+ },
379
+ "groupBy": {
380
+ "anyOf": [
381
+ {
382
+ "$ref": "#/definitions/OutcomesGroupBy"
383
+ },
384
+ {
385
+ "type": "array",
386
+ "items": {
387
+ "$ref": "#/definitions/OutcomesGroupBy"
388
+ }
389
+ }
390
+ ]
391
+ },
392
+ "limit": {
393
+ "type": "number"
394
+ },
395
+ "orderBy": {
396
+ "type": "string"
397
+ },
398
+ "orderDir": {
399
+ "type": "string",
400
+ "enum": ["asc", "desc"],
401
+ "description": "Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts"
402
+ }
403
+ },
404
+ "required": ["ecosystem", "projectName", "name"],
405
+ "additionalProperties": false
406
+ }
407
+ },
408
+ "required": ["type", "params"],
409
+ "additionalProperties": false
410
+ },
411
+ "OutcomesGroupBy": {
412
+ "type": "string",
413
+ "enum": [
414
+ "name",
415
+ "identifier",
416
+ "value",
417
+ "from",
418
+ "to",
419
+ "from.date",
420
+ "from.day",
421
+ "from.dayname",
422
+ "from.dayofmonth",
423
+ "from.dayofweek",
424
+ "from.dayofyear",
425
+ "from.hour",
426
+ "from.minute",
427
+ "from.month",
428
+ "from.monthname",
429
+ "from.time",
430
+ "from.second",
431
+ "from.week",
432
+ "from.weekday",
433
+ "from.weekofyear",
434
+ "from.year",
435
+ "from.yearweek",
436
+ "to.date",
437
+ "to.day",
438
+ "to.dayname",
439
+ "to.dayofmonth",
440
+ "to.dayofweek",
441
+ "to.dayofyear",
442
+ "to.hour",
443
+ "to.minute",
444
+ "to.month",
445
+ "to.monthname",
446
+ "to.time",
447
+ "to.second",
448
+ "to.week",
449
+ "to.weekday",
450
+ "to.weekofyear",
451
+ "to.year",
452
+ "to.yearweek"
453
+ ]
454
+ },
455
+ "PatientListProps": {
456
+ "type": "object",
457
+ "properties": {
458
+ "loadUserProfiles": {
459
+ "type": "boolean"
460
+ },
461
+ "loadAdherence": {
462
+ "type": "boolean"
463
+ },
464
+ "extraFields": {
465
+ "type": "array",
466
+ "items": {
467
+ "type": "string"
468
+ }
469
+ },
470
+ "loadPushTokens": {
471
+ "type": "boolean"
472
+ },
473
+ "loadUserAccessData": {
474
+ "type": "boolean"
475
+ },
476
+ "programId": {
477
+ "type": ["number", "null"]
478
+ },
479
+ "prevAdherenceDays": {
480
+ "type": ["number", "null"]
481
+ }
482
+ },
483
+ "additionalProperties": false
484
+ }
485
+ }
486
+ }
@@ -0,0 +1,9 @@
1
+ export interface PatientListProps {
2
+ loadUserProfiles?: boolean;
3
+ loadAdherence?: boolean;
4
+ extraFields?: string[];
5
+ loadPushTokens?: boolean;
6
+ loadUserAccessData?: boolean;
7
+ programId?: number | null;
8
+ prevAdherenceDays?: number | null;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { Widget } from '../types';
2
+ import { I18nTextTranslation } from '../i18n';
3
+ export interface SectionCardProps {
4
+ icon: string;
5
+ background?: string;
6
+ titleBackground?: string;
7
+ title: I18nTextTranslation;
8
+ widgets: Widget[];
9
+ }
@@ -0,0 +1,13 @@
1
+ import { I18nTextTranslation } from '../i18n';
2
+ import { WidgetDataLoader } from '../types';
3
+ import { WidgetOutcomesDataLoader } from '../data_loaders/Outcomes';
4
+ export interface ValueCardProps {
5
+ title: I18nTextTranslation;
6
+ icon: string;
7
+ text: I18nTextTranslation;
8
+ subtext?: I18nTextTranslation;
9
+ titleTextColor?: string;
10
+ bodyTextColor?: string;
11
+ data?: Record<string, any>;
12
+ dataLoader?: WidgetDataLoader<WidgetOutcomesDataLoader>;
13
+ }
@@ -0,0 +1,3 @@
1
+ export * from './PatientListProps';
2
+ export * from './SectionCardProps';
3
+ export * from './ValueCardProps';
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "description": "schema for create form",
4
+ "type": "array",
5
+ "items": {
6
+ "type": "object",
7
+ "additionalProperties": {
8
+ "type": ["integer", "string", "boolean", "null", "array", "object"]
9
+ }
10
+ },
11
+ "maxLength": 1
12
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "description": "validation update form",
4
+ "anyOf": [
5
+ {
6
+ "type": "object",
7
+ "additionalProperties": {
8
+ "type": ["integer", "string", "boolean", "null", "array", "object"]
9
+ }
10
+ },
11
+ {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "additionalProperties": {
16
+ "type": ["integer", "string", "boolean", "null", "array", "object"]
17
+ }
18
+ },
19
+ "maxLength": 1
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "description": "validation create hospital",
4
+ "anyOf": [
5
+ {
6
+ "type": "object",
7
+ "patternProperties": {
8
+ "^[0-9a-z_]+$": { "type": ["string", "null", "number"] }
9
+ },
10
+ "additionalProperties": false
11
+ },
12
+ {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "patternProperties": {
17
+ "^[0-9a-z_]+$": { "type": ["string", "null", "number"] }
18
+ },
19
+ "additionalProperties": false
20
+ }
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,15 @@
1
+ import * as dashboard from './dashboard';
2
+ import * as authentication_security from './authentication_security';
3
+ import * as notification_configuration from './notification_configuration';
4
+ import * as outcomes from './outcomes';
5
+ import * as questionnaire from './questionnaire';
6
+ import * as user_settings from './user_settings';
7
+ declare const schemas: {
8
+ dashboard: typeof dashboard;
9
+ authentication_security: typeof authentication_security;
10
+ notification_configuration: typeof notification_configuration;
11
+ outcomes: typeof outcomes;
12
+ questionnaire: typeof questionnaire;
13
+ user_settings: typeof user_settings;
14
+ };
15
+ export default schemas;
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/ReqBodyWithMFA",
4
+ "definitions": {
5
+ "ReqBodyWithMFA": {
6
+ "type": "object",
7
+ "properties": {
8
+ "mfa": {
9
+ "$ref": "#/definitions/MFALoginData"
10
+ }
11
+ },
12
+ "description": "req.body object mfa validation"
13
+ },
14
+ "MFALoginData": {
15
+ "type": "object",
16
+ "properties": {
17
+ "type": {
18
+ "$ref": "#/definitions/MFAMethodCode"
19
+ },
20
+ "value": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": ["type", "value"],
25
+ "additionalProperties": false
26
+ },
27
+ "MFAMethodCode": {
28
+ "type": "string",
29
+ "enum": ["sms", "email"],
30
+ "description": "Available MFA methods"
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "description": "schema for create new patient endpoint",
4
+ "type": "array",
5
+ "items": {
6
+ "type": "string",
7
+ "pattern": "^[0-9]+$"
8
+ }
9
+ }