placementt-core 1.400.988 → 1.400.989

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.
@@ -11,6 +11,302 @@ import { z } from "zod";
11
11
  * equals the sum of the group key counts.
12
12
  */
13
13
  export declare const allCallables: {
14
+ "surveys-createSurveyCycle": {
15
+ request: z.ZodObject<{
16
+ oId: z.ZodString;
17
+ kind: z.ZodEnum<[string, ...string[]]>;
18
+ yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
19
+ scheduledSendDate: z.ZodString;
20
+ closeAfterDays: z.ZodOptional<z.ZodNumber>;
21
+ emailTemplateId: z.ZodOptional<z.ZodString>;
22
+ students: z.ZodOptional<z.ZodString>;
23
+ title: z.ZodOptional<z.ZodString>;
24
+ description: z.ZodOptional<z.ZodString>;
25
+ raters: z.ZodOptional<z.ZodObject<{
26
+ students: z.ZodOptional<z.ZodBoolean>;
27
+ parents: z.ZodOptional<z.ZodBoolean>;
28
+ employers: z.ZodOptional<z.ZodBoolean>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ students?: boolean | undefined;
31
+ parents?: boolean | undefined;
32
+ employers?: boolean | undefined;
33
+ }, {
34
+ students?: boolean | undefined;
35
+ parents?: boolean | undefined;
36
+ employers?: boolean | undefined;
37
+ }>>;
38
+ groupId: z.ZodOptional<z.ZodString>;
39
+ threadKey: z.ZodOptional<z.ZodString>;
40
+ autoSend: z.ZodOptional<z.ZodBoolean>;
41
+ draft: z.ZodOptional<z.ZodBoolean>;
42
+ resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ oId: string;
45
+ kind: string;
46
+ scheduledSendDate: string;
47
+ title?: string | undefined;
48
+ description?: string | undefined;
49
+ yearGroups?: number[] | undefined;
50
+ students?: string | undefined;
51
+ draft?: boolean | undefined;
52
+ closeAfterDays?: number | undefined;
53
+ emailTemplateId?: string | undefined;
54
+ raters?: {
55
+ students?: boolean | undefined;
56
+ parents?: boolean | undefined;
57
+ employers?: boolean | undefined;
58
+ } | undefined;
59
+ groupId?: string | undefined;
60
+ threadKey?: string | undefined;
61
+ autoSend?: boolean | undefined;
62
+ resolveRecipientsAtSend?: boolean | undefined;
63
+ }, {
64
+ oId: string;
65
+ kind: string;
66
+ scheduledSendDate: string;
67
+ title?: string | undefined;
68
+ description?: string | undefined;
69
+ yearGroups?: number[] | undefined;
70
+ students?: string | undefined;
71
+ draft?: boolean | undefined;
72
+ closeAfterDays?: number | undefined;
73
+ emailTemplateId?: string | undefined;
74
+ raters?: {
75
+ students?: boolean | undefined;
76
+ parents?: boolean | undefined;
77
+ employers?: boolean | undefined;
78
+ } | undefined;
79
+ groupId?: string | undefined;
80
+ threadKey?: string | undefined;
81
+ autoSend?: boolean | undefined;
82
+ resolveRecipientsAtSend?: boolean | undefined;
83
+ }>;
84
+ response: z.ZodObject<{
85
+ created: z.ZodArray<z.ZodObject<{
86
+ cycleId: z.ZodString;
87
+ yearGroup: z.ZodOptional<z.ZodNumber>;
88
+ invited: z.ZodNumber;
89
+ }, "strip", z.ZodTypeAny, {
90
+ invited: number;
91
+ cycleId: string;
92
+ yearGroup?: number | undefined;
93
+ }, {
94
+ invited: number;
95
+ cycleId: string;
96
+ yearGroup?: number | undefined;
97
+ }>, "many">;
98
+ skippedEmpty: z.ZodArray<z.ZodNumber, "many">;
99
+ skippedNoEmail: z.ZodNumber;
100
+ academicYear: z.ZodString;
101
+ }, "strip", z.ZodTypeAny, {
102
+ created: {
103
+ invited: number;
104
+ cycleId: string;
105
+ yearGroup?: number | undefined;
106
+ }[];
107
+ academicYear: string;
108
+ skippedEmpty: number[];
109
+ skippedNoEmail: number;
110
+ }, {
111
+ created: {
112
+ invited: number;
113
+ cycleId: string;
114
+ yearGroup?: number | undefined;
115
+ }[];
116
+ academicYear: string;
117
+ skippedEmpty: number[];
118
+ skippedNoEmail: number;
119
+ }>;
120
+ };
121
+ "surveys-setSurveyCycleRecipients": {
122
+ request: z.ZodObject<{
123
+ cycleId: z.ZodString;
124
+ students: z.ZodString;
125
+ scheduledSendDate: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ students: string;
128
+ cycleId: string;
129
+ scheduledSendDate?: string | undefined;
130
+ }, {
131
+ students: string;
132
+ cycleId: string;
133
+ scheduledSendDate?: string | undefined;
134
+ }>;
135
+ response: z.ZodObject<{
136
+ cycleId: z.ZodString;
137
+ yearGroup: z.ZodOptional<z.ZodNumber>;
138
+ invited: z.ZodNumber;
139
+ skippedNoEmail: z.ZodOptional<z.ZodNumber>;
140
+ alreadyScheduled: z.ZodOptional<z.ZodBoolean>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ invited: number;
143
+ cycleId: string;
144
+ yearGroup?: number | undefined;
145
+ skippedNoEmail?: number | undefined;
146
+ alreadyScheduled?: boolean | undefined;
147
+ }, {
148
+ invited: number;
149
+ cycleId: string;
150
+ yearGroup?: number | undefined;
151
+ skippedNoEmail?: number | undefined;
152
+ alreadyScheduled?: boolean | undefined;
153
+ }>;
154
+ };
155
+ "surveys-sendSurveyCycleNow": {
156
+ request: z.ZodObject<{
157
+ cycleId: z.ZodString;
158
+ }, "strip", z.ZodTypeAny, {
159
+ cycleId: string;
160
+ }, {
161
+ cycleId: string;
162
+ }>;
163
+ response: z.ZodObject<{
164
+ sent: z.ZodNumber;
165
+ }, "strip", z.ZodTypeAny, {
166
+ sent: number;
167
+ }, {
168
+ sent: number;
169
+ }>;
170
+ };
171
+ "surveys-sendSurveyReminders": {
172
+ request: z.ZodObject<{
173
+ cycleId: z.ZodString;
174
+ }, "strip", z.ZodTypeAny, {
175
+ cycleId: string;
176
+ }, {
177
+ cycleId: string;
178
+ }>;
179
+ response: z.ZodObject<{
180
+ sent: z.ZodNumber;
181
+ }, "strip", z.ZodTypeAny, {
182
+ sent: number;
183
+ }, {
184
+ sent: number;
185
+ }>;
186
+ };
187
+ "surveys-setSurveyAutoSend": {
188
+ request: z.ZodObject<{
189
+ cycleId: z.ZodString;
190
+ autoSend: z.ZodBoolean;
191
+ }, "strip", z.ZodTypeAny, {
192
+ cycleId: string;
193
+ autoSend: boolean;
194
+ }, {
195
+ cycleId: string;
196
+ autoSend: boolean;
197
+ }>;
198
+ response: z.ZodObject<{
199
+ cycleId: z.ZodString;
200
+ autoSend: z.ZodBoolean;
201
+ }, "strip", z.ZodTypeAny, {
202
+ cycleId: string;
203
+ autoSend: boolean;
204
+ }, {
205
+ cycleId: string;
206
+ autoSend: boolean;
207
+ }>;
208
+ };
209
+ "surveys-resendSurveyInvite": {
210
+ request: z.ZodObject<{
211
+ requestId: z.ZodString;
212
+ newEmail: z.ZodOptional<z.ZodString>;
213
+ audience: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
214
+ }, "strip", z.ZodTypeAny, {
215
+ requestId: string;
216
+ newEmail?: string | undefined;
217
+ audience?: "parent" | "student" | undefined;
218
+ }, {
219
+ requestId: string;
220
+ newEmail?: string | undefined;
221
+ audience?: "parent" | "student" | undefined;
222
+ }>;
223
+ response: z.ZodObject<{
224
+ success: z.ZodBoolean;
225
+ userEmailMismatch: z.ZodBoolean;
226
+ }, "strip", z.ZodTypeAny, {
227
+ success: boolean;
228
+ userEmailMismatch: boolean;
229
+ }, {
230
+ success: boolean;
231
+ userEmailMismatch: boolean;
232
+ }>;
233
+ };
234
+ "surveys-deleteSurveyCycle": {
235
+ request: z.ZodObject<{
236
+ cycleId: z.ZodString;
237
+ jobId: z.ZodOptional<z.ZodString>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ cycleId: string;
240
+ jobId?: string | undefined;
241
+ }, {
242
+ cycleId: string;
243
+ jobId?: string | undefined;
244
+ }>;
245
+ response: z.ZodObject<{
246
+ deleted: z.ZodNumber;
247
+ }, "strip", z.ZodTypeAny, {
248
+ deleted: number;
249
+ }, {
250
+ deleted: number;
251
+ }>;
252
+ };
253
+ "surveys-getMySurveyRequest": {
254
+ request: z.ZodObject<{
255
+ requestId: z.ZodString;
256
+ }, "strip", z.ZodTypeAny, {
257
+ requestId: string;
258
+ }, {
259
+ requestId: string;
260
+ }>;
261
+ response: z.ZodAny;
262
+ };
263
+ "surveys-getPublicSurveyRequest": {
264
+ request: z.ZodObject<{
265
+ requestId: z.ZodString;
266
+ token: z.ZodString;
267
+ role: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
268
+ }, "strip", z.ZodTypeAny, {
269
+ requestId: string;
270
+ token: string;
271
+ role?: "parent" | "student" | undefined;
272
+ }, {
273
+ requestId: string;
274
+ token: string;
275
+ role?: "parent" | "student" | undefined;
276
+ }>;
277
+ response: z.ZodAny;
278
+ };
279
+ "surveys-submitSurveyResponse": {
280
+ request: z.ZodObject<{
281
+ requestId: z.ZodString;
282
+ response: z.ZodOptional<z.ZodUnknown>;
283
+ submittedBy: z.ZodOptional<z.ZodEnum<["student", "parent", "employer", "staff", "trustedContact"]>>;
284
+ token: z.ZodOptional<z.ZodString>;
285
+ rater: z.ZodOptional<z.ZodEnum<["students", "parents", "employers", "trustedContact"]>>;
286
+ noChange: z.ZodOptional<z.ZodBoolean>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ requestId: string;
289
+ response?: unknown;
290
+ token?: string | undefined;
291
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
292
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
293
+ noChange?: boolean | undefined;
294
+ }, {
295
+ requestId: string;
296
+ response?: unknown;
297
+ token?: string | undefined;
298
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
299
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
300
+ noChange?: boolean | undefined;
301
+ }>;
302
+ response: z.ZodObject<{
303
+ success: z.ZodBoolean;
304
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
305
+ success: z.ZodBoolean;
306
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
307
+ success: z.ZodBoolean;
308
+ }, z.ZodTypeAny, "passthrough">>;
309
+ };
14
310
  "events-searchSchool": {
15
311
  request: z.ZodObject<{
16
312
  oId: z.ZodString;
@@ -201,4 +497,302 @@ export declare const callableGroups: {
201
497
  }>, "many">;
202
498
  };
203
499
  };
500
+ surveyCallables: {
501
+ "surveys-createSurveyCycle": {
502
+ request: z.ZodObject<{
503
+ oId: z.ZodString;
504
+ kind: z.ZodEnum<[string, ...string[]]>;
505
+ yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
506
+ scheduledSendDate: z.ZodString;
507
+ closeAfterDays: z.ZodOptional<z.ZodNumber>;
508
+ emailTemplateId: z.ZodOptional<z.ZodString>;
509
+ students: z.ZodOptional<z.ZodString>;
510
+ title: z.ZodOptional<z.ZodString>;
511
+ description: z.ZodOptional<z.ZodString>;
512
+ raters: z.ZodOptional<z.ZodObject<{
513
+ students: z.ZodOptional<z.ZodBoolean>;
514
+ parents: z.ZodOptional<z.ZodBoolean>;
515
+ employers: z.ZodOptional<z.ZodBoolean>;
516
+ }, "strip", z.ZodTypeAny, {
517
+ students?: boolean | undefined;
518
+ parents?: boolean | undefined;
519
+ employers?: boolean | undefined;
520
+ }, {
521
+ students?: boolean | undefined;
522
+ parents?: boolean | undefined;
523
+ employers?: boolean | undefined;
524
+ }>>;
525
+ groupId: z.ZodOptional<z.ZodString>;
526
+ threadKey: z.ZodOptional<z.ZodString>;
527
+ autoSend: z.ZodOptional<z.ZodBoolean>;
528
+ draft: z.ZodOptional<z.ZodBoolean>;
529
+ resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
530
+ }, "strip", z.ZodTypeAny, {
531
+ oId: string;
532
+ kind: string;
533
+ scheduledSendDate: string;
534
+ title?: string | undefined;
535
+ description?: string | undefined;
536
+ yearGroups?: number[] | undefined;
537
+ students?: string | undefined;
538
+ draft?: boolean | undefined;
539
+ closeAfterDays?: number | undefined;
540
+ emailTemplateId?: string | undefined;
541
+ raters?: {
542
+ students?: boolean | undefined;
543
+ parents?: boolean | undefined;
544
+ employers?: boolean | undefined;
545
+ } | undefined;
546
+ groupId?: string | undefined;
547
+ threadKey?: string | undefined;
548
+ autoSend?: boolean | undefined;
549
+ resolveRecipientsAtSend?: boolean | undefined;
550
+ }, {
551
+ oId: string;
552
+ kind: string;
553
+ scheduledSendDate: string;
554
+ title?: string | undefined;
555
+ description?: string | undefined;
556
+ yearGroups?: number[] | undefined;
557
+ students?: string | undefined;
558
+ draft?: boolean | undefined;
559
+ closeAfterDays?: number | undefined;
560
+ emailTemplateId?: string | undefined;
561
+ raters?: {
562
+ students?: boolean | undefined;
563
+ parents?: boolean | undefined;
564
+ employers?: boolean | undefined;
565
+ } | undefined;
566
+ groupId?: string | undefined;
567
+ threadKey?: string | undefined;
568
+ autoSend?: boolean | undefined;
569
+ resolveRecipientsAtSend?: boolean | undefined;
570
+ }>;
571
+ response: z.ZodObject<{
572
+ created: z.ZodArray<z.ZodObject<{
573
+ cycleId: z.ZodString;
574
+ yearGroup: z.ZodOptional<z.ZodNumber>;
575
+ invited: z.ZodNumber;
576
+ }, "strip", z.ZodTypeAny, {
577
+ invited: number;
578
+ cycleId: string;
579
+ yearGroup?: number | undefined;
580
+ }, {
581
+ invited: number;
582
+ cycleId: string;
583
+ yearGroup?: number | undefined;
584
+ }>, "many">;
585
+ skippedEmpty: z.ZodArray<z.ZodNumber, "many">;
586
+ skippedNoEmail: z.ZodNumber;
587
+ academicYear: z.ZodString;
588
+ }, "strip", z.ZodTypeAny, {
589
+ created: {
590
+ invited: number;
591
+ cycleId: string;
592
+ yearGroup?: number | undefined;
593
+ }[];
594
+ academicYear: string;
595
+ skippedEmpty: number[];
596
+ skippedNoEmail: number;
597
+ }, {
598
+ created: {
599
+ invited: number;
600
+ cycleId: string;
601
+ yearGroup?: number | undefined;
602
+ }[];
603
+ academicYear: string;
604
+ skippedEmpty: number[];
605
+ skippedNoEmail: number;
606
+ }>;
607
+ };
608
+ "surveys-setSurveyCycleRecipients": {
609
+ request: z.ZodObject<{
610
+ cycleId: z.ZodString;
611
+ students: z.ZodString;
612
+ scheduledSendDate: z.ZodOptional<z.ZodString>;
613
+ }, "strip", z.ZodTypeAny, {
614
+ students: string;
615
+ cycleId: string;
616
+ scheduledSendDate?: string | undefined;
617
+ }, {
618
+ students: string;
619
+ cycleId: string;
620
+ scheduledSendDate?: string | undefined;
621
+ }>;
622
+ response: z.ZodObject<{
623
+ cycleId: z.ZodString;
624
+ yearGroup: z.ZodOptional<z.ZodNumber>;
625
+ invited: z.ZodNumber;
626
+ skippedNoEmail: z.ZodOptional<z.ZodNumber>;
627
+ alreadyScheduled: z.ZodOptional<z.ZodBoolean>;
628
+ }, "strip", z.ZodTypeAny, {
629
+ invited: number;
630
+ cycleId: string;
631
+ yearGroup?: number | undefined;
632
+ skippedNoEmail?: number | undefined;
633
+ alreadyScheduled?: boolean | undefined;
634
+ }, {
635
+ invited: number;
636
+ cycleId: string;
637
+ yearGroup?: number | undefined;
638
+ skippedNoEmail?: number | undefined;
639
+ alreadyScheduled?: boolean | undefined;
640
+ }>;
641
+ };
642
+ "surveys-sendSurveyCycleNow": {
643
+ request: z.ZodObject<{
644
+ cycleId: z.ZodString;
645
+ }, "strip", z.ZodTypeAny, {
646
+ cycleId: string;
647
+ }, {
648
+ cycleId: string;
649
+ }>;
650
+ response: z.ZodObject<{
651
+ sent: z.ZodNumber;
652
+ }, "strip", z.ZodTypeAny, {
653
+ sent: number;
654
+ }, {
655
+ sent: number;
656
+ }>;
657
+ };
658
+ "surveys-sendSurveyReminders": {
659
+ request: z.ZodObject<{
660
+ cycleId: z.ZodString;
661
+ }, "strip", z.ZodTypeAny, {
662
+ cycleId: string;
663
+ }, {
664
+ cycleId: string;
665
+ }>;
666
+ response: z.ZodObject<{
667
+ sent: z.ZodNumber;
668
+ }, "strip", z.ZodTypeAny, {
669
+ sent: number;
670
+ }, {
671
+ sent: number;
672
+ }>;
673
+ };
674
+ "surveys-setSurveyAutoSend": {
675
+ request: z.ZodObject<{
676
+ cycleId: z.ZodString;
677
+ autoSend: z.ZodBoolean;
678
+ }, "strip", z.ZodTypeAny, {
679
+ cycleId: string;
680
+ autoSend: boolean;
681
+ }, {
682
+ cycleId: string;
683
+ autoSend: boolean;
684
+ }>;
685
+ response: z.ZodObject<{
686
+ cycleId: z.ZodString;
687
+ autoSend: z.ZodBoolean;
688
+ }, "strip", z.ZodTypeAny, {
689
+ cycleId: string;
690
+ autoSend: boolean;
691
+ }, {
692
+ cycleId: string;
693
+ autoSend: boolean;
694
+ }>;
695
+ };
696
+ "surveys-resendSurveyInvite": {
697
+ request: z.ZodObject<{
698
+ requestId: z.ZodString;
699
+ newEmail: z.ZodOptional<z.ZodString>;
700
+ audience: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
701
+ }, "strip", z.ZodTypeAny, {
702
+ requestId: string;
703
+ newEmail?: string | undefined;
704
+ audience?: "parent" | "student" | undefined;
705
+ }, {
706
+ requestId: string;
707
+ newEmail?: string | undefined;
708
+ audience?: "parent" | "student" | undefined;
709
+ }>;
710
+ response: z.ZodObject<{
711
+ success: z.ZodBoolean;
712
+ userEmailMismatch: z.ZodBoolean;
713
+ }, "strip", z.ZodTypeAny, {
714
+ success: boolean;
715
+ userEmailMismatch: boolean;
716
+ }, {
717
+ success: boolean;
718
+ userEmailMismatch: boolean;
719
+ }>;
720
+ };
721
+ "surveys-deleteSurveyCycle": {
722
+ request: z.ZodObject<{
723
+ cycleId: z.ZodString;
724
+ jobId: z.ZodOptional<z.ZodString>;
725
+ }, "strip", z.ZodTypeAny, {
726
+ cycleId: string;
727
+ jobId?: string | undefined;
728
+ }, {
729
+ cycleId: string;
730
+ jobId?: string | undefined;
731
+ }>;
732
+ response: z.ZodObject<{
733
+ deleted: z.ZodNumber;
734
+ }, "strip", z.ZodTypeAny, {
735
+ deleted: number;
736
+ }, {
737
+ deleted: number;
738
+ }>;
739
+ };
740
+ "surveys-getMySurveyRequest": {
741
+ request: z.ZodObject<{
742
+ requestId: z.ZodString;
743
+ }, "strip", z.ZodTypeAny, {
744
+ requestId: string;
745
+ }, {
746
+ requestId: string;
747
+ }>;
748
+ response: z.ZodAny;
749
+ };
750
+ "surveys-getPublicSurveyRequest": {
751
+ request: z.ZodObject<{
752
+ requestId: z.ZodString;
753
+ token: z.ZodString;
754
+ role: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
755
+ }, "strip", z.ZodTypeAny, {
756
+ requestId: string;
757
+ token: string;
758
+ role?: "parent" | "student" | undefined;
759
+ }, {
760
+ requestId: string;
761
+ token: string;
762
+ role?: "parent" | "student" | undefined;
763
+ }>;
764
+ response: z.ZodAny;
765
+ };
766
+ "surveys-submitSurveyResponse": {
767
+ request: z.ZodObject<{
768
+ requestId: z.ZodString;
769
+ response: z.ZodOptional<z.ZodUnknown>;
770
+ submittedBy: z.ZodOptional<z.ZodEnum<["student", "parent", "employer", "staff", "trustedContact"]>>;
771
+ token: z.ZodOptional<z.ZodString>;
772
+ rater: z.ZodOptional<z.ZodEnum<["students", "parents", "employers", "trustedContact"]>>;
773
+ noChange: z.ZodOptional<z.ZodBoolean>;
774
+ }, "strip", z.ZodTypeAny, {
775
+ requestId: string;
776
+ response?: unknown;
777
+ token?: string | undefined;
778
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
779
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
780
+ noChange?: boolean | undefined;
781
+ }, {
782
+ requestId: string;
783
+ response?: unknown;
784
+ token?: string | undefined;
785
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
786
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
787
+ noChange?: boolean | undefined;
788
+ }>;
789
+ response: z.ZodObject<{
790
+ success: z.ZodBoolean;
791
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
792
+ success: z.ZodBoolean;
793
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
794
+ success: z.ZodBoolean;
795
+ }, z.ZodTypeAny, "passthrough">>;
796
+ };
797
+ };
204
798
  };
@@ -4,6 +4,7 @@ exports.callableGroups = exports.allCallables = void 0;
4
4
  const aspirations_1 = require("./aspirations");
5
5
  const placement_1 = require("./placement");
6
6
  const events_1 = require("./events");
7
+ const surveys_1 = require("./surveys");
7
8
  /**
8
9
  * The single source of truth for every typed callable. Add a feature group's
9
10
  * spread here and its callables are automatically covered by:
@@ -19,7 +20,8 @@ exports.allCallables = {
19
20
  ...aspirations_1.aspirationCallables,
20
21
  ...placement_1.placementCallables,
21
22
  ...events_1.eventsCallables,
23
+ ...surveys_1.surveyCallables,
22
24
  };
23
25
  /** The per-group maps, exported so tests can assert no key collisions. */
24
- exports.callableGroups = { aspirationCallables: aspirations_1.aspirationCallables, placementCallables: placement_1.placementCallables, eventsCallables: events_1.eventsCallables };
26
+ exports.callableGroups = { aspirationCallables: aspirations_1.aspirationCallables, placementCallables: placement_1.placementCallables, eventsCallables: events_1.eventsCallables, surveyCallables: surveys_1.surveyCallables };
25
27
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA,+CAAkD;AAClD,2CAA+C;AAC/C,qCAAyC;AAEzC;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAG;IACxB,GAAG,iCAAmB;IACtB,GAAG,8BAAkB;IACrB,GAAG,wBAAe;CACG,CAAC;AAiB1B,0EAA0E;AAC7D,QAAA,cAAc,GAAG,EAAC,mBAAmB,EAAnB,iCAAmB,EAAE,kBAAkB,EAAlB,8BAAkB,EAAE,eAAe,EAAf,wBAAe,EAAC,CAAC"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA,+CAAkD;AAClD,2CAA+C;AAC/C,qCAAyC;AACzC,uCAA0C;AAE1C;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAG;IACxB,GAAG,iCAAmB;IACtB,GAAG,8BAAkB;IACrB,GAAG,wBAAe;IAClB,GAAG,yBAAe;CACG,CAAC;AAiB1B,0EAA0E;AAC7D,QAAA,cAAc,GAAG,EAAC,mBAAmB,EAAnB,iCAAmB,EAAE,kBAAkB,EAAlB,8BAAkB,EAAE,eAAe,EAAf,wBAAe,EAAE,eAAe,EAAf,yBAAe,EAAC,CAAC"}
@@ -0,0 +1,304 @@
1
+ import { z } from "zod";
2
+ export declare const surveyCallables: {
3
+ "surveys-createSurveyCycle": {
4
+ request: z.ZodObject<{
5
+ oId: z.ZodString;
6
+ kind: z.ZodEnum<[string, ...string[]]>;
7
+ /** One cycle per year group. Omitted for institute-wide kinds. */
8
+ yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
9
+ scheduledSendDate: z.ZodString;
10
+ closeAfterDays: z.ZodOptional<z.ZodNumber>;
11
+ emailTemplateId: z.ZodOptional<z.ZodString>;
12
+ /** JSON-serialised DataViewerSelectionBackend. */
13
+ students: z.ZodOptional<z.ZodString>;
14
+ title: z.ZodOptional<z.ZodString>;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ raters: z.ZodOptional<z.ZodObject<{
17
+ students: z.ZodOptional<z.ZodBoolean>;
18
+ parents: z.ZodOptional<z.ZodBoolean>;
19
+ employers: z.ZodOptional<z.ZodBoolean>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ students?: boolean | undefined;
22
+ parents?: boolean | undefined;
23
+ employers?: boolean | undefined;
24
+ }, {
25
+ students?: boolean | undefined;
26
+ parents?: boolean | undefined;
27
+ employers?: boolean | undefined;
28
+ }>>;
29
+ groupId: z.ZodOptional<z.ZodString>;
30
+ threadKey: z.ZodOptional<z.ZodString>;
31
+ autoSend: z.ZodOptional<z.ZodBoolean>;
32
+ draft: z.ZodOptional<z.ZodBoolean>;
33
+ resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ oId: string;
36
+ kind: string;
37
+ scheduledSendDate: string;
38
+ title?: string | undefined;
39
+ description?: string | undefined;
40
+ yearGroups?: number[] | undefined;
41
+ students?: string | undefined;
42
+ draft?: boolean | undefined;
43
+ closeAfterDays?: number | undefined;
44
+ emailTemplateId?: string | undefined;
45
+ raters?: {
46
+ students?: boolean | undefined;
47
+ parents?: boolean | undefined;
48
+ employers?: boolean | undefined;
49
+ } | undefined;
50
+ groupId?: string | undefined;
51
+ threadKey?: string | undefined;
52
+ autoSend?: boolean | undefined;
53
+ resolveRecipientsAtSend?: boolean | undefined;
54
+ }, {
55
+ oId: string;
56
+ kind: string;
57
+ scheduledSendDate: string;
58
+ title?: string | undefined;
59
+ description?: string | undefined;
60
+ yearGroups?: number[] | undefined;
61
+ students?: string | undefined;
62
+ draft?: boolean | undefined;
63
+ closeAfterDays?: number | undefined;
64
+ emailTemplateId?: string | undefined;
65
+ raters?: {
66
+ students?: boolean | undefined;
67
+ parents?: boolean | undefined;
68
+ employers?: boolean | undefined;
69
+ } | undefined;
70
+ groupId?: string | undefined;
71
+ threadKey?: string | undefined;
72
+ autoSend?: boolean | undefined;
73
+ resolveRecipientsAtSend?: boolean | undefined;
74
+ }>;
75
+ response: z.ZodObject<{
76
+ created: z.ZodArray<z.ZodObject<{
77
+ cycleId: z.ZodString;
78
+ yearGroup: z.ZodOptional<z.ZodNumber>;
79
+ invited: z.ZodNumber;
80
+ }, "strip", z.ZodTypeAny, {
81
+ invited: number;
82
+ cycleId: string;
83
+ yearGroup?: number | undefined;
84
+ }, {
85
+ invited: number;
86
+ cycleId: string;
87
+ yearGroup?: number | undefined;
88
+ }>, "many">;
89
+ skippedEmpty: z.ZodArray<z.ZodNumber, "many">;
90
+ skippedNoEmail: z.ZodNumber;
91
+ academicYear: z.ZodString;
92
+ }, "strip", z.ZodTypeAny, {
93
+ created: {
94
+ invited: number;
95
+ cycleId: string;
96
+ yearGroup?: number | undefined;
97
+ }[];
98
+ academicYear: string;
99
+ skippedEmpty: number[];
100
+ skippedNoEmail: number;
101
+ }, {
102
+ created: {
103
+ invited: number;
104
+ cycleId: string;
105
+ yearGroup?: number | undefined;
106
+ }[];
107
+ academicYear: string;
108
+ skippedEmpty: number[];
109
+ skippedNoEmail: number;
110
+ }>;
111
+ };
112
+ "surveys-setSurveyCycleRecipients": {
113
+ request: z.ZodObject<{
114
+ cycleId: z.ZodString;
115
+ students: z.ZodString;
116
+ scheduledSendDate: z.ZodOptional<z.ZodString>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ students: string;
119
+ cycleId: string;
120
+ scheduledSendDate?: string | undefined;
121
+ }, {
122
+ students: string;
123
+ cycleId: string;
124
+ scheduledSendDate?: string | undefined;
125
+ }>;
126
+ response: z.ZodObject<{
127
+ cycleId: z.ZodString;
128
+ yearGroup: z.ZodOptional<z.ZodNumber>;
129
+ invited: z.ZodNumber;
130
+ skippedNoEmail: z.ZodOptional<z.ZodNumber>;
131
+ alreadyScheduled: z.ZodOptional<z.ZodBoolean>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ invited: number;
134
+ cycleId: string;
135
+ yearGroup?: number | undefined;
136
+ skippedNoEmail?: number | undefined;
137
+ alreadyScheduled?: boolean | undefined;
138
+ }, {
139
+ invited: number;
140
+ cycleId: string;
141
+ yearGroup?: number | undefined;
142
+ skippedNoEmail?: number | undefined;
143
+ alreadyScheduled?: boolean | undefined;
144
+ }>;
145
+ };
146
+ "surveys-sendSurveyCycleNow": {
147
+ request: z.ZodObject<{
148
+ cycleId: z.ZodString;
149
+ }, "strip", z.ZodTypeAny, {
150
+ cycleId: string;
151
+ }, {
152
+ cycleId: string;
153
+ }>;
154
+ response: z.ZodObject<{
155
+ sent: z.ZodNumber;
156
+ }, "strip", z.ZodTypeAny, {
157
+ sent: number;
158
+ }, {
159
+ sent: number;
160
+ }>;
161
+ };
162
+ "surveys-sendSurveyReminders": {
163
+ request: z.ZodObject<{
164
+ cycleId: z.ZodString;
165
+ }, "strip", z.ZodTypeAny, {
166
+ cycleId: string;
167
+ }, {
168
+ cycleId: string;
169
+ }>;
170
+ response: z.ZodObject<{
171
+ sent: z.ZodNumber;
172
+ }, "strip", z.ZodTypeAny, {
173
+ sent: number;
174
+ }, {
175
+ sent: number;
176
+ }>;
177
+ };
178
+ "surveys-setSurveyAutoSend": {
179
+ request: z.ZodObject<{
180
+ cycleId: z.ZodString;
181
+ autoSend: z.ZodBoolean;
182
+ }, "strip", z.ZodTypeAny, {
183
+ cycleId: string;
184
+ autoSend: boolean;
185
+ }, {
186
+ cycleId: string;
187
+ autoSend: boolean;
188
+ }>;
189
+ response: z.ZodObject<{
190
+ cycleId: z.ZodString;
191
+ autoSend: z.ZodBoolean;
192
+ }, "strip", z.ZodTypeAny, {
193
+ cycleId: string;
194
+ autoSend: boolean;
195
+ }, {
196
+ cycleId: string;
197
+ autoSend: boolean;
198
+ }>;
199
+ };
200
+ "surveys-resendSurveyInvite": {
201
+ request: z.ZodObject<{
202
+ requestId: z.ZodString;
203
+ newEmail: z.ZodOptional<z.ZodString>;
204
+ audience: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ requestId: string;
207
+ newEmail?: string | undefined;
208
+ audience?: "parent" | "student" | undefined;
209
+ }, {
210
+ requestId: string;
211
+ newEmail?: string | undefined;
212
+ audience?: "parent" | "student" | undefined;
213
+ }>;
214
+ response: z.ZodObject<{
215
+ success: z.ZodBoolean;
216
+ /** True when the corrected address no longer matches their account, so
217
+ * the UI can tell staff to fix the MIS rather than silently diverge. */
218
+ userEmailMismatch: z.ZodBoolean;
219
+ }, "strip", z.ZodTypeAny, {
220
+ success: boolean;
221
+ userEmailMismatch: boolean;
222
+ }, {
223
+ success: boolean;
224
+ userEmailMismatch: boolean;
225
+ }>;
226
+ };
227
+ "surveys-deleteSurveyCycle": {
228
+ request: z.ZodObject<{
229
+ cycleId: z.ZodString;
230
+ jobId: z.ZodOptional<z.ZodString>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ cycleId: string;
233
+ jobId?: string | undefined;
234
+ }, {
235
+ cycleId: string;
236
+ jobId?: string | undefined;
237
+ }>;
238
+ response: z.ZodObject<{
239
+ deleted: z.ZodNumber;
240
+ }, "strip", z.ZodTypeAny, {
241
+ deleted: number;
242
+ }, {
243
+ deleted: number;
244
+ }>;
245
+ };
246
+ "surveys-getMySurveyRequest": {
247
+ request: z.ZodObject<{
248
+ requestId: z.ZodString;
249
+ }, "strip", z.ZodTypeAny, {
250
+ requestId: string;
251
+ }, {
252
+ requestId: string;
253
+ }>;
254
+ response: z.ZodAny;
255
+ };
256
+ "surveys-getPublicSurveyRequest": {
257
+ request: z.ZodObject<{
258
+ requestId: z.ZodString;
259
+ token: z.ZodString;
260
+ role: z.ZodOptional<z.ZodEnum<["student", "parent"]>>;
261
+ }, "strip", z.ZodTypeAny, {
262
+ requestId: string;
263
+ token: string;
264
+ role?: "parent" | "student" | undefined;
265
+ }, {
266
+ requestId: string;
267
+ token: string;
268
+ role?: "parent" | "student" | undefined;
269
+ }>;
270
+ response: z.ZodAny;
271
+ };
272
+ "surveys-submitSurveyResponse": {
273
+ request: z.ZodObject<{
274
+ requestId: z.ZodString;
275
+ /** The kind's own payload; narrowed by that kind's handler. */
276
+ response: z.ZodOptional<z.ZodUnknown>;
277
+ submittedBy: z.ZodOptional<z.ZodEnum<["student", "parent", "employer", "staff", "trustedContact"]>>;
278
+ token: z.ZodOptional<z.ZodString>;
279
+ rater: z.ZodOptional<z.ZodEnum<["students", "parents", "employers", "trustedContact"]>>;
280
+ noChange: z.ZodOptional<z.ZodBoolean>;
281
+ }, "strip", z.ZodTypeAny, {
282
+ requestId: string;
283
+ response?: unknown;
284
+ token?: string | undefined;
285
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
286
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
287
+ noChange?: boolean | undefined;
288
+ }, {
289
+ requestId: string;
290
+ response?: unknown;
291
+ token?: string | undefined;
292
+ submittedBy?: "parent" | "trustedContact" | "student" | "employer" | "staff" | undefined;
293
+ rater?: "students" | "parents" | "employers" | "trustedContact" | undefined;
294
+ noChange?: boolean | undefined;
295
+ }>;
296
+ response: z.ZodObject<{
297
+ success: z.ZodBoolean;
298
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
299
+ success: z.ZodBoolean;
300
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
301
+ success: z.ZodBoolean;
302
+ }, z.ZodTypeAny, "passthrough">>;
303
+ };
304
+ };
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.surveyCallables = void 0;
4
+ const zod_1 = require("zod");
5
+ const types_1 = require("../surveys/types");
6
+ /**
7
+ * Contracts for the unified survey engine
8
+ * (`Placementt-Backend/functions/src/surveys.ts`).
9
+ *
10
+ * Without these, `executeCallable("surveys-…")` falls back to an untyped payload, so
11
+ * a mistyped field name fails silently at run time instead of at the keyboard. The
12
+ * hook that drives every staff survey page (`useSurveyAdmin`) calls all of them.
13
+ */
14
+ const surveyKind = zod_1.z.enum(types_1.SURVEY_KINDS_LIST);
15
+ const raters = zod_1.z.object({
16
+ students: zod_1.z.boolean().optional(),
17
+ parents: zod_1.z.boolean().optional(),
18
+ employers: zod_1.z.boolean().optional(),
19
+ }).optional();
20
+ exports.surveyCallables = {
21
+ "surveys-createSurveyCycle": {
22
+ request: zod_1.z.object({
23
+ oId: zod_1.z.string(),
24
+ kind: surveyKind,
25
+ /** One cycle per year group. Omitted for institute-wide kinds. */
26
+ yearGroups: zod_1.z.array(zod_1.z.number()).optional(),
27
+ scheduledSendDate: zod_1.z.string(), // ISO
28
+ closeAfterDays: zod_1.z.number().optional(),
29
+ emailTemplateId: zod_1.z.string().optional(),
30
+ /** JSON-serialised DataViewerSelectionBackend. */
31
+ students: zod_1.z.string().optional(),
32
+ title: zod_1.z.string().optional(),
33
+ description: zod_1.z.string().optional(),
34
+ raters,
35
+ groupId: zod_1.z.string().optional(),
36
+ threadKey: zod_1.z.string().optional(),
37
+ autoSend: zod_1.z.boolean().optional(),
38
+ draft: zod_1.z.boolean().optional(),
39
+ resolveRecipientsAtSend: zod_1.z.boolean().optional(),
40
+ }),
41
+ response: zod_1.z.object({
42
+ created: zod_1.z.array(zod_1.z.object({
43
+ cycleId: zod_1.z.string(),
44
+ yearGroup: zod_1.z.number().optional(),
45
+ invited: zod_1.z.number(),
46
+ })),
47
+ skippedEmpty: zod_1.z.array(zod_1.z.number()),
48
+ skippedNoEmail: zod_1.z.number(),
49
+ academicYear: zod_1.z.string(),
50
+ }),
51
+ },
52
+ "surveys-setSurveyCycleRecipients": {
53
+ request: zod_1.z.object({
54
+ cycleId: zod_1.z.string(),
55
+ students: zod_1.z.string(),
56
+ scheduledSendDate: zod_1.z.string().optional(),
57
+ }),
58
+ response: zod_1.z.object({
59
+ cycleId: zod_1.z.string(),
60
+ yearGroup: zod_1.z.number().optional(),
61
+ invited: zod_1.z.number(),
62
+ skippedNoEmail: zod_1.z.number().optional(),
63
+ alreadyScheduled: zod_1.z.boolean().optional(),
64
+ }),
65
+ },
66
+ "surveys-sendSurveyCycleNow": {
67
+ request: zod_1.z.object({ cycleId: zod_1.z.string() }),
68
+ response: zod_1.z.object({ sent: zod_1.z.number() }),
69
+ },
70
+ "surveys-sendSurveyReminders": {
71
+ request: zod_1.z.object({ cycleId: zod_1.z.string() }),
72
+ response: zod_1.z.object({ sent: zod_1.z.number() }),
73
+ },
74
+ "surveys-setSurveyAutoSend": {
75
+ request: zod_1.z.object({ cycleId: zod_1.z.string(), autoSend: zod_1.z.boolean() }),
76
+ response: zod_1.z.object({ cycleId: zod_1.z.string(), autoSend: zod_1.z.boolean() }),
77
+ },
78
+ "surveys-resendSurveyInvite": {
79
+ request: zod_1.z.object({
80
+ requestId: zod_1.z.string(),
81
+ newEmail: zod_1.z.string().optional(),
82
+ audience: zod_1.z.enum(["student", "parent"]).optional(),
83
+ }),
84
+ response: zod_1.z.object({
85
+ success: zod_1.z.boolean(),
86
+ /** True when the corrected address no longer matches their account, so
87
+ * the UI can tell staff to fix the MIS rather than silently diverge. */
88
+ userEmailMismatch: zod_1.z.boolean(),
89
+ }),
90
+ },
91
+ "surveys-deleteSurveyCycle": {
92
+ request: zod_1.z.object({ cycleId: zod_1.z.string(), jobId: zod_1.z.string().optional() }),
93
+ response: zod_1.z.object({ deleted: zod_1.z.number() }),
94
+ },
95
+ "surveys-getMySurveyRequest": {
96
+ request: zod_1.z.object({ requestId: zod_1.z.string() }),
97
+ // Shape varies by kind (see HYDRATE in surveys.ts), so left open.
98
+ response: zod_1.z.any(),
99
+ },
100
+ "surveys-getPublicSurveyRequest": {
101
+ request: zod_1.z.object({
102
+ requestId: zod_1.z.string(),
103
+ token: zod_1.z.string(),
104
+ role: zod_1.z.enum(["student", "parent"]).optional(),
105
+ }),
106
+ response: zod_1.z.any(),
107
+ },
108
+ "surveys-submitSurveyResponse": {
109
+ request: zod_1.z.object({
110
+ requestId: zod_1.z.string(),
111
+ /** The kind's own payload; narrowed by that kind's handler. */
112
+ response: zod_1.z.unknown().optional(),
113
+ submittedBy: zod_1.z.enum(["student", "parent", "employer", "staff", "trustedContact"]).optional(),
114
+ token: zod_1.z.string().optional(),
115
+ rater: zod_1.z.enum(["students", "parents", "employers", "trustedContact"]).optional(),
116
+ noChange: zod_1.z.boolean().optional(),
117
+ }),
118
+ response: zod_1.z.object({ success: zod_1.z.boolean() }).passthrough(),
119
+ },
120
+ };
121
+ //# sourceMappingURL=surveys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surveys.js","sourceRoot":"","sources":["../../src/callables/surveys.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,4CAAmD;AAEnD;;;;;;;GAOG;AAEH,MAAM,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC,yBAA0C,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;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  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "scripts": {
@@ -3,6 +3,7 @@ import {CallableGroup} from "./types";
3
3
  import {aspirationCallables} from "./aspirations";
4
4
  import {placementCallables} from "./placement";
5
5
  import {eventsCallables} from "./events";
6
+ import {surveyCallables} from "./surveys";
6
7
 
7
8
  /**
8
9
  * The single source of truth for every typed callable. Add a feature group's
@@ -19,6 +20,7 @@ export const allCallables = {
19
20
  ...aspirationCallables,
20
21
  ...placementCallables,
21
22
  ...eventsCallables,
23
+ ...surveyCallables,
22
24
  } satisfies CallableGroup;
23
25
 
24
26
  /** Every registered callable name. */
@@ -37,4 +39,4 @@ export type CallableContracts = {
37
39
  };
38
40
 
39
41
  /** The per-group maps, exported so tests can assert no key collisions. */
40
- export const callableGroups = {aspirationCallables, placementCallables, eventsCallables};
42
+ export const callableGroups = {aspirationCallables, placementCallables, eventsCallables, surveyCallables};
@@ -0,0 +1,122 @@
1
+ import {z} from "zod";
2
+ import {CallableGroup} from "./types";
3
+ import {SURVEY_KINDS_LIST} from "../surveys/types";
4
+
5
+ /**
6
+ * Contracts for the unified survey engine
7
+ * (`Placementt-Backend/functions/src/surveys.ts`).
8
+ *
9
+ * Without these, `executeCallable("surveys-…")` falls back to an untyped payload, so
10
+ * a mistyped field name fails silently at run time instead of at the keyboard. The
11
+ * hook that drives every staff survey page (`useSurveyAdmin`) calls all of them.
12
+ */
13
+
14
+ const surveyKind = z.enum(SURVEY_KINDS_LIST as [string, ...string[]]);
15
+
16
+ const raters = z.object({
17
+ students: z.boolean().optional(),
18
+ parents: z.boolean().optional(),
19
+ employers: z.boolean().optional(),
20
+ }).optional();
21
+
22
+ export const surveyCallables = {
23
+ "surveys-createSurveyCycle": {
24
+ request: z.object({
25
+ oId: z.string(),
26
+ kind: surveyKind,
27
+ /** One cycle per year group. Omitted for institute-wide kinds. */
28
+ yearGroups: z.array(z.number()).optional(),
29
+ scheduledSendDate: z.string(), // ISO
30
+ closeAfterDays: z.number().optional(),
31
+ emailTemplateId: z.string().optional(),
32
+ /** JSON-serialised DataViewerSelectionBackend. */
33
+ students: z.string().optional(),
34
+ title: z.string().optional(),
35
+ description: z.string().optional(),
36
+ raters,
37
+ groupId: z.string().optional(),
38
+ threadKey: z.string().optional(),
39
+ autoSend: z.boolean().optional(),
40
+ draft: z.boolean().optional(),
41
+ resolveRecipientsAtSend: z.boolean().optional(),
42
+ }),
43
+ response: z.object({
44
+ created: z.array(z.object({
45
+ cycleId: z.string(),
46
+ yearGroup: z.number().optional(),
47
+ invited: z.number(),
48
+ })),
49
+ skippedEmpty: z.array(z.number()),
50
+ skippedNoEmail: z.number(),
51
+ academicYear: z.string(),
52
+ }),
53
+ },
54
+ "surveys-setSurveyCycleRecipients": {
55
+ request: z.object({
56
+ cycleId: z.string(),
57
+ students: z.string(),
58
+ scheduledSendDate: z.string().optional(),
59
+ }),
60
+ response: z.object({
61
+ cycleId: z.string(),
62
+ yearGroup: z.number().optional(),
63
+ invited: z.number(),
64
+ skippedNoEmail: z.number().optional(),
65
+ alreadyScheduled: z.boolean().optional(),
66
+ }),
67
+ },
68
+ "surveys-sendSurveyCycleNow": {
69
+ request: z.object({cycleId: z.string()}),
70
+ response: z.object({sent: z.number()}),
71
+ },
72
+ "surveys-sendSurveyReminders": {
73
+ request: z.object({cycleId: z.string()}),
74
+ response: z.object({sent: z.number()}),
75
+ },
76
+ "surveys-setSurveyAutoSend": {
77
+ request: z.object({cycleId: z.string(), autoSend: z.boolean()}),
78
+ response: z.object({cycleId: z.string(), autoSend: z.boolean()}),
79
+ },
80
+ "surveys-resendSurveyInvite": {
81
+ request: z.object({
82
+ requestId: z.string(),
83
+ newEmail: z.string().optional(),
84
+ audience: z.enum(["student", "parent"]).optional(),
85
+ }),
86
+ response: z.object({
87
+ success: z.boolean(),
88
+ /** True when the corrected address no longer matches their account, so
89
+ * the UI can tell staff to fix the MIS rather than silently diverge. */
90
+ userEmailMismatch: z.boolean(),
91
+ }),
92
+ },
93
+ "surveys-deleteSurveyCycle": {
94
+ request: z.object({cycleId: z.string(), jobId: z.string().optional()}),
95
+ response: z.object({deleted: z.number()}),
96
+ },
97
+ "surveys-getMySurveyRequest": {
98
+ request: z.object({requestId: z.string()}),
99
+ // Shape varies by kind (see HYDRATE in surveys.ts), so left open.
100
+ response: z.any(),
101
+ },
102
+ "surveys-getPublicSurveyRequest": {
103
+ request: z.object({
104
+ requestId: z.string(),
105
+ token: z.string(),
106
+ role: z.enum(["student", "parent"]).optional(),
107
+ }),
108
+ response: z.any(),
109
+ },
110
+ "surveys-submitSurveyResponse": {
111
+ request: z.object({
112
+ requestId: z.string(),
113
+ /** The kind's own payload; narrowed by that kind's handler. */
114
+ response: z.unknown().optional(),
115
+ submittedBy: z.enum(["student", "parent", "employer", "staff", "trustedContact"]).optional(),
116
+ token: z.string().optional(),
117
+ rater: z.enum(["students", "parents", "employers", "trustedContact"]).optional(),
118
+ noChange: z.boolean().optional(),
119
+ }),
120
+ response: z.object({success: z.boolean()}).passthrough(),
121
+ },
122
+ } satisfies CallableGroup;