waha-shared 1.0.531 → 1.0.532-orpc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/content.d.ts +368 -0
- package/dist/contract/content.js +65 -0
- package/dist/contract/donations.d.ts +58 -0
- package/dist/contract/donations.js +46 -0
- package/dist/contract/errors.d.ts +55 -0
- package/dist/contract/errors.js +60 -0
- package/dist/contract/fields.d.ts +11 -0
- package/dist/contract/fields.js +18 -0
- package/dist/contract/forms.d.ts +287 -0
- package/dist/contract/forms.js +105 -0
- package/dist/contract/index.d.ts +630 -0
- package/dist/contract/index.js +19 -0
- package/dist/contract/procedure.d.ts +127 -0
- package/dist/contract/procedure.js +47 -0
- package/dist/contract/resend.d.ts +193 -0
- package/dist/contract/resend.js +73 -0
- package/dist/data/bibleAudios/bibleAudios.zod.d.ts +3 -3
- package/dist/data/bibleAudios/index.d.ts +1 -1
- package/dist/data/languages/index.d.ts +6 -6
- package/dist/data/languages/languages.zod.d.ts +7 -7
- package/dist/data/notification/index.d.ts +1 -1
- package/dist/functions/apiClient.d.ts +21 -0
- package/dist/functions/apiClient.js +46 -0
- package/dist/types/articles.d.ts +7 -65
- package/dist/types/articles.js +7 -8
- package/dist/types/bibleChapters.d.ts +1 -1
- package/dist/types/completions.d.ts +2 -2
- package/dist/types/logs.d.ts +6 -6
- package/dist/types/microLessons.d.ts +8 -97
- package/dist/types/microLessons.js +7 -8
- package/dist/types/resend.d.ts +0 -38
- package/dist/types/resend.js +1 -45
- package/dist/types/users.d.ts +14 -9
- package/dist/types/users.js +6 -1
- package/package.json +5 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Name = exports.Email = exports.QueryBoolean = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
/* Input fields shared by more than one procedure. */
|
|
9
|
+
/**
|
|
10
|
+
* A boolean query parameter. Query values arrive as strings, so `"false"`
|
|
11
|
+
* must parse as false (which `z.coerce.boolean()` gets wrong), while typed
|
|
12
|
+
* callers still pass a real boolean.
|
|
13
|
+
*/
|
|
14
|
+
exports.QueryBoolean = zod_1.default.union([zod_1.default.boolean(), zod_1.default.stringbool()]);
|
|
15
|
+
/** An email address someone typed into a form. */
|
|
16
|
+
exports.Email = zod_1.default.string().trim().pipe(zod_1.default.email());
|
|
17
|
+
/** A person's name as they typed it. */
|
|
18
|
+
exports.Name = zod_1.default.string().trim().max(200);
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A feedback form, with the fields that form asks for. The server adds who
|
|
4
|
+
* sent it (the ID token's uid), where from (Vercel's geolocation headers), and
|
|
5
|
+
* when, so none of those can be faked.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FeedbackBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
10
|
+
language: z.ZodString;
|
|
11
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
version: z.ZodString;
|
|
13
|
+
os: z.ZodEnum<{
|
|
14
|
+
web: "web";
|
|
15
|
+
ios: "ios";
|
|
16
|
+
android: "android";
|
|
17
|
+
}>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
form: z.ZodLiteral<"contact">;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
lessonId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
25
|
+
language: z.ZodString;
|
|
26
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
version: z.ZodString;
|
|
28
|
+
os: z.ZodEnum<{
|
|
29
|
+
web: "web";
|
|
30
|
+
ios: "ios";
|
|
31
|
+
android: "android";
|
|
32
|
+
}>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
form: z.ZodLiteral<"share-story">;
|
|
35
|
+
message: z.ZodString;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
39
|
+
language: z.ZodString;
|
|
40
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
version: z.ZodString;
|
|
42
|
+
os: z.ZodEnum<{
|
|
43
|
+
web: "web";
|
|
44
|
+
ios: "ios";
|
|
45
|
+
android: "android";
|
|
46
|
+
}>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
form: z.ZodLiteral<"code-request">;
|
|
49
|
+
journey: z.ZodEnum<{
|
|
50
|
+
question_god_journey_option_1: "question_god_journey_option_1";
|
|
51
|
+
question_god_journey_option_2: "question_god_journey_option_2";
|
|
52
|
+
question_god_journey_option_3: "question_god_journey_option_3";
|
|
53
|
+
question_god_journey_option_4: "question_god_journey_option_4";
|
|
54
|
+
}>;
|
|
55
|
+
goals: z.ZodString;
|
|
56
|
+
hear: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>], "form">;
|
|
58
|
+
export type FeedbackBody = z.infer<typeof FeedbackBody>;
|
|
59
|
+
export declare const VolunteerInvolvement: z.ZodEnum<{
|
|
60
|
+
"Language Sponsor": "Language Sponsor";
|
|
61
|
+
"Translation or content production": "Translation or content production";
|
|
62
|
+
"Start a fundraiser": "Start a fundraiser";
|
|
63
|
+
}>;
|
|
64
|
+
export declare const DmmFamiliarity: z.ZodEnum<{
|
|
65
|
+
"I'm not sure": "I'm not sure";
|
|
66
|
+
"I am trying to mobilize prayer and engage the lost": "I am trying to mobilize prayer and engage the lost";
|
|
67
|
+
"I have started a few discovery groups or churches": "I have started a few discovery groups or churches";
|
|
68
|
+
"I have started 2-3 generations of discovery groups or churches": "I have started 2-3 generations of discovery groups or churches";
|
|
69
|
+
"I have over 4 generations of discovery groups or churches": "I have over 4 generations of discovery groups or churches";
|
|
70
|
+
}>;
|
|
71
|
+
/** A website add-your-language form, as saved to `volunteers`. */
|
|
72
|
+
export declare const VolunteerFormBody: z.ZodObject<{
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
75
|
+
languages: z.ZodString;
|
|
76
|
+
involvement: z.ZodEnum<{
|
|
77
|
+
"Language Sponsor": "Language Sponsor";
|
|
78
|
+
"Translation or content production": "Translation or content production";
|
|
79
|
+
"Start a fundraiser": "Start a fundraiser";
|
|
80
|
+
}>;
|
|
81
|
+
dmm_familiarity: z.ZodEnum<{
|
|
82
|
+
"I'm not sure": "I'm not sure";
|
|
83
|
+
"I am trying to mobilize prayer and engage the lost": "I am trying to mobilize prayer and engage the lost";
|
|
84
|
+
"I have started a few discovery groups or churches": "I have started a few discovery groups or churches";
|
|
85
|
+
"I have started 2-3 generations of discovery groups or churches": "I have started 2-3 generations of discovery groups or churches";
|
|
86
|
+
"I have over 4 generations of discovery groups or churches": "I have over 4 generations of discovery groups or churches";
|
|
87
|
+
}>;
|
|
88
|
+
anything_else: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type VolunteerFormBody = z.infer<typeof VolunteerFormBody>;
|
|
91
|
+
export declare const forms: {
|
|
92
|
+
feedback: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
95
|
+
language: z.ZodString;
|
|
96
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
version: z.ZodString;
|
|
98
|
+
os: z.ZodEnum<{
|
|
99
|
+
web: "web";
|
|
100
|
+
ios: "ios";
|
|
101
|
+
android: "android";
|
|
102
|
+
}>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
form: z.ZodLiteral<"contact">;
|
|
105
|
+
message: z.ZodString;
|
|
106
|
+
lessonId: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
110
|
+
language: z.ZodString;
|
|
111
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
version: z.ZodString;
|
|
113
|
+
os: z.ZodEnum<{
|
|
114
|
+
web: "web";
|
|
115
|
+
ios: "ios";
|
|
116
|
+
android: "android";
|
|
117
|
+
}>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
form: z.ZodLiteral<"share-story">;
|
|
120
|
+
message: z.ZodString;
|
|
121
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
+
name: z.ZodString;
|
|
123
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
124
|
+
language: z.ZodString;
|
|
125
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
version: z.ZodString;
|
|
127
|
+
os: z.ZodEnum<{
|
|
128
|
+
web: "web";
|
|
129
|
+
ios: "ios";
|
|
130
|
+
android: "android";
|
|
131
|
+
}>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
form: z.ZodLiteral<"code-request">;
|
|
134
|
+
journey: z.ZodEnum<{
|
|
135
|
+
question_god_journey_option_1: "question_god_journey_option_1";
|
|
136
|
+
question_god_journey_option_2: "question_god_journey_option_2";
|
|
137
|
+
question_god_journey_option_3: "question_god_journey_option_3";
|
|
138
|
+
question_god_journey_option_4: "question_god_journey_option_4";
|
|
139
|
+
}>;
|
|
140
|
+
goals: z.ZodString;
|
|
141
|
+
hear: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>], "form">, z.ZodVoid, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
143
|
+
BAD_REQUEST: {
|
|
144
|
+
status: number;
|
|
145
|
+
data: z.ZodObject<{
|
|
146
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
147
|
+
message: z.ZodString;
|
|
148
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
};
|
|
152
|
+
}>, {
|
|
153
|
+
UNAUTHORIZED: {
|
|
154
|
+
status: number;
|
|
155
|
+
data: z.ZodObject<{
|
|
156
|
+
reason: z.ZodEnum<{
|
|
157
|
+
missing_credentials: "missing_credentials";
|
|
158
|
+
invalid_token: "invalid_token";
|
|
159
|
+
}>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
};
|
|
162
|
+
CAPTCHA_FAILED: {
|
|
163
|
+
status: number;
|
|
164
|
+
};
|
|
165
|
+
UPSTREAM_FAILED: {
|
|
166
|
+
status: number;
|
|
167
|
+
data: z.ZodObject<{
|
|
168
|
+
service: z.ZodEnum<{
|
|
169
|
+
resend: "resend";
|
|
170
|
+
stripe: "stripe";
|
|
171
|
+
firestore: "firestore";
|
|
172
|
+
recaptcha: "recaptcha";
|
|
173
|
+
storage: "storage";
|
|
174
|
+
}>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
};
|
|
177
|
+
}>, {
|
|
178
|
+
UPSTREAM_FAILED: {
|
|
179
|
+
status: number;
|
|
180
|
+
data: z.ZodObject<{
|
|
181
|
+
service: z.ZodEnum<{
|
|
182
|
+
resend: "resend";
|
|
183
|
+
stripe: "stripe";
|
|
184
|
+
firestore: "firestore";
|
|
185
|
+
recaptcha: "recaptcha";
|
|
186
|
+
storage: "storage";
|
|
187
|
+
}>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
};
|
|
190
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
191
|
+
volunteer: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
194
|
+
languages: z.ZodString;
|
|
195
|
+
involvement: z.ZodEnum<{
|
|
196
|
+
"Language Sponsor": "Language Sponsor";
|
|
197
|
+
"Translation or content production": "Translation or content production";
|
|
198
|
+
"Start a fundraiser": "Start a fundraiser";
|
|
199
|
+
}>;
|
|
200
|
+
dmm_familiarity: z.ZodEnum<{
|
|
201
|
+
"I'm not sure": "I'm not sure";
|
|
202
|
+
"I am trying to mobilize prayer and engage the lost": "I am trying to mobilize prayer and engage the lost";
|
|
203
|
+
"I have started a few discovery groups or churches": "I have started a few discovery groups or churches";
|
|
204
|
+
"I have started 2-3 generations of discovery groups or churches": "I have started 2-3 generations of discovery groups or churches";
|
|
205
|
+
"I have over 4 generations of discovery groups or churches": "I have over 4 generations of discovery groups or churches";
|
|
206
|
+
}>;
|
|
207
|
+
anything_else: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>, z.ZodVoid, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
209
|
+
BAD_REQUEST: {
|
|
210
|
+
status: number;
|
|
211
|
+
data: z.ZodObject<{
|
|
212
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
213
|
+
message: z.ZodString;
|
|
214
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
};
|
|
218
|
+
}>, {
|
|
219
|
+
UNAUTHORIZED: {
|
|
220
|
+
status: number;
|
|
221
|
+
data: z.ZodObject<{
|
|
222
|
+
reason: z.ZodEnum<{
|
|
223
|
+
missing_credentials: "missing_credentials";
|
|
224
|
+
invalid_token: "invalid_token";
|
|
225
|
+
}>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
};
|
|
228
|
+
CAPTCHA_FAILED: {
|
|
229
|
+
status: number;
|
|
230
|
+
};
|
|
231
|
+
UPSTREAM_FAILED: {
|
|
232
|
+
status: number;
|
|
233
|
+
data: z.ZodObject<{
|
|
234
|
+
service: z.ZodEnum<{
|
|
235
|
+
resend: "resend";
|
|
236
|
+
stripe: "stripe";
|
|
237
|
+
firestore: "firestore";
|
|
238
|
+
recaptcha: "recaptcha";
|
|
239
|
+
storage: "storage";
|
|
240
|
+
}>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
};
|
|
243
|
+
}>, {
|
|
244
|
+
UPSTREAM_FAILED: {
|
|
245
|
+
status: number;
|
|
246
|
+
data: z.ZodObject<{
|
|
247
|
+
service: z.ZodEnum<{
|
|
248
|
+
resend: "resend";
|
|
249
|
+
stripe: "stripe";
|
|
250
|
+
firestore: "firestore";
|
|
251
|
+
recaptcha: "recaptcha";
|
|
252
|
+
storage: "storage";
|
|
253
|
+
}>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
};
|
|
256
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
257
|
+
microLesson: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
258
|
+
languageId: z.ZodString;
|
|
259
|
+
campaign: z.ZodOptional<z.ZodString>;
|
|
260
|
+
microLessonId: z.ZodString;
|
|
261
|
+
microLessonTitle: z.ZodString;
|
|
262
|
+
timeStarted: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>, z.ZodVoid, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
264
|
+
BAD_REQUEST: {
|
|
265
|
+
status: number;
|
|
266
|
+
data: z.ZodObject<{
|
|
267
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
268
|
+
message: z.ZodString;
|
|
269
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
};
|
|
273
|
+
}>, {
|
|
274
|
+
UPSTREAM_FAILED: {
|
|
275
|
+
status: number;
|
|
276
|
+
data: z.ZodObject<{
|
|
277
|
+
service: z.ZodEnum<{
|
|
278
|
+
resend: "resend";
|
|
279
|
+
stripe: "stripe";
|
|
280
|
+
firestore: "firestore";
|
|
281
|
+
recaptcha: "recaptcha";
|
|
282
|
+
storage: "storage";
|
|
283
|
+
}>;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
};
|
|
286
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
287
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.forms = exports.VolunteerFormBody = exports.DmmFamiliarity = exports.VolunteerInvolvement = exports.FeedbackBody = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const languages_zod_1 = require("../data/languages/languages.zod");
|
|
9
|
+
const feedback_1 = require("../functions/feedback");
|
|
10
|
+
const microLessons_1 = require("../types/microLessons");
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
const fields_1 = require("./fields");
|
|
13
|
+
const procedure_1 = require("./procedure");
|
|
14
|
+
const FeedbackFields = zod_1.default.object({
|
|
15
|
+
name: fields_1.Name.min(1),
|
|
16
|
+
email: fields_1.Email,
|
|
17
|
+
/** The language the person was using Waha in. */
|
|
18
|
+
language: languages_zod_1.LanguageId,
|
|
19
|
+
/** Sent by the app, and left out by the website. */
|
|
20
|
+
app: zod_1.default
|
|
21
|
+
.object({ version: zod_1.default.string(), os: zod_1.default.enum(['ios', 'android', 'web']) })
|
|
22
|
+
.optional(),
|
|
23
|
+
});
|
|
24
|
+
const Message = zod_1.default.string().trim().min(1).max(5000);
|
|
25
|
+
/**
|
|
26
|
+
* A feedback form, with the fields that form asks for. The server adds who
|
|
27
|
+
* sent it (the ID token's uid), where from (Vercel's geolocation headers), and
|
|
28
|
+
* when, so none of those can be faked.
|
|
29
|
+
*/
|
|
30
|
+
exports.FeedbackBody = zod_1.default.discriminatedUnion('form', [
|
|
31
|
+
FeedbackFields.extend({
|
|
32
|
+
form: zod_1.default.literal('contact'),
|
|
33
|
+
message: Message,
|
|
34
|
+
/** The lesson the app's contact screen was opened from. */
|
|
35
|
+
lessonId: zod_1.default.string().optional(),
|
|
36
|
+
}),
|
|
37
|
+
FeedbackFields.extend({ form: zod_1.default.literal('share-story'), message: Message }),
|
|
38
|
+
FeedbackFields.extend({
|
|
39
|
+
form: zod_1.default.literal('code-request'),
|
|
40
|
+
journey: zod_1.default.enum(feedback_1.JOURNEY_OPTION_KEYS),
|
|
41
|
+
goals: zod_1.default.string().trim().min(1).max(1000),
|
|
42
|
+
hear: zod_1.default.string().trim().max(1000).optional(),
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
/**
|
|
46
|
+
* Saves a feedback form from the app or the website to the `feedback`
|
|
47
|
+
* collection, as a `Feedback` document. Each form and sender keeps the
|
|
48
|
+
* `formName` it has always been stored with, because the Attio sync groups
|
|
49
|
+
* submissions by it: `contact` (app), `contact-website`,
|
|
50
|
+
* `share-story-website`, and `code_request`.
|
|
51
|
+
*/
|
|
52
|
+
const feedback = procedure_1.procedure
|
|
53
|
+
.route({ method: 'POST', path: '/feedback' })
|
|
54
|
+
.errors({ UPSTREAM_FAILED: errors_1.UPSTREAM_FAILED })
|
|
55
|
+
.input(exports.FeedbackBody)
|
|
56
|
+
.output(zod_1.default.void());
|
|
57
|
+
/*
|
|
58
|
+
* The add-your-language form's choices. They're stored as these English
|
|
59
|
+
* strings, so changing one splits it in the `volunteers` collection.
|
|
60
|
+
*/
|
|
61
|
+
exports.VolunteerInvolvement = zod_1.default.enum([
|
|
62
|
+
'Language Sponsor',
|
|
63
|
+
'Translation or content production',
|
|
64
|
+
'Start a fundraiser',
|
|
65
|
+
]);
|
|
66
|
+
exports.DmmFamiliarity = zod_1.default.enum([
|
|
67
|
+
"I'm not sure",
|
|
68
|
+
'I am trying to mobilize prayer and engage the lost',
|
|
69
|
+
'I have started a few discovery groups or churches',
|
|
70
|
+
'I have started 2-3 generations of discovery groups or churches',
|
|
71
|
+
'I have over 4 generations of discovery groups or churches',
|
|
72
|
+
]);
|
|
73
|
+
/** A website add-your-language form, as saved to `volunteers`. */
|
|
74
|
+
exports.VolunteerFormBody = zod_1.default.object({
|
|
75
|
+
name: fields_1.Name.min(1),
|
|
76
|
+
email: fields_1.Email,
|
|
77
|
+
/** Free text: the languages they'd like to see in Waha. */
|
|
78
|
+
languages: zod_1.default.string().trim().min(1).max(1000),
|
|
79
|
+
involvement: exports.VolunteerInvolvement,
|
|
80
|
+
dmm_familiarity: exports.DmmFamiliarity,
|
|
81
|
+
anything_else: zod_1.default.string().trim().max(5000).optional(),
|
|
82
|
+
});
|
|
83
|
+
/** Saves a website add-your-language form to the `volunteers` collection. */
|
|
84
|
+
const volunteer = procedure_1.procedure
|
|
85
|
+
.route({ method: 'POST', path: '/submit-volunteer' })
|
|
86
|
+
.errors({ UPSTREAM_FAILED: errors_1.UPSTREAM_FAILED })
|
|
87
|
+
.input(exports.VolunteerFormBody)
|
|
88
|
+
.output(zod_1.default.void());
|
|
89
|
+
/**
|
|
90
|
+
* Saves a completed micro-lesson from the website. The server fills in the
|
|
91
|
+
* rest of the {@link MicroLessonSubmission}: who, where, and when.
|
|
92
|
+
*/
|
|
93
|
+
// Public: the worst abuse is junk analytics, which isn't worth a captcha.
|
|
94
|
+
const microLesson = procedure_1.publicProcedure
|
|
95
|
+
.route({ method: 'POST', path: '/submit-micro-lesson' })
|
|
96
|
+
.errors({ UPSTREAM_FAILED: errors_1.UPSTREAM_FAILED })
|
|
97
|
+
.input(microLessons_1.MicroLessonSubmission.pick({
|
|
98
|
+
microLessonId: true,
|
|
99
|
+
microLessonTitle: true,
|
|
100
|
+
languageId: true,
|
|
101
|
+
campaign: true,
|
|
102
|
+
timeStarted: true,
|
|
103
|
+
}))
|
|
104
|
+
.output(zod_1.default.void());
|
|
105
|
+
exports.forms = { feedback, volunteer, microLesson };
|