placementt-core 1.400.989 → 1.400.991
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/lib/callables/destinationsConfig.d.ts +72 -0
- package/lib/callables/destinationsConfig.js +46 -0
- package/lib/callables/destinationsConfig.js.map +1 -0
- package/lib/callables/index.d.ts +1 -1
- package/lib/callables/index.js +1 -1
- package/lib/callables/index.js.map +1 -1
- package/lib/callables/registry.d.ts +197 -35
- package/lib/callables/registry.js +3 -3
- package/lib/callables/registry.js.map +1 -1
- package/lib/callables/surveys.d.ts +59 -0
- package/lib/callables/surveys.js +22 -0
- package/lib/callables/surveys.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/destinationsConfig.ts +44 -0
- package/src/callables/index.ts +1 -1
- package/src/callables/registry.ts +3 -3
- package/src/callables/surveys.ts +22 -0
- package/src/callables/aspirations.ts +0 -21
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Contracts for the Destinations setup wizard
|
|
4
|
+
* (`Placementt-Backend/functions/src/destinationsConfig.ts`).
|
|
5
|
+
*
|
|
6
|
+
* These were `aspirations-*` while they lived in the legacy survey backend. That
|
|
7
|
+
* module is gone, but the config it happened to host is institute setup that the
|
|
8
|
+
* survey engine READS and does not own, so the two callables moved rather than being
|
|
9
|
+
* deleted. The names moved with them: never rename a deployed function in place, so
|
|
10
|
+
* the old `aspirations-saveDestinationsConfig` and `aspirations-provisionDestinationsNow`
|
|
11
|
+
* must be deleted explicitly at deploy time.
|
|
12
|
+
*/
|
|
13
|
+
export declare const destinationsConfigCallables: {
|
|
14
|
+
"destinationsConfig-saveDestinationsConfig": {
|
|
15
|
+
request: z.ZodObject<{
|
|
16
|
+
oId: z.ZodString;
|
|
17
|
+
/** The full DestinationsConfig from the setup wizard. Validated server
|
|
18
|
+
* side, which is also where provenance fields are stamped. */
|
|
19
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
config: Record<string, unknown>;
|
|
22
|
+
oId: string;
|
|
23
|
+
}, {
|
|
24
|
+
config: Record<string, unknown>;
|
|
25
|
+
oId: string;
|
|
26
|
+
}>;
|
|
27
|
+
response: z.ZodObject<{
|
|
28
|
+
saved: z.ZodBoolean;
|
|
29
|
+
/** True on a first save, which provisions the current year immediately. */
|
|
30
|
+
provisioned: z.ZodBoolean;
|
|
31
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
saved: boolean;
|
|
34
|
+
provisioned: boolean;
|
|
35
|
+
created?: number | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
saved: boolean;
|
|
38
|
+
provisioned: boolean;
|
|
39
|
+
created?: number | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
"destinationsConfig-provisionDestinationsNow": {
|
|
43
|
+
request: z.ZodObject<{
|
|
44
|
+
oId: z.ZodString;
|
|
45
|
+
/** Provision the upcoming academic year early ("Set Up Next Year"). */
|
|
46
|
+
nextYear: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
/** Limit to one feature; omit for everything the institute has configured. */
|
|
48
|
+
scope: z.ZodOptional<z.ZodEnum<["aspirations", "leavers"]>>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
oId: string;
|
|
51
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
52
|
+
nextYear?: boolean | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
oId: string;
|
|
55
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
56
|
+
nextYear?: boolean | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
response: z.ZodObject<{
|
|
59
|
+
provisioned: z.ZodBoolean;
|
|
60
|
+
created: z.ZodNumber;
|
|
61
|
+
academicYear: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
created: number;
|
|
64
|
+
academicYear: string;
|
|
65
|
+
provisioned: boolean;
|
|
66
|
+
}, {
|
|
67
|
+
created: number;
|
|
68
|
+
academicYear: string;
|
|
69
|
+
provisioned: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.destinationsConfigCallables = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Contracts for the Destinations setup wizard
|
|
7
|
+
* (`Placementt-Backend/functions/src/destinationsConfig.ts`).
|
|
8
|
+
*
|
|
9
|
+
* These were `aspirations-*` while they lived in the legacy survey backend. That
|
|
10
|
+
* module is gone, but the config it happened to host is institute setup that the
|
|
11
|
+
* survey engine READS and does not own, so the two callables moved rather than being
|
|
12
|
+
* deleted. The names moved with them: never rename a deployed function in place, so
|
|
13
|
+
* the old `aspirations-saveDestinationsConfig` and `aspirations-provisionDestinationsNow`
|
|
14
|
+
* must be deleted explicitly at deploy time.
|
|
15
|
+
*/
|
|
16
|
+
exports.destinationsConfigCallables = {
|
|
17
|
+
"destinationsConfig-saveDestinationsConfig": {
|
|
18
|
+
request: zod_1.z.object({
|
|
19
|
+
oId: zod_1.z.string(),
|
|
20
|
+
/** The full DestinationsConfig from the setup wizard. Validated server
|
|
21
|
+
* side, which is also where provenance fields are stamped. */
|
|
22
|
+
config: zod_1.z.record(zod_1.z.unknown()),
|
|
23
|
+
}),
|
|
24
|
+
response: zod_1.z.object({
|
|
25
|
+
saved: zod_1.z.boolean(),
|
|
26
|
+
/** True on a first save, which provisions the current year immediately. */
|
|
27
|
+
provisioned: zod_1.z.boolean(),
|
|
28
|
+
created: zod_1.z.number().optional(),
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
"destinationsConfig-provisionDestinationsNow": {
|
|
32
|
+
request: zod_1.z.object({
|
|
33
|
+
oId: zod_1.z.string(),
|
|
34
|
+
/** Provision the upcoming academic year early ("Set Up Next Year"). */
|
|
35
|
+
nextYear: zod_1.z.boolean().optional(),
|
|
36
|
+
/** Limit to one feature; omit for everything the institute has configured. */
|
|
37
|
+
scope: zod_1.z.enum(["aspirations", "leavers"]).optional(),
|
|
38
|
+
}),
|
|
39
|
+
response: zod_1.z.object({
|
|
40
|
+
provisioned: zod_1.z.boolean(),
|
|
41
|
+
created: zod_1.z.number(),
|
|
42
|
+
academicYear: zod_1.z.string(),
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=destinationsConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destinationsConfig.js","sourceRoot":"","sources":["../../src/callables/destinationsConfig.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;;;;;;;;GAUG;AACU,QAAA,2BAA2B,GAAG;IACvC,2CAA2C,EAAE;QACzC,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;YACf;0EAC8D;YAC9D,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;SAChC,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE;YAClB,2EAA2E;YAC3E,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE;YACxB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACjC,CAAC;KACL;IACD,6CAA6C,EAAE;QAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;YACf,uEAAuE;YACvE,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;YAChC,8EAA8E;YAC9E,KAAK,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;SACvD,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE;YACxB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;SAC3B,CAAC;KACL;CACoB,CAAC"}
|
package/lib/callables/index.d.ts
CHANGED
package/lib/callables/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
18
|
__exportStar(require("./registry"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./destinationsConfig"), exports);
|
|
20
20
|
__exportStar(require("./placement"), exports);
|
|
21
21
|
__exportStar(require("./events"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB"}
|
|
@@ -17,6 +17,7 @@ export declare const allCallables: {
|
|
|
17
17
|
kind: z.ZodEnum<[string, ...string[]]>;
|
|
18
18
|
yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
19
19
|
scheduledSendDate: z.ZodString;
|
|
20
|
+
academicYear: z.ZodOptional<z.ZodString>;
|
|
20
21
|
closeAfterDays: z.ZodOptional<z.ZodNumber>;
|
|
21
22
|
emailTemplateId: z.ZodOptional<z.ZodString>;
|
|
22
23
|
students: z.ZodOptional<z.ZodString>;
|
|
@@ -40,6 +41,7 @@ export declare const allCallables: {
|
|
|
40
41
|
autoSend: z.ZodOptional<z.ZodBoolean>;
|
|
41
42
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
42
43
|
resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
kindConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
43
45
|
}, "strip", z.ZodTypeAny, {
|
|
44
46
|
oId: string;
|
|
45
47
|
kind: string;
|
|
@@ -49,6 +51,7 @@ export declare const allCallables: {
|
|
|
49
51
|
yearGroups?: number[] | undefined;
|
|
50
52
|
students?: string | undefined;
|
|
51
53
|
draft?: boolean | undefined;
|
|
54
|
+
academicYear?: string | undefined;
|
|
52
55
|
closeAfterDays?: number | undefined;
|
|
53
56
|
emailTemplateId?: string | undefined;
|
|
54
57
|
raters?: {
|
|
@@ -60,6 +63,7 @@ export declare const allCallables: {
|
|
|
60
63
|
threadKey?: string | undefined;
|
|
61
64
|
autoSend?: boolean | undefined;
|
|
62
65
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
66
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
63
67
|
}, {
|
|
64
68
|
oId: string;
|
|
65
69
|
kind: string;
|
|
@@ -69,6 +73,7 @@ export declare const allCallables: {
|
|
|
69
73
|
yearGroups?: number[] | undefined;
|
|
70
74
|
students?: string | undefined;
|
|
71
75
|
draft?: boolean | undefined;
|
|
76
|
+
academicYear?: string | undefined;
|
|
72
77
|
closeAfterDays?: number | undefined;
|
|
73
78
|
emailTemplateId?: string | undefined;
|
|
74
79
|
raters?: {
|
|
@@ -80,6 +85,7 @@ export declare const allCallables: {
|
|
|
80
85
|
threadKey?: string | undefined;
|
|
81
86
|
autoSend?: boolean | undefined;
|
|
82
87
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
88
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
83
89
|
}>;
|
|
84
90
|
response: z.ZodObject<{
|
|
85
91
|
created: z.ZodArray<z.ZodObject<{
|
|
@@ -206,6 +212,37 @@ export declare const allCallables: {
|
|
|
206
212
|
autoSend: boolean;
|
|
207
213
|
}>;
|
|
208
214
|
};
|
|
215
|
+
"surveys-updateSurveyCycleSettings": {
|
|
216
|
+
request: z.ZodObject<{
|
|
217
|
+
cycleId: z.ZodString;
|
|
218
|
+
scheduledSendDate: z.ZodOptional<z.ZodString>;
|
|
219
|
+
emailTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
title: z.ZodOptional<z.ZodString>;
|
|
221
|
+
description: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
cycleId: string;
|
|
224
|
+
title?: string | undefined;
|
|
225
|
+
description?: string | undefined;
|
|
226
|
+
scheduledSendDate?: string | undefined;
|
|
227
|
+
emailTemplateId?: string | null | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
cycleId: string;
|
|
230
|
+
title?: string | undefined;
|
|
231
|
+
description?: string | undefined;
|
|
232
|
+
scheduledSendDate?: string | undefined;
|
|
233
|
+
emailTemplateId?: string | null | undefined;
|
|
234
|
+
}>;
|
|
235
|
+
response: z.ZodObject<{
|
|
236
|
+
cycleId: z.ZodString;
|
|
237
|
+
updated: z.ZodBoolean;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
cycleId: string;
|
|
240
|
+
updated: boolean;
|
|
241
|
+
}, {
|
|
242
|
+
cycleId: string;
|
|
243
|
+
updated: boolean;
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
209
246
|
"surveys-resendSurveyInvite": {
|
|
210
247
|
request: z.ZodObject<{
|
|
211
248
|
requestId: z.ZodString;
|
|
@@ -231,6 +268,22 @@ export declare const allCallables: {
|
|
|
231
268
|
userEmailMismatch: boolean;
|
|
232
269
|
}>;
|
|
233
270
|
};
|
|
271
|
+
"surveys-sendAlumniCheckInNow": {
|
|
272
|
+
request: z.ZodObject<{
|
|
273
|
+
alumniId: z.ZodString;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
alumniId: string;
|
|
276
|
+
}, {
|
|
277
|
+
alumniId: string;
|
|
278
|
+
}>;
|
|
279
|
+
response: z.ZodObject<{
|
|
280
|
+
sent: z.ZodBoolean;
|
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
|
+
sent: boolean;
|
|
283
|
+
}, {
|
|
284
|
+
sent: boolean;
|
|
285
|
+
}>;
|
|
286
|
+
};
|
|
234
287
|
"surveys-deleteSurveyCycle": {
|
|
235
288
|
request: z.ZodObject<{
|
|
236
289
|
cycleId: z.ZodString;
|
|
@@ -366,30 +419,58 @@ export declare const allCallables: {
|
|
|
366
419
|
}>;
|
|
367
420
|
response: z.ZodAny;
|
|
368
421
|
};
|
|
369
|
-
"
|
|
422
|
+
"destinationsConfig-saveDestinationsConfig": {
|
|
370
423
|
request: z.ZodObject<{
|
|
371
424
|
oId: z.ZodString;
|
|
372
|
-
|
|
373
|
-
scheduledSendDate: z.ZodString;
|
|
374
|
-
closeAfterDays: z.ZodOptional<z.ZodNumber>;
|
|
375
|
-
emailTemplateId: z.ZodOptional<z.ZodString>;
|
|
376
|
-
students: z.ZodOptional<z.ZodString>;
|
|
425
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
377
426
|
}, "strip", z.ZodTypeAny, {
|
|
427
|
+
config: Record<string, unknown>;
|
|
378
428
|
oId: string;
|
|
379
|
-
yearGroupsIncluded: number[];
|
|
380
|
-
scheduledSendDate: string;
|
|
381
|
-
students?: string | undefined;
|
|
382
|
-
closeAfterDays?: number | undefined;
|
|
383
|
-
emailTemplateId?: string | undefined;
|
|
384
429
|
}, {
|
|
430
|
+
config: Record<string, unknown>;
|
|
385
431
|
oId: string;
|
|
386
|
-
yearGroupsIncluded: number[];
|
|
387
|
-
scheduledSendDate: string;
|
|
388
|
-
students?: string | undefined;
|
|
389
|
-
closeAfterDays?: number | undefined;
|
|
390
|
-
emailTemplateId?: string | undefined;
|
|
391
432
|
}>;
|
|
392
|
-
response: z.
|
|
433
|
+
response: z.ZodObject<{
|
|
434
|
+
saved: z.ZodBoolean;
|
|
435
|
+
provisioned: z.ZodBoolean;
|
|
436
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
437
|
+
}, "strip", z.ZodTypeAny, {
|
|
438
|
+
saved: boolean;
|
|
439
|
+
provisioned: boolean;
|
|
440
|
+
created?: number | undefined;
|
|
441
|
+
}, {
|
|
442
|
+
saved: boolean;
|
|
443
|
+
provisioned: boolean;
|
|
444
|
+
created?: number | undefined;
|
|
445
|
+
}>;
|
|
446
|
+
};
|
|
447
|
+
"destinationsConfig-provisionDestinationsNow": {
|
|
448
|
+
request: z.ZodObject<{
|
|
449
|
+
oId: z.ZodString;
|
|
450
|
+
nextYear: z.ZodOptional<z.ZodBoolean>;
|
|
451
|
+
scope: z.ZodOptional<z.ZodEnum<["aspirations", "leavers"]>>;
|
|
452
|
+
}, "strip", z.ZodTypeAny, {
|
|
453
|
+
oId: string;
|
|
454
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
455
|
+
nextYear?: boolean | undefined;
|
|
456
|
+
}, {
|
|
457
|
+
oId: string;
|
|
458
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
459
|
+
nextYear?: boolean | undefined;
|
|
460
|
+
}>;
|
|
461
|
+
response: z.ZodObject<{
|
|
462
|
+
provisioned: z.ZodBoolean;
|
|
463
|
+
created: z.ZodNumber;
|
|
464
|
+
academicYear: z.ZodString;
|
|
465
|
+
}, "strip", z.ZodTypeAny, {
|
|
466
|
+
created: number;
|
|
467
|
+
academicYear: string;
|
|
468
|
+
provisioned: boolean;
|
|
469
|
+
}, {
|
|
470
|
+
created: number;
|
|
471
|
+
academicYear: string;
|
|
472
|
+
provisioned: boolean;
|
|
473
|
+
}>;
|
|
393
474
|
};
|
|
394
475
|
};
|
|
395
476
|
/** Every registered callable name. */
|
|
@@ -407,31 +488,59 @@ export type CallableContracts = {
|
|
|
407
488
|
};
|
|
408
489
|
/** The per-group maps, exported so tests can assert no key collisions. */
|
|
409
490
|
export declare const callableGroups: {
|
|
410
|
-
|
|
411
|
-
"
|
|
491
|
+
destinationsConfigCallables: {
|
|
492
|
+
"destinationsConfig-saveDestinationsConfig": {
|
|
412
493
|
request: z.ZodObject<{
|
|
413
494
|
oId: z.ZodString;
|
|
414
|
-
|
|
415
|
-
scheduledSendDate: z.ZodString;
|
|
416
|
-
closeAfterDays: z.ZodOptional<z.ZodNumber>;
|
|
417
|
-
emailTemplateId: z.ZodOptional<z.ZodString>;
|
|
418
|
-
students: z.ZodOptional<z.ZodString>;
|
|
495
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
419
496
|
}, "strip", z.ZodTypeAny, {
|
|
497
|
+
config: Record<string, unknown>;
|
|
420
498
|
oId: string;
|
|
421
|
-
yearGroupsIncluded: number[];
|
|
422
|
-
scheduledSendDate: string;
|
|
423
|
-
students?: string | undefined;
|
|
424
|
-
closeAfterDays?: number | undefined;
|
|
425
|
-
emailTemplateId?: string | undefined;
|
|
426
499
|
}, {
|
|
500
|
+
config: Record<string, unknown>;
|
|
427
501
|
oId: string;
|
|
428
|
-
yearGroupsIncluded: number[];
|
|
429
|
-
scheduledSendDate: string;
|
|
430
|
-
students?: string | undefined;
|
|
431
|
-
closeAfterDays?: number | undefined;
|
|
432
|
-
emailTemplateId?: string | undefined;
|
|
433
502
|
}>;
|
|
434
|
-
response: z.
|
|
503
|
+
response: z.ZodObject<{
|
|
504
|
+
saved: z.ZodBoolean;
|
|
505
|
+
provisioned: z.ZodBoolean;
|
|
506
|
+
created: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
}, "strip", z.ZodTypeAny, {
|
|
508
|
+
saved: boolean;
|
|
509
|
+
provisioned: boolean;
|
|
510
|
+
created?: number | undefined;
|
|
511
|
+
}, {
|
|
512
|
+
saved: boolean;
|
|
513
|
+
provisioned: boolean;
|
|
514
|
+
created?: number | undefined;
|
|
515
|
+
}>;
|
|
516
|
+
};
|
|
517
|
+
"destinationsConfig-provisionDestinationsNow": {
|
|
518
|
+
request: z.ZodObject<{
|
|
519
|
+
oId: z.ZodString;
|
|
520
|
+
nextYear: z.ZodOptional<z.ZodBoolean>;
|
|
521
|
+
scope: z.ZodOptional<z.ZodEnum<["aspirations", "leavers"]>>;
|
|
522
|
+
}, "strip", z.ZodTypeAny, {
|
|
523
|
+
oId: string;
|
|
524
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
525
|
+
nextYear?: boolean | undefined;
|
|
526
|
+
}, {
|
|
527
|
+
oId: string;
|
|
528
|
+
scope?: "aspirations" | "leavers" | undefined;
|
|
529
|
+
nextYear?: boolean | undefined;
|
|
530
|
+
}>;
|
|
531
|
+
response: z.ZodObject<{
|
|
532
|
+
provisioned: z.ZodBoolean;
|
|
533
|
+
created: z.ZodNumber;
|
|
534
|
+
academicYear: z.ZodString;
|
|
535
|
+
}, "strip", z.ZodTypeAny, {
|
|
536
|
+
created: number;
|
|
537
|
+
academicYear: string;
|
|
538
|
+
provisioned: boolean;
|
|
539
|
+
}, {
|
|
540
|
+
created: number;
|
|
541
|
+
academicYear: string;
|
|
542
|
+
provisioned: boolean;
|
|
543
|
+
}>;
|
|
435
544
|
};
|
|
436
545
|
};
|
|
437
546
|
placementCallables: {
|
|
@@ -504,6 +613,7 @@ export declare const callableGroups: {
|
|
|
504
613
|
kind: z.ZodEnum<[string, ...string[]]>;
|
|
505
614
|
yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
506
615
|
scheduledSendDate: z.ZodString;
|
|
616
|
+
academicYear: z.ZodOptional<z.ZodString>;
|
|
507
617
|
closeAfterDays: z.ZodOptional<z.ZodNumber>;
|
|
508
618
|
emailTemplateId: z.ZodOptional<z.ZodString>;
|
|
509
619
|
students: z.ZodOptional<z.ZodString>;
|
|
@@ -527,6 +637,7 @@ export declare const callableGroups: {
|
|
|
527
637
|
autoSend: z.ZodOptional<z.ZodBoolean>;
|
|
528
638
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
529
639
|
resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
|
|
640
|
+
kindConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
530
641
|
}, "strip", z.ZodTypeAny, {
|
|
531
642
|
oId: string;
|
|
532
643
|
kind: string;
|
|
@@ -536,6 +647,7 @@ export declare const callableGroups: {
|
|
|
536
647
|
yearGroups?: number[] | undefined;
|
|
537
648
|
students?: string | undefined;
|
|
538
649
|
draft?: boolean | undefined;
|
|
650
|
+
academicYear?: string | undefined;
|
|
539
651
|
closeAfterDays?: number | undefined;
|
|
540
652
|
emailTemplateId?: string | undefined;
|
|
541
653
|
raters?: {
|
|
@@ -547,6 +659,7 @@ export declare const callableGroups: {
|
|
|
547
659
|
threadKey?: string | undefined;
|
|
548
660
|
autoSend?: boolean | undefined;
|
|
549
661
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
662
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
550
663
|
}, {
|
|
551
664
|
oId: string;
|
|
552
665
|
kind: string;
|
|
@@ -556,6 +669,7 @@ export declare const callableGroups: {
|
|
|
556
669
|
yearGroups?: number[] | undefined;
|
|
557
670
|
students?: string | undefined;
|
|
558
671
|
draft?: boolean | undefined;
|
|
672
|
+
academicYear?: string | undefined;
|
|
559
673
|
closeAfterDays?: number | undefined;
|
|
560
674
|
emailTemplateId?: string | undefined;
|
|
561
675
|
raters?: {
|
|
@@ -567,6 +681,7 @@ export declare const callableGroups: {
|
|
|
567
681
|
threadKey?: string | undefined;
|
|
568
682
|
autoSend?: boolean | undefined;
|
|
569
683
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
684
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
570
685
|
}>;
|
|
571
686
|
response: z.ZodObject<{
|
|
572
687
|
created: z.ZodArray<z.ZodObject<{
|
|
@@ -693,6 +808,37 @@ export declare const callableGroups: {
|
|
|
693
808
|
autoSend: boolean;
|
|
694
809
|
}>;
|
|
695
810
|
};
|
|
811
|
+
"surveys-updateSurveyCycleSettings": {
|
|
812
|
+
request: z.ZodObject<{
|
|
813
|
+
cycleId: z.ZodString;
|
|
814
|
+
scheduledSendDate: z.ZodOptional<z.ZodString>;
|
|
815
|
+
emailTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
816
|
+
title: z.ZodOptional<z.ZodString>;
|
|
817
|
+
description: z.ZodOptional<z.ZodString>;
|
|
818
|
+
}, "strip", z.ZodTypeAny, {
|
|
819
|
+
cycleId: string;
|
|
820
|
+
title?: string | undefined;
|
|
821
|
+
description?: string | undefined;
|
|
822
|
+
scheduledSendDate?: string | undefined;
|
|
823
|
+
emailTemplateId?: string | null | undefined;
|
|
824
|
+
}, {
|
|
825
|
+
cycleId: string;
|
|
826
|
+
title?: string | undefined;
|
|
827
|
+
description?: string | undefined;
|
|
828
|
+
scheduledSendDate?: string | undefined;
|
|
829
|
+
emailTemplateId?: string | null | undefined;
|
|
830
|
+
}>;
|
|
831
|
+
response: z.ZodObject<{
|
|
832
|
+
cycleId: z.ZodString;
|
|
833
|
+
updated: z.ZodBoolean;
|
|
834
|
+
}, "strip", z.ZodTypeAny, {
|
|
835
|
+
cycleId: string;
|
|
836
|
+
updated: boolean;
|
|
837
|
+
}, {
|
|
838
|
+
cycleId: string;
|
|
839
|
+
updated: boolean;
|
|
840
|
+
}>;
|
|
841
|
+
};
|
|
696
842
|
"surveys-resendSurveyInvite": {
|
|
697
843
|
request: z.ZodObject<{
|
|
698
844
|
requestId: z.ZodString;
|
|
@@ -718,6 +864,22 @@ export declare const callableGroups: {
|
|
|
718
864
|
userEmailMismatch: boolean;
|
|
719
865
|
}>;
|
|
720
866
|
};
|
|
867
|
+
"surveys-sendAlumniCheckInNow": {
|
|
868
|
+
request: z.ZodObject<{
|
|
869
|
+
alumniId: z.ZodString;
|
|
870
|
+
}, "strip", z.ZodTypeAny, {
|
|
871
|
+
alumniId: string;
|
|
872
|
+
}, {
|
|
873
|
+
alumniId: string;
|
|
874
|
+
}>;
|
|
875
|
+
response: z.ZodObject<{
|
|
876
|
+
sent: z.ZodBoolean;
|
|
877
|
+
}, "strip", z.ZodTypeAny, {
|
|
878
|
+
sent: boolean;
|
|
879
|
+
}, {
|
|
880
|
+
sent: boolean;
|
|
881
|
+
}>;
|
|
882
|
+
};
|
|
721
883
|
"surveys-deleteSurveyCycle": {
|
|
722
884
|
request: z.ZodObject<{
|
|
723
885
|
cycleId: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callableGroups = exports.allCallables = void 0;
|
|
4
|
-
const
|
|
4
|
+
const destinationsConfig_1 = require("./destinationsConfig");
|
|
5
5
|
const placement_1 = require("./placement");
|
|
6
6
|
const events_1 = require("./events");
|
|
7
7
|
const surveys_1 = require("./surveys");
|
|
@@ -17,11 +17,11 @@ const surveys_1 = require("./surveys");
|
|
|
17
17
|
* equals the sum of the group key counts.
|
|
18
18
|
*/
|
|
19
19
|
exports.allCallables = {
|
|
20
|
-
...
|
|
20
|
+
...destinationsConfig_1.destinationsConfigCallables,
|
|
21
21
|
...placement_1.placementCallables,
|
|
22
22
|
...events_1.eventsCallables,
|
|
23
23
|
...surveys_1.surveyCallables,
|
|
24
24
|
};
|
|
25
25
|
/** The per-group maps, exported so tests can assert no key collisions. */
|
|
26
|
-
exports.callableGroups = {
|
|
26
|
+
exports.callableGroups = { destinationsConfigCallables: destinationsConfig_1.destinationsConfigCallables, placementCallables: placement_1.placementCallables, eventsCallables: events_1.eventsCallables, surveyCallables: surveys_1.surveyCallables };
|
|
27
27
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA,6DAAiE;AACjE,2CAA+C;AAC/C,qCAAyC;AACzC,uCAA0C;AAE1C;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAG;IACxB,GAAG,gDAA2B;IAC9B,GAAG,8BAAkB;IACrB,GAAG,wBAAe;IAClB,GAAG,yBAAe;CACG,CAAC;AAiB1B,0EAA0E;AAC7D,QAAA,cAAc,GAAG,EAAC,2BAA2B,EAA3B,gDAA2B,EAAE,kBAAkB,EAAlB,8BAAkB,EAAE,eAAe,EAAf,wBAAe,EAAE,eAAe,EAAf,yBAAe,EAAC,CAAC"}
|
|
@@ -7,6 +7,9 @@ export declare const surveyCallables: {
|
|
|
7
7
|
/** One cycle per year group. Omitted for institute-wide kinds. */
|
|
8
8
|
yearGroups: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
9
9
|
scheduledSendDate: z.ZodString;
|
|
10
|
+
/** Overrides the year derived from the send date — the leaver thread's
|
|
11
|
+
* Christmas leg sends in the year after the cohort's own. */
|
|
12
|
+
academicYear: z.ZodOptional<z.ZodString>;
|
|
10
13
|
closeAfterDays: z.ZodOptional<z.ZodNumber>;
|
|
11
14
|
emailTemplateId: z.ZodOptional<z.ZodString>;
|
|
12
15
|
/** JSON-serialised DataViewerSelectionBackend. */
|
|
@@ -31,6 +34,9 @@ export declare const surveyCallables: {
|
|
|
31
34
|
autoSend: z.ZodOptional<z.ZodBoolean>;
|
|
32
35
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
33
36
|
resolveRecipientsAtSend: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
/** Kind-specific settings the engine stores untouched and only that
|
|
38
|
+
* kind's handler reads — currently the leaver thread's allStudentsLeave. */
|
|
39
|
+
kindConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
40
|
}, "strip", z.ZodTypeAny, {
|
|
35
41
|
oId: string;
|
|
36
42
|
kind: string;
|
|
@@ -40,6 +46,7 @@ export declare const surveyCallables: {
|
|
|
40
46
|
yearGroups?: number[] | undefined;
|
|
41
47
|
students?: string | undefined;
|
|
42
48
|
draft?: boolean | undefined;
|
|
49
|
+
academicYear?: string | undefined;
|
|
43
50
|
closeAfterDays?: number | undefined;
|
|
44
51
|
emailTemplateId?: string | undefined;
|
|
45
52
|
raters?: {
|
|
@@ -51,6 +58,7 @@ export declare const surveyCallables: {
|
|
|
51
58
|
threadKey?: string | undefined;
|
|
52
59
|
autoSend?: boolean | undefined;
|
|
53
60
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
61
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
54
62
|
}, {
|
|
55
63
|
oId: string;
|
|
56
64
|
kind: string;
|
|
@@ -60,6 +68,7 @@ export declare const surveyCallables: {
|
|
|
60
68
|
yearGroups?: number[] | undefined;
|
|
61
69
|
students?: string | undefined;
|
|
62
70
|
draft?: boolean | undefined;
|
|
71
|
+
academicYear?: string | undefined;
|
|
63
72
|
closeAfterDays?: number | undefined;
|
|
64
73
|
emailTemplateId?: string | undefined;
|
|
65
74
|
raters?: {
|
|
@@ -71,6 +80,7 @@ export declare const surveyCallables: {
|
|
|
71
80
|
threadKey?: string | undefined;
|
|
72
81
|
autoSend?: boolean | undefined;
|
|
73
82
|
resolveRecipientsAtSend?: boolean | undefined;
|
|
83
|
+
kindConfig?: Record<string, unknown> | undefined;
|
|
74
84
|
}>;
|
|
75
85
|
response: z.ZodObject<{
|
|
76
86
|
created: z.ZodArray<z.ZodObject<{
|
|
@@ -197,6 +207,39 @@ export declare const surveyCallables: {
|
|
|
197
207
|
autoSend: boolean;
|
|
198
208
|
}>;
|
|
199
209
|
};
|
|
210
|
+
"surveys-updateSurveyCycleSettings": {
|
|
211
|
+
request: z.ZodObject<{
|
|
212
|
+
cycleId: z.ZodString;
|
|
213
|
+
/** ISO. Moves the close date and academic year with it. */
|
|
214
|
+
scheduledSendDate: z.ZodOptional<z.ZodString>;
|
|
215
|
+
/** null clears the custom template and falls back to the registry copy. */
|
|
216
|
+
emailTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
title: z.ZodOptional<z.ZodString>;
|
|
218
|
+
description: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
cycleId: string;
|
|
221
|
+
title?: string | undefined;
|
|
222
|
+
description?: string | undefined;
|
|
223
|
+
scheduledSendDate?: string | undefined;
|
|
224
|
+
emailTemplateId?: string | null | undefined;
|
|
225
|
+
}, {
|
|
226
|
+
cycleId: string;
|
|
227
|
+
title?: string | undefined;
|
|
228
|
+
description?: string | undefined;
|
|
229
|
+
scheduledSendDate?: string | undefined;
|
|
230
|
+
emailTemplateId?: string | null | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
response: z.ZodObject<{
|
|
233
|
+
cycleId: z.ZodString;
|
|
234
|
+
updated: z.ZodBoolean;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
cycleId: string;
|
|
237
|
+
updated: boolean;
|
|
238
|
+
}, {
|
|
239
|
+
cycleId: string;
|
|
240
|
+
updated: boolean;
|
|
241
|
+
}>;
|
|
242
|
+
};
|
|
200
243
|
"surveys-resendSurveyInvite": {
|
|
201
244
|
request: z.ZodObject<{
|
|
202
245
|
requestId: z.ZodString;
|
|
@@ -224,6 +267,22 @@ export declare const surveyCallables: {
|
|
|
224
267
|
userEmailMismatch: boolean;
|
|
225
268
|
}>;
|
|
226
269
|
};
|
|
270
|
+
"surveys-sendAlumniCheckInNow": {
|
|
271
|
+
request: z.ZodObject<{
|
|
272
|
+
alumniId: z.ZodString;
|
|
273
|
+
}, "strip", z.ZodTypeAny, {
|
|
274
|
+
alumniId: string;
|
|
275
|
+
}, {
|
|
276
|
+
alumniId: string;
|
|
277
|
+
}>;
|
|
278
|
+
response: z.ZodObject<{
|
|
279
|
+
sent: z.ZodBoolean;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
sent: boolean;
|
|
282
|
+
}, {
|
|
283
|
+
sent: boolean;
|
|
284
|
+
}>;
|
|
285
|
+
};
|
|
227
286
|
"surveys-deleteSurveyCycle": {
|
|
228
287
|
request: z.ZodObject<{
|
|
229
288
|
cycleId: z.ZodString;
|
package/lib/callables/surveys.js
CHANGED
|
@@ -25,6 +25,9 @@ exports.surveyCallables = {
|
|
|
25
25
|
/** One cycle per year group. Omitted for institute-wide kinds. */
|
|
26
26
|
yearGroups: zod_1.z.array(zod_1.z.number()).optional(),
|
|
27
27
|
scheduledSendDate: zod_1.z.string(), // ISO
|
|
28
|
+
/** Overrides the year derived from the send date — the leaver thread's
|
|
29
|
+
* Christmas leg sends in the year after the cohort's own. */
|
|
30
|
+
academicYear: zod_1.z.string().optional(),
|
|
28
31
|
closeAfterDays: zod_1.z.number().optional(),
|
|
29
32
|
emailTemplateId: zod_1.z.string().optional(),
|
|
30
33
|
/** JSON-serialised DataViewerSelectionBackend. */
|
|
@@ -37,6 +40,9 @@ exports.surveyCallables = {
|
|
|
37
40
|
autoSend: zod_1.z.boolean().optional(),
|
|
38
41
|
draft: zod_1.z.boolean().optional(),
|
|
39
42
|
resolveRecipientsAtSend: zod_1.z.boolean().optional(),
|
|
43
|
+
/** Kind-specific settings the engine stores untouched and only that
|
|
44
|
+
* kind's handler reads — currently the leaver thread's allStudentsLeave. */
|
|
45
|
+
kindConfig: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
40
46
|
}),
|
|
41
47
|
response: zod_1.z.object({
|
|
42
48
|
created: zod_1.z.array(zod_1.z.object({
|
|
@@ -75,6 +81,18 @@ exports.surveyCallables = {
|
|
|
75
81
|
request: zod_1.z.object({ cycleId: zod_1.z.string(), autoSend: zod_1.z.boolean() }),
|
|
76
82
|
response: zod_1.z.object({ cycleId: zod_1.z.string(), autoSend: zod_1.z.boolean() }),
|
|
77
83
|
},
|
|
84
|
+
"surveys-updateSurveyCycleSettings": {
|
|
85
|
+
request: zod_1.z.object({
|
|
86
|
+
cycleId: zod_1.z.string(),
|
|
87
|
+
/** ISO. Moves the close date and academic year with it. */
|
|
88
|
+
scheduledSendDate: zod_1.z.string().optional(),
|
|
89
|
+
/** null clears the custom template and falls back to the registry copy. */
|
|
90
|
+
emailTemplateId: zod_1.z.string().nullable().optional(),
|
|
91
|
+
title: zod_1.z.string().optional(),
|
|
92
|
+
description: zod_1.z.string().optional(),
|
|
93
|
+
}),
|
|
94
|
+
response: zod_1.z.object({ cycleId: zod_1.z.string(), updated: zod_1.z.boolean() }),
|
|
95
|
+
},
|
|
78
96
|
"surveys-resendSurveyInvite": {
|
|
79
97
|
request: zod_1.z.object({
|
|
80
98
|
requestId: zod_1.z.string(),
|
|
@@ -88,6 +106,10 @@ exports.surveyCallables = {
|
|
|
88
106
|
userEmailMismatch: zod_1.z.boolean(),
|
|
89
107
|
}),
|
|
90
108
|
},
|
|
109
|
+
"surveys-sendAlumniCheckInNow": {
|
|
110
|
+
request: zod_1.z.object({ alumniId: zod_1.z.string() }),
|
|
111
|
+
response: zod_1.z.object({ sent: zod_1.z.boolean() }),
|
|
112
|
+
},
|
|
91
113
|
"surveys-deleteSurveyCycle": {
|
|
92
114
|
request: zod_1.z.object({ cycleId: zod_1.z.string(), jobId: zod_1.z.string().optional() }),
|
|
93
115
|
response: zod_1.z.object({ deleted: zod_1.z.number() }),
|
|
@@ -1 +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,CAA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
/**
|
|
5
|
+
* Contracts for the Destinations setup wizard
|
|
6
|
+
* (`Placementt-Backend/functions/src/destinationsConfig.ts`).
|
|
7
|
+
*
|
|
8
|
+
* These were `aspirations-*` while they lived in the legacy survey backend. That
|
|
9
|
+
* module is gone, but the config it happened to host is institute setup that the
|
|
10
|
+
* survey engine READS and does not own, so the two callables moved rather than being
|
|
11
|
+
* deleted. The names moved with them: never rename a deployed function in place, so
|
|
12
|
+
* the old `aspirations-saveDestinationsConfig` and `aspirations-provisionDestinationsNow`
|
|
13
|
+
* must be deleted explicitly at deploy time.
|
|
14
|
+
*/
|
|
15
|
+
export const destinationsConfigCallables = {
|
|
16
|
+
"destinationsConfig-saveDestinationsConfig": {
|
|
17
|
+
request: z.object({
|
|
18
|
+
oId: z.string(),
|
|
19
|
+
/** The full DestinationsConfig from the setup wizard. Validated server
|
|
20
|
+
* side, which is also where provenance fields are stamped. */
|
|
21
|
+
config: z.record(z.unknown()),
|
|
22
|
+
}),
|
|
23
|
+
response: z.object({
|
|
24
|
+
saved: z.boolean(),
|
|
25
|
+
/** True on a first save, which provisions the current year immediately. */
|
|
26
|
+
provisioned: z.boolean(),
|
|
27
|
+
created: z.number().optional(),
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
"destinationsConfig-provisionDestinationsNow": {
|
|
31
|
+
request: z.object({
|
|
32
|
+
oId: z.string(),
|
|
33
|
+
/** Provision the upcoming academic year early ("Set Up Next Year"). */
|
|
34
|
+
nextYear: z.boolean().optional(),
|
|
35
|
+
/** Limit to one feature; omit for everything the institute has configured. */
|
|
36
|
+
scope: z.enum(["aspirations", "leavers"]).optional(),
|
|
37
|
+
}),
|
|
38
|
+
response: z.object({
|
|
39
|
+
provisioned: z.boolean(),
|
|
40
|
+
created: z.number(),
|
|
41
|
+
academicYear: z.string(),
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
} satisfies CallableGroup;
|
package/src/callables/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {z} from "zod";
|
|
2
2
|
import {CallableGroup} from "./types";
|
|
3
|
-
import {
|
|
3
|
+
import {destinationsConfigCallables} from "./destinationsConfig";
|
|
4
4
|
import {placementCallables} from "./placement";
|
|
5
5
|
import {eventsCallables} from "./events";
|
|
6
6
|
import {surveyCallables} from "./surveys";
|
|
@@ -17,7 +17,7 @@ import {surveyCallables} from "./surveys";
|
|
|
17
17
|
* equals the sum of the group key counts.
|
|
18
18
|
*/
|
|
19
19
|
export const allCallables = {
|
|
20
|
-
...
|
|
20
|
+
...destinationsConfigCallables,
|
|
21
21
|
...placementCallables,
|
|
22
22
|
...eventsCallables,
|
|
23
23
|
...surveyCallables,
|
|
@@ -39,4 +39,4 @@ export type CallableContracts = {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/** The per-group maps, exported so tests can assert no key collisions. */
|
|
42
|
-
export const callableGroups = {
|
|
42
|
+
export const callableGroups = {destinationsConfigCallables, placementCallables, eventsCallables, surveyCallables};
|
package/src/callables/surveys.ts
CHANGED
|
@@ -27,6 +27,9 @@ export const surveyCallables = {
|
|
|
27
27
|
/** One cycle per year group. Omitted for institute-wide kinds. */
|
|
28
28
|
yearGroups: z.array(z.number()).optional(),
|
|
29
29
|
scheduledSendDate: z.string(), // ISO
|
|
30
|
+
/** Overrides the year derived from the send date — the leaver thread's
|
|
31
|
+
* Christmas leg sends in the year after the cohort's own. */
|
|
32
|
+
academicYear: z.string().optional(),
|
|
30
33
|
closeAfterDays: z.number().optional(),
|
|
31
34
|
emailTemplateId: z.string().optional(),
|
|
32
35
|
/** JSON-serialised DataViewerSelectionBackend. */
|
|
@@ -39,6 +42,9 @@ export const surveyCallables = {
|
|
|
39
42
|
autoSend: z.boolean().optional(),
|
|
40
43
|
draft: z.boolean().optional(),
|
|
41
44
|
resolveRecipientsAtSend: z.boolean().optional(),
|
|
45
|
+
/** Kind-specific settings the engine stores untouched and only that
|
|
46
|
+
* kind's handler reads — currently the leaver thread's allStudentsLeave. */
|
|
47
|
+
kindConfig: z.record(z.unknown()).optional(),
|
|
42
48
|
}),
|
|
43
49
|
response: z.object({
|
|
44
50
|
created: z.array(z.object({
|
|
@@ -77,6 +83,18 @@ export const surveyCallables = {
|
|
|
77
83
|
request: z.object({cycleId: z.string(), autoSend: z.boolean()}),
|
|
78
84
|
response: z.object({cycleId: z.string(), autoSend: z.boolean()}),
|
|
79
85
|
},
|
|
86
|
+
"surveys-updateSurveyCycleSettings": {
|
|
87
|
+
request: z.object({
|
|
88
|
+
cycleId: z.string(),
|
|
89
|
+
/** ISO. Moves the close date and academic year with it. */
|
|
90
|
+
scheduledSendDate: z.string().optional(),
|
|
91
|
+
/** null clears the custom template and falls back to the registry copy. */
|
|
92
|
+
emailTemplateId: z.string().nullable().optional(),
|
|
93
|
+
title: z.string().optional(),
|
|
94
|
+
description: z.string().optional(),
|
|
95
|
+
}),
|
|
96
|
+
response: z.object({cycleId: z.string(), updated: z.boolean()}),
|
|
97
|
+
},
|
|
80
98
|
"surveys-resendSurveyInvite": {
|
|
81
99
|
request: z.object({
|
|
82
100
|
requestId: z.string(),
|
|
@@ -90,6 +108,10 @@ export const surveyCallables = {
|
|
|
90
108
|
userEmailMismatch: z.boolean(),
|
|
91
109
|
}),
|
|
92
110
|
},
|
|
111
|
+
"surveys-sendAlumniCheckInNow": {
|
|
112
|
+
request: z.object({alumniId: z.string()}),
|
|
113
|
+
response: z.object({sent: z.boolean()}),
|
|
114
|
+
},
|
|
93
115
|
"surveys-deleteSurveyCycle": {
|
|
94
116
|
request: z.object({cycleId: z.string(), jobId: z.string().optional()}),
|
|
95
117
|
response: z.object({deleted: z.number()}),
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {z} from "zod";
|
|
2
|
-
import {CallableGroup} from "./types";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Contracts for the `aspirations` backend module
|
|
6
|
-
* (`Placementt-Backend/functions/src/aspirations.ts`).
|
|
7
|
-
*/
|
|
8
|
-
export const aspirationCallables = {
|
|
9
|
-
"aspirations-createAspirationCycle": {
|
|
10
|
-
request: z.object({
|
|
11
|
-
oId: z.string(),
|
|
12
|
-
yearGroupsIncluded: z.array(z.number()),
|
|
13
|
-
scheduledSendDate: z.string(), // ISO string
|
|
14
|
-
closeAfterDays: z.number().optional(),
|
|
15
|
-
emailTemplateId: z.string().optional(),
|
|
16
|
-
students: z.string().optional(), // JSON-serialised DataViewerSelectionBackend
|
|
17
|
-
}),
|
|
18
|
-
// TODO: tighten once the return shape is confirmed.
|
|
19
|
-
response: z.any(),
|
|
20
|
-
},
|
|
21
|
-
} satisfies CallableGroup;
|