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