placementt-core 1.400.1140 → 1.400.1142
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/__tests__/activities.test.d.ts +1 -0
- package/lib/callables/__tests__/activities.test.js +32 -0
- package/lib/callables/__tests__/activities.test.js.map +1 -0
- package/lib/callables/activities.d.ts +224 -0
- package/lib/callables/activities.js +63 -0
- package/lib/callables/activities.js.map +1 -0
- package/lib/callables/events.d.ts +2 -2
- package/lib/callables/index.d.ts +1 -0
- package/lib/callables/index.js +1 -0
- package/lib/callables/index.js.map +1 -1
- package/lib/callables/misSync.d.ts +2 -2
- package/lib/callables/outreach.d.ts +6 -6
- package/lib/callables/registry.d.ts +354 -36
- package/lib/callables/registry.js +3 -0
- package/lib/callables/registry.js.map +1 -1
- package/lib/callables/studentLaunches.d.ts +2 -2
- package/lib/callables/surveys.d.ts +6 -6
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +39 -0
- package/lib/constants.js.map +1 -1
- package/lib/firebase/callableJobContext.js +3 -0
- package/lib/firebase/callableJobContext.js.map +1 -1
- package/lib/firebase/firebase.d.ts +1 -1
- package/lib/firebase/firebase.js +8 -0
- package/lib/firebase/firebase.js.map +1 -1
- package/lib/typeDefinitions.d.ts +8 -1
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/__tests__/activities.test.ts +35 -0
- package/src/callables/activities.ts +66 -0
- package/src/callables/index.ts +1 -0
- package/src/callables/registry.ts +3 -0
- package/src/constants.ts +39 -0
- package/src/firebase/callableJobContext.ts +3 -0
- package/src/firebase/firebase.tsx +10 -1
- package/src/typeDefinitions.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const registry_1 = require("../registry");
|
|
4
|
+
const schema = registry_1.allCallables["activities-bulkAdd"].request;
|
|
5
|
+
const activity = {
|
|
6
|
+
type: "extracurricular",
|
|
7
|
+
activityType: "volunteering",
|
|
8
|
+
title: "Food bank",
|
|
9
|
+
description: "Sorting donations",
|
|
10
|
+
};
|
|
11
|
+
describe("activities-bulkAdd request", () => {
|
|
12
|
+
it("accepts a filter selection", () => {
|
|
13
|
+
const parsed = schema.safeParse({ oId: "school", activity,
|
|
14
|
+
students: { allSelected: true, filters: [{ k: "details.year", e: "==", v: "10" }] } });
|
|
15
|
+
expect(parsed.success).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
it("accepts a list of uids", () => {
|
|
18
|
+
expect(schema.safeParse({ oId: "school", activity, students: ["a", "b"] }).success).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it("drops fields the server owns", () => {
|
|
21
|
+
const parsed = schema.parse({ oId: "school", students: ["a"],
|
|
22
|
+
activity: { ...activity, uid: "someoneElse", verificationStatus: "schoolVerified", createdBy: "student" } });
|
|
23
|
+
expect(parsed.activity).not.toHaveProperty("uid");
|
|
24
|
+
expect(parsed.activity).not.toHaveProperty("verificationStatus");
|
|
25
|
+
expect(parsed.activity).not.toHaveProperty("createdBy");
|
|
26
|
+
});
|
|
27
|
+
it("rejects an activity with no title or category", () => {
|
|
28
|
+
expect(schema.safeParse({ oId: "school", students: ["a"], activity: { ...activity, title: "" } }).success).toBe(false);
|
|
29
|
+
expect(schema.safeParse({ oId: "school", students: ["a"], activity: { ...activity, type: "other" } }).success).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=activities.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities.test.js","sourceRoot":"","sources":["../../../src/callables/__tests__/activities.test.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AAEzC,MAAM,MAAM,GAAG,uBAAY,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAE1D,MAAM,QAAQ,GAAG;IACb,IAAI,EAAE,iBA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AAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;QACjE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAC,GAAG,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAC,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAC,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3H,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** What staff fill in on the activity builder. Everything the server owns (who
|
|
3
|
+
* it belongs to, who made it, how it is verified, when) is set there, never sent. */
|
|
4
|
+
declare const staffActivity: z.ZodObject<{
|
|
5
|
+
type: z.ZodEnum<["extracurricular", "supercurricular", "curricular"]>;
|
|
6
|
+
activityType: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
description: z.ZodString;
|
|
9
|
+
organisationName: z.ZodOptional<z.ZodString>;
|
|
10
|
+
typeDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
+
locationType: z.ZodOptional<z.ZodEnum<["inPerson", "online", "hybrid"]>>;
|
|
12
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
13
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
14
|
+
isOngoing: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
isRecurring: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
timeCommitment: z.ZodOptional<z.ZodEnum<["1to2Hours", "halfDay", "fullDay", "multipleDays"]>>;
|
|
17
|
+
recurringFrequency: z.ZodOptional<z.ZodEnum<["daily", "weekly", "fortnightly", "monthly"]>>;
|
|
18
|
+
hoursPerSession: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodEnum<["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]>, "many">>;
|
|
20
|
+
skillsDeveloped: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
activityType: string;
|
|
26
|
+
startDate?: string | undefined;
|
|
27
|
+
endDate?: string | undefined;
|
|
28
|
+
organisationName?: string | undefined;
|
|
29
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
30
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
31
|
+
isOngoing?: boolean | undefined;
|
|
32
|
+
isRecurring?: boolean | undefined;
|
|
33
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
34
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
35
|
+
hoursPerSession?: number | undefined;
|
|
36
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
37
|
+
skillsDeveloped?: string[] | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
activityType: string;
|
|
43
|
+
startDate?: string | undefined;
|
|
44
|
+
endDate?: string | undefined;
|
|
45
|
+
organisationName?: string | undefined;
|
|
46
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
47
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
48
|
+
isOngoing?: boolean | undefined;
|
|
49
|
+
isRecurring?: boolean | undefined;
|
|
50
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
51
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
52
|
+
hoursPerSession?: number | undefined;
|
|
53
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
54
|
+
skillsDeveloped?: string[] | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export type StaffActivityInput = z.infer<typeof staffActivity>;
|
|
57
|
+
export declare const activitiesCallables: {
|
|
58
|
+
/**
|
|
59
|
+
* Adds one activity to every selected student, as a staff-reported activity.
|
|
60
|
+
* Students outside the caller's student visibility are skipped. Reflection and
|
|
61
|
+
* skill ratings are left for each student to add.
|
|
62
|
+
*/
|
|
63
|
+
"activities-bulkAdd": {
|
|
64
|
+
request: z.ZodObject<{
|
|
65
|
+
/** The school the students belong to. */
|
|
66
|
+
oId: z.ZodString;
|
|
67
|
+
students: z.ZodUnion<[z.ZodObject<{
|
|
68
|
+
allSelected: z.ZodBoolean;
|
|
69
|
+
search: z.ZodOptional<z.ZodString>;
|
|
70
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
|
+
k: z.ZodString;
|
|
72
|
+
e: z.ZodOptional<z.ZodString>;
|
|
73
|
+
v: z.ZodUnknown;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
k: string;
|
|
76
|
+
v?: unknown;
|
|
77
|
+
e?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
k: string;
|
|
80
|
+
v?: unknown;
|
|
81
|
+
e?: string | undefined;
|
|
82
|
+
}>, "many">>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
allSelected: boolean;
|
|
85
|
+
search?: string | undefined;
|
|
86
|
+
filters?: {
|
|
87
|
+
k: string;
|
|
88
|
+
v?: unknown;
|
|
89
|
+
e?: string | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
allSelected: boolean;
|
|
93
|
+
search?: string | undefined;
|
|
94
|
+
filters?: {
|
|
95
|
+
k: string;
|
|
96
|
+
v?: unknown;
|
|
97
|
+
e?: string | undefined;
|
|
98
|
+
}[] | undefined;
|
|
99
|
+
}>, z.ZodArray<z.ZodString, "many">]>;
|
|
100
|
+
activity: z.ZodObject<{
|
|
101
|
+
type: z.ZodEnum<["extracurricular", "supercurricular", "curricular"]>;
|
|
102
|
+
activityType: z.ZodString;
|
|
103
|
+
title: z.ZodString;
|
|
104
|
+
description: z.ZodString;
|
|
105
|
+
organisationName: z.ZodOptional<z.ZodString>;
|
|
106
|
+
typeDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
|
+
locationType: z.ZodOptional<z.ZodEnum<["inPerson", "online", "hybrid"]>>;
|
|
108
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
109
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
110
|
+
isOngoing: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
isRecurring: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
timeCommitment: z.ZodOptional<z.ZodEnum<["1to2Hours", "halfDay", "fullDay", "multipleDays"]>>;
|
|
113
|
+
recurringFrequency: z.ZodOptional<z.ZodEnum<["daily", "weekly", "fortnightly", "monthly"]>>;
|
|
114
|
+
hoursPerSession: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
daysOfWeek: z.ZodOptional<z.ZodArray<z.ZodEnum<["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"]>, "many">>;
|
|
116
|
+
skillsDeveloped: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
119
|
+
title: string;
|
|
120
|
+
description: string;
|
|
121
|
+
activityType: string;
|
|
122
|
+
startDate?: string | undefined;
|
|
123
|
+
endDate?: string | undefined;
|
|
124
|
+
organisationName?: string | undefined;
|
|
125
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
126
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
127
|
+
isOngoing?: boolean | undefined;
|
|
128
|
+
isRecurring?: boolean | undefined;
|
|
129
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
130
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
131
|
+
hoursPerSession?: number | undefined;
|
|
132
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
133
|
+
skillsDeveloped?: string[] | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
136
|
+
title: string;
|
|
137
|
+
description: string;
|
|
138
|
+
activityType: string;
|
|
139
|
+
startDate?: string | undefined;
|
|
140
|
+
endDate?: string | undefined;
|
|
141
|
+
organisationName?: string | undefined;
|
|
142
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
143
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
144
|
+
isOngoing?: boolean | undefined;
|
|
145
|
+
isRecurring?: boolean | undefined;
|
|
146
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
147
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
148
|
+
hoursPerSession?: number | undefined;
|
|
149
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
150
|
+
skillsDeveloped?: string[] | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
/** Set by `useExecuteCallableJob`. */
|
|
153
|
+
jobId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
oId: string;
|
|
156
|
+
students: string[] | {
|
|
157
|
+
allSelected: boolean;
|
|
158
|
+
search?: string | undefined;
|
|
159
|
+
filters?: {
|
|
160
|
+
k: string;
|
|
161
|
+
v?: unknown;
|
|
162
|
+
e?: string | undefined;
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
};
|
|
165
|
+
activity: {
|
|
166
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
167
|
+
title: string;
|
|
168
|
+
description: string;
|
|
169
|
+
activityType: string;
|
|
170
|
+
startDate?: string | undefined;
|
|
171
|
+
endDate?: string | undefined;
|
|
172
|
+
organisationName?: string | undefined;
|
|
173
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
174
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
175
|
+
isOngoing?: boolean | undefined;
|
|
176
|
+
isRecurring?: boolean | undefined;
|
|
177
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
178
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
179
|
+
hoursPerSession?: number | undefined;
|
|
180
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
181
|
+
skillsDeveloped?: string[] | undefined;
|
|
182
|
+
};
|
|
183
|
+
jobId?: string | undefined;
|
|
184
|
+
}, {
|
|
185
|
+
oId: string;
|
|
186
|
+
students: string[] | {
|
|
187
|
+
allSelected: boolean;
|
|
188
|
+
search?: string | undefined;
|
|
189
|
+
filters?: {
|
|
190
|
+
k: string;
|
|
191
|
+
v?: unknown;
|
|
192
|
+
e?: string | undefined;
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
};
|
|
195
|
+
activity: {
|
|
196
|
+
type: "extracurricular" | "supercurricular" | "curricular";
|
|
197
|
+
title: string;
|
|
198
|
+
description: string;
|
|
199
|
+
activityType: string;
|
|
200
|
+
startDate?: string | undefined;
|
|
201
|
+
endDate?: string | undefined;
|
|
202
|
+
organisationName?: string | undefined;
|
|
203
|
+
typeDetails?: Record<string, unknown> | undefined;
|
|
204
|
+
locationType?: "hybrid" | "online" | "inPerson" | undefined;
|
|
205
|
+
isOngoing?: boolean | undefined;
|
|
206
|
+
isRecurring?: boolean | undefined;
|
|
207
|
+
timeCommitment?: "1to2Hours" | "halfDay" | "fullDay" | "multipleDays" | undefined;
|
|
208
|
+
recurringFrequency?: "daily" | "weekly" | "monthly" | "fortnightly" | undefined;
|
|
209
|
+
hoursPerSession?: number | undefined;
|
|
210
|
+
daysOfWeek?: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday")[] | undefined;
|
|
211
|
+
skillsDeveloped?: string[] | undefined;
|
|
212
|
+
};
|
|
213
|
+
jobId?: string | undefined;
|
|
214
|
+
}>;
|
|
215
|
+
response: z.ZodObject<{
|
|
216
|
+
added: z.ZodNumber;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
added: number;
|
|
219
|
+
}, {
|
|
220
|
+
added: number;
|
|
221
|
+
}>;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activitiesCallables = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Contracts for staff adding student activities
|
|
7
|
+
* (`Placementt-Backend/functions/src/activities.ts`).
|
|
8
|
+
*/
|
|
9
|
+
/** The students picked in the student table, as DataViewerSelectionBackend:
|
|
10
|
+
* a filter (with an optional search), or a list of uids. */
|
|
11
|
+
const studentSelection = zod_1.z.union([
|
|
12
|
+
zod_1.z.object({
|
|
13
|
+
allSelected: zod_1.z.boolean(),
|
|
14
|
+
search: zod_1.z.string().optional(),
|
|
15
|
+
filters: zod_1.z.array(zod_1.z.object({
|
|
16
|
+
k: zod_1.z.string(),
|
|
17
|
+
e: zod_1.z.string().optional(),
|
|
18
|
+
v: zod_1.z.unknown(),
|
|
19
|
+
})).optional(),
|
|
20
|
+
}),
|
|
21
|
+
zod_1.z.array(zod_1.z.string().min(1).max(128)).max(5000),
|
|
22
|
+
]);
|
|
23
|
+
/** What staff fill in on the activity builder. Everything the server owns (who
|
|
24
|
+
* it belongs to, who made it, how it is verified, when) is set there, never sent. */
|
|
25
|
+
const staffActivity = zod_1.z.object({
|
|
26
|
+
type: zod_1.z.enum(["extracurricular", "supercurricular", "curricular"]),
|
|
27
|
+
activityType: zod_1.z.string().min(1),
|
|
28
|
+
title: zod_1.z.string().min(1),
|
|
29
|
+
description: zod_1.z.string(),
|
|
30
|
+
organisationName: zod_1.z.string().optional(),
|
|
31
|
+
typeDetails: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
32
|
+
locationType: zod_1.z.enum(["inPerson", "online", "hybrid"]).optional(),
|
|
33
|
+
startDate: zod_1.z.string().optional(),
|
|
34
|
+
endDate: zod_1.z.string().optional(),
|
|
35
|
+
isOngoing: zod_1.z.boolean().optional(),
|
|
36
|
+
isRecurring: zod_1.z.boolean().optional(),
|
|
37
|
+
timeCommitment: zod_1.z.enum(["1to2Hours", "halfDay", "fullDay", "multipleDays"]).optional(),
|
|
38
|
+
recurringFrequency: zod_1.z.enum(["daily", "weekly", "fortnightly", "monthly"]).optional(),
|
|
39
|
+
hoursPerSession: zod_1.z.number().optional(),
|
|
40
|
+
daysOfWeek: zod_1.z.array(zod_1.z.enum(["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"])).optional(),
|
|
41
|
+
skillsDeveloped: zod_1.z.array(zod_1.z.string()).optional(),
|
|
42
|
+
});
|
|
43
|
+
exports.activitiesCallables = {
|
|
44
|
+
/**
|
|
45
|
+
* Adds one activity to every selected student, as a staff-reported activity.
|
|
46
|
+
* Students outside the caller's student visibility are skipped. Reflection and
|
|
47
|
+
* skill ratings are left for each student to add.
|
|
48
|
+
*/
|
|
49
|
+
"activities-bulkAdd": {
|
|
50
|
+
request: zod_1.z.object({
|
|
51
|
+
/** The school the students belong to. */
|
|
52
|
+
oId: zod_1.z.string().min(1).max(128),
|
|
53
|
+
students: studentSelection,
|
|
54
|
+
activity: staffActivity,
|
|
55
|
+
/** Set by `useExecuteCallableJob`. */
|
|
56
|
+
jobId: zod_1.z.string().optional(),
|
|
57
|
+
}),
|
|
58
|
+
response: zod_1.z.object({
|
|
59
|
+
added: zod_1.z.number(),
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=activities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities.js","sourceRoot":"","sources":["../../src/callables/activities.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;GAGG;AAEH;4DAC4D;AAC5D,MAAM,gBAAgB,GAAG,OAAC,CAAC,KAAK,CAAC;IAC7B,OAAC,CAAC,MAAM,CAAC;QACL,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE;QACxB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC;YACtB,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE;YACb,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACxB,CAAC,EAAE,OAAC,CAAC,OAAO,EAAE;SACjB,CAAC,CAAC,CAAC,QAAQ,EA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,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpF,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtH,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAIU,QAAA,mBAAmB,GAAG;IAC/B;;;;OAIG;IACH,oBAAoB,EAAE;QAClB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,yCAAyC;YACzC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;YAC/B,QAAQ,EAAE,gBAAgB;YAC1B,QAAQ,EAAE,aAAa;YACvB,sCAAsC;YACtC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC/B,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;SACpB,CAAC;KACL;CACoB,CAAC"}
|
|
@@ -30,8 +30,8 @@ export declare const eventsCallables: {
|
|
|
30
30
|
"address-line1"?: string | undefined;
|
|
31
31
|
"address-line2"?: string | undefined;
|
|
32
32
|
country?: string | undefined;
|
|
33
|
-
postal_code?: string | undefined;
|
|
34
33
|
locality?: string | undefined;
|
|
34
|
+
postal_code?: string | undefined;
|
|
35
35
|
geohash?: string | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
id: string;
|
|
@@ -39,8 +39,8 @@ export declare const eventsCallables: {
|
|
|
39
39
|
"address-line1"?: string | undefined;
|
|
40
40
|
"address-line2"?: string | undefined;
|
|
41
41
|
country?: string | undefined;
|
|
42
|
-
postal_code?: string | undefined;
|
|
43
42
|
locality?: string | undefined;
|
|
43
|
+
postal_code?: string | undefined;
|
|
44
44
|
geohash?: string | undefined;
|
|
45
45
|
}>, "many">;
|
|
46
46
|
};
|
package/lib/callables/index.d.ts
CHANGED
package/lib/callables/index.js
CHANGED
|
@@ -31,4 +31,5 @@ __exportStar(require("./misSync"), exports);
|
|
|
31
31
|
__exportStar(require("./userManagement"), exports);
|
|
32
32
|
__exportStar(require("./outreach"), exports);
|
|
33
33
|
__exportStar(require("./formImport"), exports);
|
|
34
|
+
__exportStar(require("./activities"), exports);
|
|
34
35
|
//# 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,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,4CAA0B;AAC1B,oDAAkC;AAClC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,4CAA0B;AAC1B,oDAAkC;AAClC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -25,8 +25,8 @@ export declare const misSyncCallables: {
|
|
|
25
25
|
oId: z.ZodString;
|
|
26
26
|
}>, "strip", z.ZodTypeAny, {
|
|
27
27
|
method: "email" | "api";
|
|
28
|
-
oId: string;
|
|
29
28
|
enabled: boolean;
|
|
29
|
+
oId: string;
|
|
30
30
|
allowedSenders: string[];
|
|
31
31
|
studentEmailDomains: string[];
|
|
32
32
|
inactiveStatuses: string[];
|
|
@@ -38,8 +38,8 @@ export declare const misSyncCallables: {
|
|
|
38
38
|
alertEmails: string[];
|
|
39
39
|
}, {
|
|
40
40
|
method: "email" | "api";
|
|
41
|
-
oId: string;
|
|
42
41
|
enabled: boolean;
|
|
42
|
+
oId: string;
|
|
43
43
|
allowedSenders: string[];
|
|
44
44
|
studentEmailDomains: string[];
|
|
45
45
|
inactiveStatuses: string[];
|
|
@@ -48,9 +48,9 @@ export declare const outreachCallables: {
|
|
|
48
48
|
urn?: string | undefined;
|
|
49
49
|
}[];
|
|
50
50
|
added: number;
|
|
51
|
-
noEmail: number;
|
|
52
51
|
updated: number;
|
|
53
52
|
keptStatus: number;
|
|
53
|
+
noEmail: number;
|
|
54
54
|
invalidEmail: number;
|
|
55
55
|
duplicateEmailInUpload: number;
|
|
56
56
|
groups?: Record<string, number> | undefined;
|
|
@@ -63,9 +63,9 @@ export declare const outreachCallables: {
|
|
|
63
63
|
urn?: string | undefined;
|
|
64
64
|
}[];
|
|
65
65
|
added: number;
|
|
66
|
-
noEmail: number;
|
|
67
66
|
updated: number;
|
|
68
67
|
keptStatus: number;
|
|
68
|
+
noEmail: number;
|
|
69
69
|
invalidEmail: number;
|
|
70
70
|
duplicateEmailInUpload: number;
|
|
71
71
|
groups?: Record<string, number> | undefined;
|
|
@@ -170,8 +170,8 @@ export declare const outreachCallables: {
|
|
|
170
170
|
email: string;
|
|
171
171
|
organisation: string;
|
|
172
172
|
assignee: string;
|
|
173
|
-
wex?: boolean | undefined;
|
|
174
173
|
events?: boolean | undefined;
|
|
174
|
+
wex?: boolean | undefined;
|
|
175
175
|
docCheck?: boolean | undefined;
|
|
176
176
|
forename?: string | undefined;
|
|
177
177
|
surname?: string | undefined;
|
|
@@ -181,8 +181,8 @@ export declare const outreachCallables: {
|
|
|
181
181
|
email: string;
|
|
182
182
|
organisation: string;
|
|
183
183
|
assignee: string;
|
|
184
|
-
wex?: boolean | undefined;
|
|
185
184
|
events?: boolean | undefined;
|
|
185
|
+
wex?: boolean | undefined;
|
|
186
186
|
docCheck?: boolean | undefined;
|
|
187
187
|
forename?: string | undefined;
|
|
188
188
|
surname?: string | undefined;
|
|
@@ -194,8 +194,8 @@ export declare const outreachCallables: {
|
|
|
194
194
|
email: string;
|
|
195
195
|
organisation: string;
|
|
196
196
|
assignee: string;
|
|
197
|
-
wex?: boolean | undefined;
|
|
198
197
|
events?: boolean | undefined;
|
|
198
|
+
wex?: boolean | undefined;
|
|
199
199
|
docCheck?: boolean | undefined;
|
|
200
200
|
forename?: string | undefined;
|
|
201
201
|
surname?: string | undefined;
|
|
@@ -208,8 +208,8 @@ export declare const outreachCallables: {
|
|
|
208
208
|
email: string;
|
|
209
209
|
organisation: string;
|
|
210
210
|
assignee: string;
|
|
211
|
-
wex?: boolean | undefined;
|
|
212
211
|
events?: boolean | undefined;
|
|
212
|
+
wex?: boolean | undefined;
|
|
213
213
|
docCheck?: boolean | undefined;
|
|
214
214
|
forename?: string | undefined;
|
|
215
215
|
surname?: string | undefined;
|