@msbci/form-server 1.3.3 → 1.3.5

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.ts CHANGED
@@ -192,21 +192,23 @@ 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;
199
+ startWithNewLine: boolean | null;
200
+ colSpan: number | null;
203
201
  defaultValue: string | null;
204
202
  placeholder: string | null;
203
+ options: string | null;
205
204
  validationRules: string | null;
206
205
  expression: string | null;
207
206
  dataSourceId: string | null;
208
207
  dataSourceDependencies: string | null;
209
208
  style: string | null;
209
+ templateOverrides: string | null;
210
+ pageId: string | null;
211
+ rosterId: string | null;
210
212
  templateId: string | null;
211
213
  }[];
212
214
  rosters: ({
@@ -220,21 +222,23 @@ declare class FormService {
220
222
  updatedAt: Date;
221
223
  order: number;
222
224
  conditions: string | null;
223
- options: string | null;
224
- pageId: string | null;
225
- templateOverrides: string | null;
226
225
  type: string;
227
- rosterId: string | null;
228
226
  isRequired: boolean;
229
227
  isReadonly: boolean;
230
228
  isHidden: boolean;
229
+ startWithNewLine: boolean | null;
230
+ colSpan: number | null;
231
231
  defaultValue: string | null;
232
232
  placeholder: string | null;
233
+ options: string | null;
233
234
  validationRules: string | null;
234
235
  expression: string | null;
235
236
  dataSourceId: string | null;
236
237
  dataSourceDependencies: string | null;
237
238
  style: string | null;
239
+ templateOverrides: string | null;
240
+ pageId: string | null;
241
+ rosterId: string | null;
238
242
  templateId: string | null;
239
243
  }[];
240
244
  } & {
@@ -246,10 +250,10 @@ declare class FormService {
246
250
  updatedAt: Date;
247
251
  order: number;
248
252
  conditions: string | null;
249
- rosterType: string;
250
- pilotVariableCode: string | null;
251
253
  options: string | null;
252
254
  pageId: string;
255
+ rosterType: string;
256
+ pilotVariableCode: string | null;
253
257
  })[];
254
258
  } & {
255
259
  id: string;
@@ -292,6 +296,7 @@ declare class FormService {
292
296
  formTypeId?: string;
293
297
  scopeIds?: string[];
294
298
  metadata?: Record<string, unknown>;
299
+ pages?: any[];
295
300
  }, ctx?: IRequestContext): Promise<{
296
301
  id: string;
297
302
  code: string;
@@ -316,6 +321,7 @@ declare class FormService {
316
321
  formTypeId: string;
317
322
  scopeIds: string[];
318
323
  metadata: Record<string, unknown>;
324
+ pages: any[];
319
325
  }>, ctx?: IRequestContext): Promise<({
320
326
  scopes: {
321
327
  order: number;
@@ -337,6 +343,8 @@ declare class FormService {
337
343
  createdBy: string | null;
338
344
  updatedBy: string | null;
339
345
  }) | null>;
346
+ /** Persist a page tree (pages -> variables + rosters -> variables) for a form. */
347
+ private persistPages;
340
348
  /**
341
349
  * Load a form by id and return it as a fully-resolved `IFormDefinition`
342
350
  * (templates applied — Option B). Used by `GET /forms/:id/resolved` and
@@ -447,10 +455,10 @@ declare class FormService {
447
455
  updatedAt: Date;
448
456
  order: number;
449
457
  conditions: string | null;
450
- rosterType: string;
451
- pilotVariableCode: string | null;
452
458
  options: string | null;
453
459
  pageId: string;
460
+ rosterType: string;
461
+ pilotVariableCode: string | null;
454
462
  }>;
455
463
  updateFormRoster(id: string, data: Partial<{
456
464
  code: string;
@@ -470,10 +478,10 @@ declare class FormService {
470
478
  updatedAt: Date;
471
479
  order: number;
472
480
  conditions: string | null;
473
- rosterType: string;
474
- pilotVariableCode: string | null;
475
481
  options: string | null;
476
482
  pageId: string;
483
+ rosterType: string;
484
+ pilotVariableCode: string | null;
477
485
  }>;
478
486
  deleteFormRoster(id: string): Promise<{
479
487
  id: string;
@@ -484,10 +492,10 @@ declare class FormService {
484
492
  updatedAt: Date;
485
493
  order: number;
486
494
  conditions: string | null;
487
- rosterType: string;
488
- pilotVariableCode: string | null;
489
495
  options: string | null;
490
496
  pageId: string;
497
+ rosterType: string;
498
+ pilotVariableCode: string | null;
491
499
  }>;
492
500
  createFormVariable(data: {
493
501
  code: string;
@@ -499,6 +507,8 @@ declare class FormService {
499
507
  isRequired?: boolean;
500
508
  isReadonly?: boolean;
501
509
  isHidden?: boolean;
510
+ startWithNewLine?: boolean;
511
+ colSpan?: number;
502
512
  defaultValue?: unknown;
503
513
  placeholder?: string;
504
514
  description?: string;
@@ -522,21 +532,23 @@ declare class FormService {
522
532
  updatedAt: Date;
523
533
  order: number;
524
534
  conditions: string | null;
525
- options: string | null;
526
- pageId: string | null;
527
- templateOverrides: string | null;
528
535
  type: string;
529
- rosterId: string | null;
530
536
  isRequired: boolean;
531
537
  isReadonly: boolean;
532
538
  isHidden: boolean;
539
+ startWithNewLine: boolean | null;
540
+ colSpan: number | null;
533
541
  defaultValue: string | null;
534
542
  placeholder: string | null;
543
+ options: string | null;
535
544
  validationRules: string | null;
536
545
  expression: string | null;
537
546
  dataSourceId: string | null;
538
547
  dataSourceDependencies: string | null;
539
548
  style: string | null;
549
+ templateOverrides: string | null;
550
+ pageId: string | null;
551
+ rosterId: string | null;
540
552
  templateId: string | null;
541
553
  }>;
542
554
  updateFormVariable(id: string, data: Partial<{
@@ -547,6 +559,8 @@ declare class FormService {
547
559
  isRequired: boolean;
548
560
  isReadonly: boolean;
549
561
  isHidden: boolean;
562
+ startWithNewLine: boolean;
563
+ colSpan: number;
550
564
  defaultValue: unknown;
551
565
  placeholder: string;
552
566
  description: string;
@@ -570,21 +584,23 @@ declare class FormService {
570
584
  updatedAt: Date;
571
585
  order: number;
572
586
  conditions: string | null;
573
- options: string | null;
574
- pageId: string | null;
575
- templateOverrides: string | null;
576
587
  type: string;
577
- rosterId: string | null;
578
588
  isRequired: boolean;
579
589
  isReadonly: boolean;
580
590
  isHidden: boolean;
591
+ startWithNewLine: boolean | null;
592
+ colSpan: number | null;
581
593
  defaultValue: string | null;
582
594
  placeholder: string | null;
595
+ options: string | null;
583
596
  validationRules: string | null;
584
597
  expression: string | null;
585
598
  dataSourceId: string | null;
586
599
  dataSourceDependencies: string | null;
587
600
  style: string | null;
601
+ templateOverrides: string | null;
602
+ pageId: string | null;
603
+ rosterId: string | null;
588
604
  templateId: string | null;
589
605
  }>;
590
606
  deleteFormVariable(id: string): Promise<{
@@ -597,21 +613,23 @@ declare class FormService {
597
613
  updatedAt: Date;
598
614
  order: number;
599
615
  conditions: string | null;
600
- options: string | null;
601
- pageId: string | null;
602
- templateOverrides: string | null;
603
616
  type: string;
604
- rosterId: string | null;
605
617
  isRequired: boolean;
606
618
  isReadonly: boolean;
607
619
  isHidden: boolean;
620
+ startWithNewLine: boolean | null;
621
+ colSpan: number | null;
608
622
  defaultValue: string | null;
609
623
  placeholder: string | null;
624
+ options: string | null;
610
625
  validationRules: string | null;
611
626
  expression: string | null;
612
627
  dataSourceId: string | null;
613
628
  dataSourceDependencies: string | null;
614
629
  style: string | null;
630
+ templateOverrides: string | null;
631
+ pageId: string | null;
632
+ rosterId: string | null;
615
633
  templateId: string | null;
616
634
  }>;
617
635
  getSubmissions(params: {
@@ -783,6 +801,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
783
801
  formTypeId: z.ZodOptional<z.ZodString>;
784
802
  scopeIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
785
803
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
804
+ pages: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
786
805
  }, "strip", z.ZodTypeAny, {
787
806
  code: string;
788
807
  name: string;
@@ -792,6 +811,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
792
811
  metadata?: Record<string, unknown> | undefined;
793
812
  tenantId?: string | undefined;
794
813
  formTypeId?: string | undefined;
814
+ pages?: unknown[] | undefined;
795
815
  scopeIds?: string[] | undefined;
796
816
  }, {
797
817
  code: string;
@@ -802,6 +822,7 @@ declare const createFormDefinitionSchema: z.ZodObject<{
802
822
  version?: string | undefined;
803
823
  isPublished?: boolean | undefined;
804
824
  formTypeId?: string | undefined;
825
+ pages?: unknown[] | undefined;
805
826
  scopeIds?: string[] | undefined;
806
827
  }>;
807
828
  declare const updateFormDefinitionSchema: z.ZodObject<{
@@ -814,6 +835,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
814
835
  formTypeId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
815
836
  scopeIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
816
837
  metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
838
+ pages: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>>;
817
839
  }, "strip", z.ZodTypeAny, {
818
840
  code?: string | undefined;
819
841
  name?: string | undefined;
@@ -823,6 +845,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
823
845
  version?: string | undefined;
824
846
  isPublished?: boolean | undefined;
825
847
  formTypeId?: string | undefined;
848
+ pages?: unknown[] | undefined;
826
849
  scopeIds?: string[] | undefined;
827
850
  }, {
828
851
  code?: string | undefined;
@@ -833,6 +856,7 @@ declare const updateFormDefinitionSchema: z.ZodObject<{
833
856
  version?: string | undefined;
834
857
  isPublished?: boolean | undefined;
835
858
  formTypeId?: string | undefined;
859
+ pages?: unknown[] | undefined;
836
860
  scopeIds?: string[] | undefined;
837
861
  }>;
838
862
  declare const createFormPageSchema: z.ZodObject<{
@@ -931,12 +955,12 @@ declare const createFormRosterSchema: z.ZodObject<{
931
955
  rosterType: "check" | "list" | "collection" | "collection_extend";
932
956
  metadata?: Record<string, unknown> | undefined;
933
957
  conditions?: unknown[] | undefined;
934
- pilotVariableCode?: string | undefined;
935
958
  options?: {
936
959
  label: string;
937
960
  metadata?: Record<string, unknown> | undefined;
938
961
  value?: unknown;
939
962
  }[] | undefined;
963
+ pilotVariableCode?: string | undefined;
940
964
  }, {
941
965
  code: string;
942
966
  name: string;
@@ -944,12 +968,12 @@ declare const createFormRosterSchema: z.ZodObject<{
944
968
  rosterType: "check" | "list" | "collection" | "collection_extend";
945
969
  metadata?: Record<string, unknown> | undefined;
946
970
  conditions?: unknown[] | undefined;
947
- pilotVariableCode?: string | undefined;
948
971
  options?: {
949
972
  label: string;
950
973
  metadata?: Record<string, unknown> | undefined;
951
974
  value?: unknown;
952
975
  }[] | undefined;
976
+ pilotVariableCode?: string | undefined;
953
977
  }>;
954
978
  declare const updateFormRosterSchema: z.ZodObject<{
955
979
  code: z.ZodOptional<z.ZodString>;
@@ -978,26 +1002,26 @@ declare const updateFormRosterSchema: z.ZodObject<{
978
1002
  metadata?: Record<string, unknown> | undefined;
979
1003
  order?: number | undefined;
980
1004
  conditions?: unknown[] | undefined;
981
- rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
982
- pilotVariableCode?: string | undefined;
983
1005
  options?: {
984
1006
  label: string;
985
1007
  metadata?: Record<string, unknown> | undefined;
986
1008
  value?: unknown;
987
1009
  }[] | undefined;
1010
+ rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
1011
+ pilotVariableCode?: string | undefined;
988
1012
  }, {
989
1013
  code?: string | undefined;
990
1014
  name?: string | undefined;
991
1015
  metadata?: Record<string, unknown> | undefined;
992
1016
  order?: number | undefined;
993
1017
  conditions?: unknown[] | undefined;
994
- rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
995
- pilotVariableCode?: string | undefined;
996
1018
  options?: {
997
1019
  label: string;
998
1020
  metadata?: Record<string, unknown> | undefined;
999
1021
  value?: unknown;
1000
1022
  }[] | undefined;
1023
+ rosterType?: "check" | "list" | "collection" | "collection_extend" | undefined;
1024
+ pilotVariableCode?: string | undefined;
1001
1025
  }>;
1002
1026
  declare const createFormVariableSchema: z.ZodObject<{
1003
1027
  code: z.ZodString;
@@ -1007,6 +1031,8 @@ declare const createFormVariableSchema: z.ZodObject<{
1007
1031
  isRequired: z.ZodDefault<z.ZodBoolean>;
1008
1032
  isReadonly: z.ZodDefault<z.ZodBoolean>;
1009
1033
  isHidden: z.ZodDefault<z.ZodBoolean>;
1034
+ startWithNewLine: z.ZodOptional<z.ZodBoolean>;
1035
+ colSpan: z.ZodOptional<z.ZodNumber>;
1010
1036
  defaultValue: z.ZodOptional<z.ZodUnknown>;
1011
1037
  placeholder: z.ZodOptional<z.ZodString>;
1012
1038
  description: z.ZodOptional<z.ZodString>;
@@ -1055,14 +1081,15 @@ declare const createFormVariableSchema: z.ZodObject<{
1055
1081
  description?: string | undefined;
1056
1082
  metadata?: Record<string, unknown> | undefined;
1057
1083
  conditions?: unknown[] | undefined;
1084
+ startWithNewLine?: boolean | undefined;
1085
+ colSpan?: number | undefined;
1086
+ defaultValue?: unknown;
1087
+ placeholder?: string | undefined;
1058
1088
  options?: {
1059
1089
  label: string;
1060
1090
  metadata?: Record<string, unknown> | undefined;
1061
1091
  value?: unknown;
1062
1092
  }[] | undefined;
1063
- templateOverrides?: Record<string, unknown> | undefined;
1064
- defaultValue?: unknown;
1065
- placeholder?: string | undefined;
1066
1093
  validationRules?: {
1067
1094
  type: string;
1068
1095
  message: string;
@@ -1072,6 +1099,7 @@ declare const createFormVariableSchema: z.ZodObject<{
1072
1099
  dataSourceId?: string | undefined;
1073
1100
  dataSourceDependencies?: Record<string, string> | undefined;
1074
1101
  style?: Record<string, unknown> | undefined;
1102
+ templateOverrides?: Record<string, unknown> | undefined;
1075
1103
  templateId?: string | undefined;
1076
1104
  }, {
1077
1105
  code: string;
@@ -1081,17 +1109,18 @@ declare const createFormVariableSchema: z.ZodObject<{
1081
1109
  description?: string | undefined;
1082
1110
  metadata?: Record<string, unknown> | undefined;
1083
1111
  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
1112
  isRequired?: boolean | undefined;
1091
1113
  isReadonly?: boolean | undefined;
1092
1114
  isHidden?: boolean | undefined;
1115
+ startWithNewLine?: boolean | undefined;
1116
+ colSpan?: number | undefined;
1093
1117
  defaultValue?: unknown;
1094
1118
  placeholder?: string | undefined;
1119
+ options?: {
1120
+ label: string;
1121
+ metadata?: Record<string, unknown> | undefined;
1122
+ value?: unknown;
1123
+ }[] | undefined;
1095
1124
  validationRules?: {
1096
1125
  type: string;
1097
1126
  message: string;
@@ -1101,6 +1130,7 @@ declare const createFormVariableSchema: z.ZodObject<{
1101
1130
  dataSourceId?: string | undefined;
1102
1131
  dataSourceDependencies?: Record<string, string> | undefined;
1103
1132
  style?: Record<string, unknown> | undefined;
1133
+ templateOverrides?: Record<string, unknown> | undefined;
1104
1134
  templateId?: string | undefined;
1105
1135
  }>;
1106
1136
  declare const updateFormVariableSchema: z.ZodObject<{
@@ -1111,6 +1141,8 @@ declare const updateFormVariableSchema: z.ZodObject<{
1111
1141
  isRequired: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1112
1142
  isReadonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1113
1143
  isHidden: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1144
+ startWithNewLine: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1145
+ colSpan: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1114
1146
  defaultValue: z.ZodOptional<z.ZodOptional<z.ZodUnknown>>;
1115
1147
  placeholder: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1116
1148
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -1155,18 +1187,19 @@ declare const updateFormVariableSchema: z.ZodObject<{
1155
1187
  metadata?: Record<string, unknown> | undefined;
1156
1188
  order?: number | undefined;
1157
1189
  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
1190
  type?: string | undefined;
1165
1191
  isRequired?: boolean | undefined;
1166
1192
  isReadonly?: boolean | undefined;
1167
1193
  isHidden?: boolean | undefined;
1194
+ startWithNewLine?: boolean | undefined;
1195
+ colSpan?: number | undefined;
1168
1196
  defaultValue?: unknown;
1169
1197
  placeholder?: string | undefined;
1198
+ options?: {
1199
+ label: string;
1200
+ metadata?: Record<string, unknown> | undefined;
1201
+ value?: unknown;
1202
+ }[] | undefined;
1170
1203
  validationRules?: {
1171
1204
  type: string;
1172
1205
  message: string;
@@ -1176,6 +1209,7 @@ declare const updateFormVariableSchema: z.ZodObject<{
1176
1209
  dataSourceId?: string | undefined;
1177
1210
  dataSourceDependencies?: Record<string, string> | undefined;
1178
1211
  style?: Record<string, unknown> | undefined;
1212
+ templateOverrides?: Record<string, unknown> | undefined;
1179
1213
  templateId?: string | undefined;
1180
1214
  }, {
1181
1215
  code?: string | undefined;
@@ -1184,18 +1218,19 @@ declare const updateFormVariableSchema: z.ZodObject<{
1184
1218
  metadata?: Record<string, unknown> | undefined;
1185
1219
  order?: number | undefined;
1186
1220
  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
1221
  type?: string | undefined;
1194
1222
  isRequired?: boolean | undefined;
1195
1223
  isReadonly?: boolean | undefined;
1196
1224
  isHidden?: boolean | undefined;
1225
+ startWithNewLine?: boolean | undefined;
1226
+ colSpan?: number | undefined;
1197
1227
  defaultValue?: unknown;
1198
1228
  placeholder?: string | undefined;
1229
+ options?: {
1230
+ label: string;
1231
+ metadata?: Record<string, unknown> | undefined;
1232
+ value?: unknown;
1233
+ }[] | undefined;
1199
1234
  validationRules?: {
1200
1235
  type: string;
1201
1236
  message: string;
@@ -1205,6 +1240,7 @@ declare const updateFormVariableSchema: z.ZodObject<{
1205
1240
  dataSourceId?: string | undefined;
1206
1241
  dataSourceDependencies?: Record<string, string> | undefined;
1207
1242
  style?: Record<string, unknown> | undefined;
1243
+ templateOverrides?: Record<string, unknown> | undefined;
1208
1244
  templateId?: string | undefined;
1209
1245
  }>;
1210
1246
  declare const createSubmissionSchema: z.ZodObject<{