@msbci/form-server 1.3.2 → 1.3.4

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/dist/index.d.mts CHANGED
@@ -192,21 +192,21 @@ declare class FormService {
192
192
  updatedAt: Date;
193
193
  order: number;
194
194
  conditions: string | null;
195
- options: string | null;
196
- pageId: string | null;
197
- templateOverrides: string | null;
198
195
  type: string;
199
- rosterId: string | null;
200
196
  isRequired: boolean;
201
197
  isReadonly: boolean;
202
198
  isHidden: boolean;
203
199
  defaultValue: string | null;
204
200
  placeholder: string | null;
201
+ options: string | null;
205
202
  validationRules: string | null;
206
203
  expression: string | null;
207
204
  dataSourceId: string | null;
208
205
  dataSourceDependencies: string | null;
209
206
  style: string | null;
207
+ templateOverrides: string | null;
208
+ pageId: string | null;
209
+ rosterId: string | null;
210
210
  templateId: string | null;
211
211
  }[];
212
212
  rosters: ({
@@ -220,21 +220,21 @@ declare class FormService {
220
220
  updatedAt: Date;
221
221
  order: number;
222
222
  conditions: string | null;
223
- options: string | null;
224
- pageId: string | null;
225
- templateOverrides: string | null;
226
223
  type: string;
227
- rosterId: string | null;
228
224
  isRequired: boolean;
229
225
  isReadonly: boolean;
230
226
  isHidden: boolean;
231
227
  defaultValue: string | null;
232
228
  placeholder: string | null;
229
+ options: string | null;
233
230
  validationRules: string | null;
234
231
  expression: string | null;
235
232
  dataSourceId: string | null;
236
233
  dataSourceDependencies: string | null;
237
234
  style: string | null;
235
+ templateOverrides: string | null;
236
+ pageId: string | null;
237
+ rosterId: string | null;
238
238
  templateId: string | null;
239
239
  }[];
240
240
  } & {
@@ -246,10 +246,10 @@ declare class FormService {
246
246
  updatedAt: Date;
247
247
  order: number;
248
248
  conditions: string | null;
249
- rosterType: string;
250
- pilotVariableCode: string | null;
251
249
  options: string | null;
252
250
  pageId: string;
251
+ rosterType: string;
252
+ pilotVariableCode: string | null;
253
253
  })[];
254
254
  } & {
255
255
  id: string;
@@ -292,6 +292,7 @@ declare class FormService {
292
292
  formTypeId?: string;
293
293
  scopeIds?: string[];
294
294
  metadata?: Record<string, unknown>;
295
+ pages?: any[];
295
296
  }, ctx?: IRequestContext): Promise<{
296
297
  id: string;
297
298
  code: string;
@@ -316,6 +317,7 @@ declare class FormService {
316
317
  formTypeId: string;
317
318
  scopeIds: string[];
318
319
  metadata: Record<string, unknown>;
320
+ pages: any[];
319
321
  }>, ctx?: IRequestContext): Promise<({
320
322
  scopes: {
321
323
  order: number;
@@ -337,6 +339,8 @@ declare class FormService {
337
339
  createdBy: string | null;
338
340
  updatedBy: string | null;
339
341
  }) | null>;
342
+ /** Persist a page tree (pages -> variables + rosters -> variables) for a form. */
343
+ private persistPages;
340
344
  /**
341
345
  * Load a form by id and return it as a fully-resolved `IFormDefinition`
342
346
  * (templates applied — Option B). Used by `GET /forms/:id/resolved` and
@@ -447,10 +451,10 @@ declare class FormService {
447
451
  updatedAt: Date;
448
452
  order: number;
449
453
  conditions: string | null;
450
- rosterType: string;
451
- pilotVariableCode: string | null;
452
454
  options: string | null;
453
455
  pageId: string;
456
+ rosterType: string;
457
+ pilotVariableCode: string | null;
454
458
  }>;
455
459
  updateFormRoster(id: string, data: Partial<{
456
460
  code: string;
@@ -470,10 +474,10 @@ declare class FormService {
470
474
  updatedAt: Date;
471
475
  order: number;
472
476
  conditions: string | null;
473
- rosterType: string;
474
- pilotVariableCode: string | null;
475
477
  options: string | null;
476
478
  pageId: string;
479
+ rosterType: string;
480
+ pilotVariableCode: string | null;
477
481
  }>;
478
482
  deleteFormRoster(id: string): Promise<{
479
483
  id: string;
@@ -484,10 +488,10 @@ declare class FormService {
484
488
  updatedAt: Date;
485
489
  order: number;
486
490
  conditions: string | null;
487
- rosterType: string;
488
- pilotVariableCode: string | null;
489
491
  options: string | null;
490
492
  pageId: string;
493
+ rosterType: string;
494
+ pilotVariableCode: string | null;
491
495
  }>;
492
496
  createFormVariable(data: {
493
497
  code: string;
@@ -522,21 +526,21 @@ declare class FormService {
522
526
  updatedAt: Date;
523
527
  order: number;
524
528
  conditions: string | null;
525
- options: string | null;
526
- pageId: string | null;
527
- templateOverrides: string | null;
528
529
  type: string;
529
- rosterId: string | null;
530
530
  isRequired: boolean;
531
531
  isReadonly: boolean;
532
532
  isHidden: boolean;
533
533
  defaultValue: string | null;
534
534
  placeholder: string | null;
535
+ options: string | null;
535
536
  validationRules: string | null;
536
537
  expression: string | null;
537
538
  dataSourceId: string | null;
538
539
  dataSourceDependencies: string | null;
539
540
  style: string | null;
541
+ templateOverrides: string | null;
542
+ pageId: string | null;
543
+ rosterId: string | null;
540
544
  templateId: string | null;
541
545
  }>;
542
546
  updateFormVariable(id: string, data: Partial<{
@@ -570,21 +574,21 @@ declare class FormService {
570
574
  updatedAt: Date;
571
575
  order: number;
572
576
  conditions: string | null;
573
- options: string | null;
574
- pageId: string | null;
575
- templateOverrides: string | null;
576
577
  type: string;
577
- rosterId: string | null;
578
578
  isRequired: boolean;
579
579
  isReadonly: boolean;
580
580
  isHidden: boolean;
581
581
  defaultValue: string | null;
582
582
  placeholder: string | null;
583
+ options: string | null;
583
584
  validationRules: string | null;
584
585
  expression: string | null;
585
586
  dataSourceId: string | null;
586
587
  dataSourceDependencies: string | null;
587
588
  style: string | null;
589
+ templateOverrides: string | null;
590
+ pageId: string | null;
591
+ rosterId: string | null;
588
592
  templateId: string | null;
589
593
  }>;
590
594
  deleteFormVariable(id: string): Promise<{
@@ -597,21 +601,21 @@ declare class FormService {
597
601
  updatedAt: Date;
598
602
  order: number;
599
603
  conditions: string | null;
600
- options: string | null;
601
- pageId: string | null;
602
- templateOverrides: string | null;
603
604
  type: string;
604
- rosterId: string | null;
605
605
  isRequired: boolean;
606
606
  isReadonly: boolean;
607
607
  isHidden: boolean;
608
608
  defaultValue: string | null;
609
609
  placeholder: string | null;
610
+ options: string | null;
610
611
  validationRules: string | null;
611
612
  expression: string | null;
612
613
  dataSourceId: string | null;
613
614
  dataSourceDependencies: string | null;
614
615
  style: string | null;
616
+ templateOverrides: string | null;
617
+ pageId: string | null;
618
+ rosterId: string | null;
615
619
  templateId: string | null;
616
620
  }>;
617
621
  getSubmissions(params: {
@@ -783,6 +787,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
783
787
  formTypeId: z.ZodOptional<z.ZodString>;
784
788
  scopeIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
785
789
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
790
+ pages: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
786
791
  }, "strip", z.ZodTypeAny, {
787
792
  code: string;
788
793
  name: string;
@@ -792,6 +797,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
792
797
  metadata?: Record<string, unknown> | undefined;
793
798
  tenantId?: string | undefined;
794
799
  formTypeId?: string | undefined;
800
+ pages?: unknown[] | undefined;
795
801
  scopeIds?: string[] | undefined;
796
802
  }, {
797
803
  code: string;
@@ -802,6 +808,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
802
808
  version?: string | undefined;
803
809
  isPublished?: boolean | undefined;
804
810
  formTypeId?: string | undefined;
811
+ pages?: unknown[] | undefined;
805
812
  scopeIds?: string[] | undefined;
806
813
  }>;
807
814
  declare const updateFormDefinitionSchema: z.ZodObject<{
@@ -814,6 +821,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
814
821
  formTypeId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
815
822
  scopeIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
816
823
  metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
824
+ pages: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>>;
817
825
  }, "strip", z.ZodTypeAny, {
818
826
  code?: string | undefined;
819
827
  name?: string | undefined;
@@ -823,6 +831,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
823
831
  version?: string | undefined;
824
832
  isPublished?: boolean | undefined;
825
833
  formTypeId?: string | undefined;
834
+ pages?: unknown[] | undefined;
826
835
  scopeIds?: string[] | undefined;
827
836
  }, {
828
837
  code?: string | undefined;
@@ -833,6 +842,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
833
842
  version?: string | undefined;
834
843
  isPublished?: boolean | undefined;
835
844
  formTypeId?: string | undefined;
845
+ pages?: unknown[] | undefined;
836
846
  scopeIds?: string[] | undefined;
837
847
  }>;
838
848
  declare const createFormPageSchema: z.ZodObject<{
@@ -931,12 +941,12 @@ declare const createFormRosterSchema: z.ZodObject<{
931
941
  rosterType: "check" | "list" | "collection" | "collection_extend";
932
942
  metadata?: Record<string, unknown> | undefined;
933
943
  conditions?: unknown[] | undefined;
934
- pilotVariableCode?: string | undefined;
935
944
  options?: {
936
945
  label: string;
937
946
  metadata?: Record<string, unknown> | undefined;
938
947
  value?: unknown;
939
948
  }[] | undefined;
949
+ pilotVariableCode?: string | undefined;
940
950
  }, {
941
951
  code: string;
942
952
  name: string;
@@ -944,12 +954,12 @@ declare const createFormRosterSchema: z.ZodObject<{
944
954
  rosterType: "check" | "list" | "collection" | "collection_extend";
945
955
  metadata?: Record<string, unknown> | undefined;
946
956
  conditions?: unknown[] | undefined;
947
- pilotVariableCode?: string | undefined;
948
957
  options?: {
949
958
  label: string;
950
959
  metadata?: Record<string, unknown> | undefined;
951
960
  value?: unknown;
952
961
  }[] | undefined;
962
+ pilotVariableCode?: string | undefined;
953
963
  }>;
954
964
  declare const updateFormRosterSchema: z.ZodObject<{
955
965
  code: z.ZodOptional<z.ZodString>;
@@ -978,26 +988,26 @@ declare const updateFormRosterSchema: z.ZodObject<{
978
988
  metadata?: Record<string, unknown> | undefined;
979
989
  order?: number | undefined;
980
990
  conditions?: unknown[] | undefined;
981
- rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
982
- pilotVariableCode?: string | undefined;
983
991
  options?: {
984
992
  label: string;
985
993
  metadata?: Record<string, unknown> | undefined;
986
994
  value?: unknown;
987
995
  }[] | undefined;
996
+ rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
997
+ pilotVariableCode?: string | undefined;
988
998
  }, {
989
999
  code?: string | undefined;
990
1000
  name?: string | undefined;
991
1001
  metadata?: Record<string, unknown> | undefined;
992
1002
  order?: number | undefined;
993
1003
  conditions?: unknown[] | undefined;
994
- rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
995
- pilotVariableCode?: string | undefined;
996
1004
  options?: {
997
1005
  label: string;
998
1006
  metadata?: Record<string, unknown> | undefined;
999
1007
  value?: unknown;
1000
1008
  }[] | undefined;
1009
+ rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
1010
+ pilotVariableCode?: string | undefined;
1001
1011
  }>;
1002
1012
  declare const createFormVariableSchema: z.ZodObject<{
1003
1013
  code: z.ZodString;
@@ -1055,14 +1065,13 @@ declare const createFormVariableSchema: z.ZodObject<{
1055
1065
  description?: string | undefined;
1056
1066
  metadata?: Record<string, unknown> | undefined;
1057
1067
  conditions?: unknown[] | undefined;
1068
+ defaultValue?: unknown;
1069
+ placeholder?: string | undefined;
1058
1070
  options?: {
1059
1071
  label: string;
1060
1072
  metadata?: Record<string, unknown> | undefined;
1061
1073
  value?: unknown;
1062
1074
  }[] | undefined;
1063
- templateOverrides?: Record<string, unknown> | undefined;
1064
- defaultValue?: unknown;
1065
- placeholder?: string | undefined;
1066
1075
  validationRules?: {
1067
1076
  type: string;
1068
1077
  message: string;
@@ -1072,6 +1081,7 @@ declare const createFormVariableSchema: z.ZodObject<{
1072
1081
  dataSourceId?: string | undefined;
1073
1082
  dataSourceDependencies?: Record<string, string> | undefined;
1074
1083
  style?: Record<string, unknown> | undefined;
1084
+ templateOverrides?: Record<string, unknown> | undefined;
1075
1085
  templateId?: string | undefined;
1076
1086
  }, {
1077
1087
  code: string;
@@ -1081,17 +1091,16 @@ declare const createFormVariableSchema: z.ZodObject<{
1081
1091
  description?: string | undefined;
1082
1092
  metadata?: Record<string, unknown> | undefined;
1083
1093
  conditions?: unknown[] | undefined;
1084
- options?: {
1085
- label: string;
1086
- metadata?: Record<string, unknown> | undefined;
1087
- value?: unknown;
1088
- }[] | undefined;
1089
- templateOverrides?: Record<string, unknown> | undefined;
1090
1094
  isRequired?: boolean | undefined;
1091
1095
  isReadonly?: boolean | undefined;
1092
1096
  isHidden?: boolean | undefined;
1093
1097
  defaultValue?: unknown;
1094
1098
  placeholder?: string | undefined;
1099
+ options?: {
1100
+ label: string;
1101
+ metadata?: Record<string, unknown> | undefined;
1102
+ value?: unknown;
1103
+ }[] | undefined;
1095
1104
  validationRules?: {
1096
1105
  type: string;
1097
1106
  message: string;
@@ -1101,6 +1110,7 @@ declare const createFormVariableSchema: z.ZodObject<{
1101
1110
  dataSourceId?: string | undefined;
1102
1111
  dataSourceDependencies?: Record<string, string> | undefined;
1103
1112
  style?: Record<string, unknown> | undefined;
1113
+ templateOverrides?: Record<string, unknown> | undefined;
1104
1114
  templateId?: string | undefined;
1105
1115
  }>;
1106
1116
  declare const updateFormVariableSchema: z.ZodObject<{
@@ -1155,18 +1165,17 @@ declare const updateFormVariableSchema: z.ZodObject<{
1155
1165
  metadata?: Record<string, unknown> | undefined;
1156
1166
  order?: number | undefined;
1157
1167
  conditions?: unknown[] | undefined;
1158
- options?: {
1159
- label: string;
1160
- metadata?: Record<string, unknown> | undefined;
1161
- value?: unknown;
1162
- }[] | undefined;
1163
- templateOverrides?: Record<string, unknown> | undefined;
1164
1168
  type?: string | undefined;
1165
1169
  isRequired?: boolean | undefined;
1166
1170
  isReadonly?: boolean | undefined;
1167
1171
  isHidden?: boolean | undefined;
1168
1172
  defaultValue?: unknown;
1169
1173
  placeholder?: string | undefined;
1174
+ options?: {
1175
+ label: string;
1176
+ metadata?: Record<string, unknown> | undefined;
1177
+ value?: unknown;
1178
+ }[] | undefined;
1170
1179
  validationRules?: {
1171
1180
  type: string;
1172
1181
  message: string;
@@ -1176,6 +1185,7 @@ declare const updateFormVariableSchema: z.ZodObject<{
1176
1185
  dataSourceId?: string | undefined;
1177
1186
  dataSourceDependencies?: Record<string, string> | undefined;
1178
1187
  style?: Record<string, unknown> | undefined;
1188
+ templateOverrides?: Record<string, unknown> | undefined;
1179
1189
  templateId?: string | undefined;
1180
1190
  }, {
1181
1191
  code?: string | undefined;
@@ -1184,18 +1194,17 @@ declare const updateFormVariableSchema: z.ZodObject<{
1184
1194
  metadata?: Record<string, unknown> | undefined;
1185
1195
  order?: number | undefined;
1186
1196
  conditions?: unknown[] | undefined;
1187
- options?: {
1188
- label: string;
1189
- metadata?: Record<string, unknown> | undefined;
1190
- value?: unknown;
1191
- }[] | undefined;
1192
- templateOverrides?: Record<string, unknown> | undefined;
1193
1197
  type?: string | undefined;
1194
1198
  isRequired?: boolean | undefined;
1195
1199
  isReadonly?: boolean | undefined;
1196
1200
  isHidden?: boolean | undefined;
1197
1201
  defaultValue?: unknown;
1198
1202
  placeholder?: string | undefined;
1203
+ options?: {
1204
+ label: string;
1205
+ metadata?: Record<string, unknown> | undefined;
1206
+ value?: unknown;
1207
+ }[] | undefined;
1199
1208
  validationRules?: {
1200
1209
  type: string;
1201
1210
  message: string;
@@ -1205,6 +1214,7 @@ declare const updateFormVariableSchema: z.ZodObject<{
1205
1214
  dataSourceId?: string | undefined;
1206
1215
  dataSourceDependencies?: Record<string, string> | undefined;
1207
1216
  style?: Record<string, unknown> | undefined;
1217
+ templateOverrides?: Record<string, unknown> | undefined;
1208
1218
  templateId?: string | undefined;
1209
1219
  }>;
1210
1220
  declare const createSubmissionSchema: z.ZodObject<{