@persei/perseed-api 4.34.19 → 4.34.20

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.
package/README.md CHANGED
@@ -10,6 +10,7 @@
10
10
  8. [Redis cache and queue](#8-redis-cache-and-queue)
11
11
  9. [Generating json schema from ts definitions](#9-generating-json-schema-from-ts-definitions)
12
12
  10. [Add a new language](#10-add-a-new-language)
13
+ 11. [Lib package build](#11-lib-package-build)
13
14
 
14
15
  # 1 - Perseed API - NodeJs
15
16
 
@@ -258,3 +259,10 @@ To add a new language:
258
259
  * Run `npm run i18n:generate` to generate the new locale file with the default values (in english). This file should be translated.
259
260
  * Done!
260
261
 
262
+ ## 11 Lib package build
263
+
264
+ To build the lib package:
265
+ * Increase the package.json version
266
+ * Run `npm run lib:build`
267
+ * Commit changes
268
+ * Run `npm publish`
package/dist/index.d.ts CHANGED
@@ -120,6 +120,12 @@ declare interface CacheOptions {
120
120
  tags: Record<string, any>;
121
121
  }
122
122
 
123
+ export declare interface CalculatedColumn {
124
+ key: string;
125
+ label: string;
126
+ template: string;
127
+ }
128
+
123
129
  declare class Clinic extends BaseModel {
124
130
  name: string;
125
131
  country: string;
@@ -483,7 +489,7 @@ declare class CustomQueryBuilder<M extends Model = Model, R = M[]> extends Query
483
489
 
484
490
  export declare type DashboardBaseWidgetPayload = {
485
491
  title: string;
486
- description?: string;
492
+ description?: string | null;
487
493
  weight?: number;
488
494
  size?: number | ColProps;
489
495
  library?: boolean;
@@ -515,7 +521,7 @@ export declare type DashboardWidgetBlockCreatePayload = {
515
521
  parent_id: number | string;
516
522
  child_id: number;
517
523
  position: number;
518
- config?: WidgetBlockConfig;
524
+ config?: WidgetBlockConfig | null;
519
525
  };
520
526
 
521
527
  export declare type DashboardWidgetDataLoader<T> = T extends {
@@ -797,9 +803,6 @@ export declare const FIELDS: {
797
803
 
798
804
  export declare interface FilterParams {
799
805
  conditions?: Record<string, unknown>;
800
- relatedData?: {
801
- join?: string[];
802
- };
803
806
  }
804
807
 
805
808
  export declare type FlexType = number | 'none' | 'auto' | string;
@@ -1099,20 +1102,25 @@ export declare interface OutcomesParams {
1099
1102
 
1100
1103
  export declare const PATIENT_CREATION_ABOUT = "Patient Creation";
1101
1104
 
1105
+ export declare interface PatientListColumn {
1106
+ hidden?: boolean;
1107
+ position?: number;
1108
+ label?: string;
1109
+ key: string;
1110
+ }
1111
+
1102
1112
  export declare interface PatientListProps {
1103
1113
  loadUserProfiles?: boolean;
1104
1114
  loadAdherence?: boolean;
1105
1115
  extraFields?: string[];
1106
1116
  loadPushTokens?: boolean;
1107
1117
  loadUserAccessData?: boolean;
1108
- programId?: number;
1109
- prevAdherenceDays?: number;
1110
- relatedData?: {
1111
- join?: string[];
1112
- };
1113
- filter?: {
1114
- conditions?: Record<string, unknown>;
1115
- };
1118
+ programId?: number | null;
1119
+ prevAdherenceDays?: number | null;
1120
+ filter?: FilterParams;
1121
+ relatedData?: RelatedDataParams;
1122
+ calculatedColumns?: CalculatedColumn[];
1123
+ columns?: PatientListColumn[];
1116
1124
  }
1117
1125
 
1118
1126
  declare class Profiling extends BaseModel {
@@ -1591,6 +1599,10 @@ export declare interface QuestionnaireInfoUpdateOptions {
1591
1599
 
1592
1600
  export declare type QuestionnaireTypeValue = 'QoL' | 'Task';
1593
1601
 
1602
+ export declare interface RelatedDataParams {
1603
+ join?: string[];
1604
+ }
1605
+
1594
1606
  /**
1595
1607
  * req.body object mfa validation
1596
1608
  */
@@ -19,7 +19,7 @@
19
19
  "type": "string"
20
20
  },
21
21
  "description": {
22
- "type": "string"
22
+ "type": ["string", "null"]
23
23
  },
24
24
  "weight": {
25
25
  "type": "number"
@@ -61,7 +61,7 @@
61
61
  "type": "string"
62
62
  },
63
63
  "description": {
64
- "type": "string"
64
+ "type": ["string", "null"]
65
65
  },
66
66
  "weight": {
67
67
  "type": "number"
@@ -103,7 +103,7 @@
103
103
  "type": "string"
104
104
  },
105
105
  "description": {
106
- "type": "string"
106
+ "type": ["string", "null"]
107
107
  },
108
108
  "weight": {
109
109
  "type": "number"
@@ -145,7 +145,7 @@
145
145
  "type": "string"
146
146
  },
147
147
  "description": {
148
- "type": "string"
148
+ "type": ["string", "null"]
149
149
  },
150
150
  "weight": {
151
151
  "type": "number"
@@ -335,7 +335,14 @@
335
335
  "type": "number"
336
336
  },
337
337
  "config": {
338
- "$ref": "#/definitions/WidgetBlockConfig"
338
+ "anyOf": [
339
+ {
340
+ "$ref": "#/definitions/WidgetBlockConfig"
341
+ },
342
+ {
343
+ "type": "null"
344
+ }
345
+ ]
339
346
  }
340
347
  },
341
348
  "required": ["parent_id", "child_id", "position"],
@@ -589,34 +596,87 @@
589
596
  "type": "boolean"
590
597
  },
591
598
  "programId": {
592
- "type": "number"
599
+ "type": ["number", "null"]
593
600
  },
594
601
  "prevAdherenceDays": {
595
- "type": "number"
602
+ "type": ["number", "null"]
603
+ },
604
+ "filter": {
605
+ "$ref": "#/definitions/FilterParams"
596
606
  },
597
607
  "relatedData": {
598
- "type": "object",
599
- "properties": {
600
- "join": {
601
- "type": "array",
602
- "items": {
603
- "type": "string"
604
- }
605
- }
606
- },
607
- "additionalProperties": false
608
+ "$ref": "#/definitions/RelatedDataParams"
608
609
  },
609
- "filter": {
610
+ "calculatedColumns": {
611
+ "type": "array",
612
+ "items": {
613
+ "$ref": "#/definitions/CalculatedColumn"
614
+ }
615
+ },
616
+ "columns": {
617
+ "type": "array",
618
+ "items": {
619
+ "$ref": "#/definitions/PatientListColumn"
620
+ }
621
+ }
622
+ },
623
+ "additionalProperties": false
624
+ },
625
+ "FilterParams": {
626
+ "type": "object",
627
+ "properties": {
628
+ "conditions": {
610
629
  "type": "object",
611
- "properties": {
612
- "conditions": {
613
- "type": "object",
614
- "additionalProperties": {}
615
- }
616
- },
617
- "additionalProperties": false
630
+ "additionalProperties": {}
631
+ }
632
+ },
633
+ "additionalProperties": false
634
+ },
635
+ "RelatedDataParams": {
636
+ "type": "object",
637
+ "properties": {
638
+ "join": {
639
+ "type": "array",
640
+ "items": {
641
+ "type": "string"
642
+ }
643
+ }
644
+ },
645
+ "additionalProperties": false
646
+ },
647
+ "CalculatedColumn": {
648
+ "type": "object",
649
+ "properties": {
650
+ "key": {
651
+ "type": "string"
652
+ },
653
+ "label": {
654
+ "type": "string"
655
+ },
656
+ "template": {
657
+ "type": "string"
658
+ }
659
+ },
660
+ "required": ["key", "label", "template"],
661
+ "additionalProperties": false
662
+ },
663
+ "PatientListColumn": {
664
+ "type": "object",
665
+ "properties": {
666
+ "hidden": {
667
+ "type": "boolean"
668
+ },
669
+ "position": {
670
+ "type": "number"
671
+ },
672
+ "label": {
673
+ "type": "string"
674
+ },
675
+ "key": {
676
+ "type": "string"
618
677
  }
619
678
  },
679
+ "required": ["key"],
620
680
  "additionalProperties": false
621
681
  },
622
682
  "DashboardProps": {
@@ -9,7 +9,7 @@
9
9
  "type": "string"
10
10
  },
11
11
  "description": {
12
- "type": "string"
12
+ "type": ["string", "null"]
13
13
  },
14
14
  "weight": {
15
15
  "type": "number"
@@ -217,7 +217,14 @@
217
217
  "type": "number"
218
218
  },
219
219
  "config": {
220
- "$ref": "#/definitions/WidgetBlockConfig"
220
+ "anyOf": [
221
+ {
222
+ "$ref": "#/definitions/WidgetBlockConfig"
223
+ },
224
+ {
225
+ "type": "null"
226
+ }
227
+ ]
221
228
  }
222
229
  },
223
230
  "required": ["parent_id", "child_id", "position"],
@@ -487,34 +494,87 @@
487
494
  "type": "boolean"
488
495
  },
489
496
  "programId": {
490
- "type": "number"
497
+ "type": ["number", "null"]
491
498
  },
492
499
  "prevAdherenceDays": {
493
- "type": "number"
500
+ "type": ["number", "null"]
501
+ },
502
+ "filter": {
503
+ "$ref": "#/definitions/FilterParams"
494
504
  },
495
505
  "relatedData": {
496
- "type": "object",
497
- "properties": {
498
- "join": {
499
- "type": "array",
500
- "items": {
501
- "type": "string"
502
- }
503
- }
504
- },
505
- "additionalProperties": false
506
+ "$ref": "#/definitions/RelatedDataParams"
506
507
  },
507
- "filter": {
508
+ "calculatedColumns": {
509
+ "type": "array",
510
+ "items": {
511
+ "$ref": "#/definitions/CalculatedColumn"
512
+ }
513
+ },
514
+ "columns": {
515
+ "type": "array",
516
+ "items": {
517
+ "$ref": "#/definitions/PatientListColumn"
518
+ }
519
+ }
520
+ },
521
+ "additionalProperties": false
522
+ },
523
+ "FilterParams": {
524
+ "type": "object",
525
+ "properties": {
526
+ "conditions": {
508
527
  "type": "object",
509
- "properties": {
510
- "conditions": {
511
- "type": "object",
512
- "additionalProperties": {}
513
- }
514
- },
515
- "additionalProperties": false
528
+ "additionalProperties": {}
529
+ }
530
+ },
531
+ "additionalProperties": false
532
+ },
533
+ "RelatedDataParams": {
534
+ "type": "object",
535
+ "properties": {
536
+ "join": {
537
+ "type": "array",
538
+ "items": {
539
+ "type": "string"
540
+ }
541
+ }
542
+ },
543
+ "additionalProperties": false
544
+ },
545
+ "CalculatedColumn": {
546
+ "type": "object",
547
+ "properties": {
548
+ "key": {
549
+ "type": "string"
550
+ },
551
+ "label": {
552
+ "type": "string"
553
+ },
554
+ "template": {
555
+ "type": "string"
556
+ }
557
+ },
558
+ "required": ["key", "label", "template"],
559
+ "additionalProperties": false
560
+ },
561
+ "PatientListColumn": {
562
+ "type": "object",
563
+ "properties": {
564
+ "hidden": {
565
+ "type": "boolean"
566
+ },
567
+ "position": {
568
+ "type": "number"
569
+ },
570
+ "label": {
571
+ "type": "string"
572
+ },
573
+ "key": {
574
+ "type": "string"
516
575
  }
517
576
  },
577
+ "required": ["key"],
518
578
  "additionalProperties": false
519
579
  },
520
580
  "DashboardProps": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@persei/perseed-api",
3
- "version": "4.34.19",
3
+ "version": "4.34.20",
4
4
  "private": false,
5
5
  "main": "./dist/perseed-api.umd.js",
6
6
  "module": "./dist/perseed-api.mjs",
@@ -60,6 +60,7 @@
60
60
  }
61
61
  },
62
62
  "dependencies": {
63
+ "@aws-sdk/client-sns": "^3.803.0",
63
64
  "@paralleldrive/cuid2": "^2.2.2",
64
65
  "@persei/debug": "^2.0.0",
65
66
  "@sentry/node": "^6.19.6",