waha-shared 1.0.529 → 1.0.531-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 +629 -0
- package/dist/contract/index.js +19 -0
- package/dist/contract/procedure.d.ts +98 -0
- package/dist/contract/procedure.js +41 -0
- package/dist/contract/resend.d.ts +192 -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/data/releaseNotes/releaseNotes.json +51 -2
- 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,368 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/** The ids of the languages that have content of a kind. */
|
|
3
|
+
export declare const ContentLanguagesResponse: z.ZodObject<{
|
|
4
|
+
data: z.ZodArray<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type ContentLanguagesResponse = z.infer<typeof ContentLanguagesResponse>;
|
|
7
|
+
export declare const ArticlesResponse: z.ZodObject<{
|
|
8
|
+
data: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
data: z.ZodObject<{
|
|
11
|
+
title: z.ZodString;
|
|
12
|
+
author: z.ZodOptional<z.ZodString>;
|
|
13
|
+
category: z.ZodEnum<{
|
|
14
|
+
"Case Studies": "Case Studies";
|
|
15
|
+
"Discovering God": "Discovering God";
|
|
16
|
+
"Disciple Making Secrets": "Disciple Making Secrets";
|
|
17
|
+
"Product Updates": "Product Updates";
|
|
18
|
+
Books: "Books";
|
|
19
|
+
Films: "Films";
|
|
20
|
+
"How Tos": "How Tos";
|
|
21
|
+
"Mengenali Tuhan": "Mengenali Tuhan";
|
|
22
|
+
"\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
|
|
23
|
+
"\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
|
|
24
|
+
"Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
|
|
25
|
+
"Historias de la vida real": "Historias de la vida real";
|
|
26
|
+
"Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
|
|
27
|
+
"Descubriendo a Dios": "Descubriendo a Dios";
|
|
28
|
+
}>;
|
|
29
|
+
image: z.ZodOptional<z.ZodString>;
|
|
30
|
+
date: z.ZodCoercedDate<unknown>;
|
|
31
|
+
isDraft: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
seekerFriendly: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
platform: z.ZodEnum<{
|
|
34
|
+
"Web Only": "Web Only";
|
|
35
|
+
"App Only": "App Only";
|
|
36
|
+
All: "All";
|
|
37
|
+
}>;
|
|
38
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
audioUrl: z.ZodString;
|
|
40
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
videoUrl: z.ZodString;
|
|
44
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
disableControls: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
impactStoryRegion: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
"North America": "North America";
|
|
51
|
+
"Latin America and the Caribbean": "Latin America and the Caribbean";
|
|
52
|
+
"Middle East/North Africa": "Middle East/North Africa";
|
|
53
|
+
"Sub-Saharan Africa": "Sub-Saharan Africa";
|
|
54
|
+
"Western Europe": "Western Europe";
|
|
55
|
+
"Eastern Europe": "Eastern Europe";
|
|
56
|
+
"Western Asia": "Western Asia";
|
|
57
|
+
"Southern Asia": "Southern Asia";
|
|
58
|
+
"Central Asia": "Central Asia";
|
|
59
|
+
"Southeast Asia": "Southeast Asia";
|
|
60
|
+
"Eastern Asia": "Eastern Asia";
|
|
61
|
+
Oceania: "Oceania";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
body: z.ZodString;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type ArticlesResponse = z.infer<typeof ArticlesResponse>;
|
|
68
|
+
export declare const MicroLessonsResponse: z.ZodObject<{
|
|
69
|
+
data: z.ZodArray<z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
data: z.ZodObject<{
|
|
72
|
+
title: z.ZodString;
|
|
73
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
74
|
+
date: z.ZodCoercedDate<unknown>;
|
|
75
|
+
isDraft: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
seekerFriendly: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
platform: z.ZodEnum<{
|
|
78
|
+
"Web Only": "Web Only";
|
|
79
|
+
"App Only": "App Only";
|
|
80
|
+
All: "All";
|
|
81
|
+
}>;
|
|
82
|
+
image: z.ZodString;
|
|
83
|
+
category: z.ZodEnum<{
|
|
84
|
+
"Case Studies": "Case Studies";
|
|
85
|
+
"Discovering God": "Discovering God";
|
|
86
|
+
"Disciple Making Secrets": "Disciple Making Secrets";
|
|
87
|
+
"Product Updates": "Product Updates";
|
|
88
|
+
Books: "Books";
|
|
89
|
+
Films: "Films";
|
|
90
|
+
"How Tos": "How Tos";
|
|
91
|
+
"Mengenali Tuhan": "Mengenali Tuhan";
|
|
92
|
+
"\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
|
|
93
|
+
"\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
|
|
94
|
+
"Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
|
|
95
|
+
"Historias de la vida real": "Historias de la vida real";
|
|
96
|
+
"Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
|
|
97
|
+
"Descubriendo a Dios": "Descubriendo a Dios";
|
|
98
|
+
}>;
|
|
99
|
+
campaign: z.ZodOptional<z.ZodString>;
|
|
100
|
+
impactStoryRegion: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
"North America": "North America";
|
|
102
|
+
"Latin America and the Caribbean": "Latin America and the Caribbean";
|
|
103
|
+
"Middle East/North Africa": "Middle East/North Africa";
|
|
104
|
+
"Sub-Saharan Africa": "Sub-Saharan Africa";
|
|
105
|
+
"Western Europe": "Western Europe";
|
|
106
|
+
"Eastern Europe": "Eastern Europe";
|
|
107
|
+
"Western Asia": "Western Asia";
|
|
108
|
+
"Southern Asia": "Southern Asia";
|
|
109
|
+
"Central Asia": "Central Asia";
|
|
110
|
+
"Southeast Asia": "Southeast Asia";
|
|
111
|
+
"Eastern Asia": "Eastern Asia";
|
|
112
|
+
Oceania: "Oceania";
|
|
113
|
+
}>>;
|
|
114
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
115
|
+
heading: z.ZodString;
|
|
116
|
+
body: z.ZodOptional<z.ZodString>;
|
|
117
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
118
|
+
image: z.ZodOptional<z.ZodString>;
|
|
119
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
audioUrl: z.ZodString;
|
|
121
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
videoUrl: z.ZodString;
|
|
125
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
disableControls: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
textInput: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
show: z.ZodBoolean;
|
|
132
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
133
|
+
showCopyButton: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
prefilledText: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
ctaButton: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
show: z.ZodBoolean;
|
|
138
|
+
label: z.ZodString;
|
|
139
|
+
href: z.ZodString;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
radioButtons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
heading: z.ZodOptional<z.ZodString>;
|
|
143
|
+
body: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>>;
|
|
145
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
"Web Only": "Web Only";
|
|
147
|
+
"App Only": "App Only";
|
|
148
|
+
All: "All";
|
|
149
|
+
}>>;
|
|
150
|
+
notification: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
title: z.ZodString;
|
|
152
|
+
body: z.ZodString;
|
|
153
|
+
delayInHours: z.ZodNumber;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type MicroLessonsResponse = z.infer<typeof MicroLessonsResponse>;
|
|
160
|
+
export declare const content: {
|
|
161
|
+
articleLanguages: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
162
|
+
'include-drafts': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
data: z.ZodArray<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
166
|
+
BAD_REQUEST: {
|
|
167
|
+
status: number;
|
|
168
|
+
data: z.ZodObject<{
|
|
169
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
170
|
+
message: z.ZodString;
|
|
171
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
};
|
|
175
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
176
|
+
articles: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
177
|
+
'include-drafts': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
|
|
178
|
+
languageId: z.ZodString;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
data: z.ZodArray<z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
data: z.ZodObject<{
|
|
183
|
+
title: z.ZodString;
|
|
184
|
+
author: z.ZodOptional<z.ZodString>;
|
|
185
|
+
category: z.ZodEnum<{
|
|
186
|
+
"Case Studies": "Case Studies";
|
|
187
|
+
"Discovering God": "Discovering God";
|
|
188
|
+
"Disciple Making Secrets": "Disciple Making Secrets";
|
|
189
|
+
"Product Updates": "Product Updates";
|
|
190
|
+
Books: "Books";
|
|
191
|
+
Films: "Films";
|
|
192
|
+
"How Tos": "How Tos";
|
|
193
|
+
"Mengenali Tuhan": "Mengenali Tuhan";
|
|
194
|
+
"\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
|
|
195
|
+
"\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
|
|
196
|
+
"Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
|
|
197
|
+
"Historias de la vida real": "Historias de la vida real";
|
|
198
|
+
"Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
|
|
199
|
+
"Descubriendo a Dios": "Descubriendo a Dios";
|
|
200
|
+
}>;
|
|
201
|
+
image: z.ZodOptional<z.ZodString>;
|
|
202
|
+
date: z.ZodCoercedDate<unknown>;
|
|
203
|
+
isDraft: z.ZodOptional<z.ZodBoolean>;
|
|
204
|
+
seekerFriendly: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
platform: z.ZodEnum<{
|
|
206
|
+
"Web Only": "Web Only";
|
|
207
|
+
"App Only": "App Only";
|
|
208
|
+
All: "All";
|
|
209
|
+
}>;
|
|
210
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
audioUrl: z.ZodString;
|
|
212
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
videoUrl: z.ZodString;
|
|
216
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
218
|
+
disableControls: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
impactStoryRegion: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
"North America": "North America";
|
|
223
|
+
"Latin America and the Caribbean": "Latin America and the Caribbean";
|
|
224
|
+
"Middle East/North Africa": "Middle East/North Africa";
|
|
225
|
+
"Sub-Saharan Africa": "Sub-Saharan Africa";
|
|
226
|
+
"Western Europe": "Western Europe";
|
|
227
|
+
"Eastern Europe": "Eastern Europe";
|
|
228
|
+
"Western Asia": "Western Asia";
|
|
229
|
+
"Southern Asia": "Southern Asia";
|
|
230
|
+
"Central Asia": "Central Asia";
|
|
231
|
+
"Southeast Asia": "Southeast Asia";
|
|
232
|
+
"Eastern Asia": "Eastern Asia";
|
|
233
|
+
Oceania: "Oceania";
|
|
234
|
+
}>>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
body: z.ZodString;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
239
|
+
BAD_REQUEST: {
|
|
240
|
+
status: number;
|
|
241
|
+
data: z.ZodObject<{
|
|
242
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
243
|
+
message: z.ZodString;
|
|
244
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
};
|
|
248
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
249
|
+
microLessonLanguages: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
250
|
+
'include-drafts': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
|
|
251
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
252
|
+
data: z.ZodArray<z.ZodString>;
|
|
253
|
+
}, z.core.$strip>, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
254
|
+
BAD_REQUEST: {
|
|
255
|
+
status: number;
|
|
256
|
+
data: z.ZodObject<{
|
|
257
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
258
|
+
message: z.ZodString;
|
|
259
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
};
|
|
263
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
264
|
+
microLessons: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
265
|
+
'include-drafts': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
|
|
266
|
+
languageId: z.ZodString;
|
|
267
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
+
data: z.ZodArray<z.ZodObject<{
|
|
269
|
+
id: z.ZodString;
|
|
270
|
+
data: z.ZodObject<{
|
|
271
|
+
title: z.ZodString;
|
|
272
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
273
|
+
date: z.ZodCoercedDate<unknown>;
|
|
274
|
+
isDraft: z.ZodOptional<z.ZodBoolean>;
|
|
275
|
+
seekerFriendly: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
+
platform: z.ZodEnum<{
|
|
277
|
+
"Web Only": "Web Only";
|
|
278
|
+
"App Only": "App Only";
|
|
279
|
+
All: "All";
|
|
280
|
+
}>;
|
|
281
|
+
image: z.ZodString;
|
|
282
|
+
category: z.ZodEnum<{
|
|
283
|
+
"Case Studies": "Case Studies";
|
|
284
|
+
"Discovering God": "Discovering God";
|
|
285
|
+
"Disciple Making Secrets": "Disciple Making Secrets";
|
|
286
|
+
"Product Updates": "Product Updates";
|
|
287
|
+
Books: "Books";
|
|
288
|
+
Films: "Films";
|
|
289
|
+
"How Tos": "How Tos";
|
|
290
|
+
"Mengenali Tuhan": "Mengenali Tuhan";
|
|
291
|
+
"\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
|
|
292
|
+
"\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
|
|
293
|
+
"Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
|
|
294
|
+
"Historias de la vida real": "Historias de la vida real";
|
|
295
|
+
"Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
|
|
296
|
+
"Descubriendo a Dios": "Descubriendo a Dios";
|
|
297
|
+
}>;
|
|
298
|
+
campaign: z.ZodOptional<z.ZodString>;
|
|
299
|
+
impactStoryRegion: z.ZodOptional<z.ZodEnum<{
|
|
300
|
+
"North America": "North America";
|
|
301
|
+
"Latin America and the Caribbean": "Latin America and the Caribbean";
|
|
302
|
+
"Middle East/North Africa": "Middle East/North Africa";
|
|
303
|
+
"Sub-Saharan Africa": "Sub-Saharan Africa";
|
|
304
|
+
"Western Europe": "Western Europe";
|
|
305
|
+
"Eastern Europe": "Eastern Europe";
|
|
306
|
+
"Western Asia": "Western Asia";
|
|
307
|
+
"Southern Asia": "Southern Asia";
|
|
308
|
+
"Central Asia": "Central Asia";
|
|
309
|
+
"Southeast Asia": "Southeast Asia";
|
|
310
|
+
"Eastern Asia": "Eastern Asia";
|
|
311
|
+
Oceania: "Oceania";
|
|
312
|
+
}>>;
|
|
313
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
314
|
+
heading: z.ZodString;
|
|
315
|
+
body: z.ZodOptional<z.ZodString>;
|
|
316
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
317
|
+
image: z.ZodOptional<z.ZodString>;
|
|
318
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
319
|
+
audioUrl: z.ZodString;
|
|
320
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
321
|
+
}, z.core.$strip>>;
|
|
322
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
videoUrl: z.ZodString;
|
|
324
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
325
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
disableControls: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
328
|
+
}, z.core.$strip>>;
|
|
329
|
+
textInput: z.ZodOptional<z.ZodObject<{
|
|
330
|
+
show: z.ZodBoolean;
|
|
331
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
332
|
+
showCopyButton: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
prefilledText: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, z.core.$strip>>;
|
|
335
|
+
ctaButton: z.ZodOptional<z.ZodObject<{
|
|
336
|
+
show: z.ZodBoolean;
|
|
337
|
+
label: z.ZodString;
|
|
338
|
+
href: z.ZodString;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
radioButtons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
341
|
+
heading: z.ZodOptional<z.ZodString>;
|
|
342
|
+
body: z.ZodOptional<z.ZodString>;
|
|
343
|
+
}, z.core.$strip>>>;
|
|
344
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
345
|
+
"Web Only": "Web Only";
|
|
346
|
+
"App Only": "App Only";
|
|
347
|
+
All: "All";
|
|
348
|
+
}>>;
|
|
349
|
+
notification: z.ZodOptional<z.ZodObject<{
|
|
350
|
+
title: z.ZodString;
|
|
351
|
+
body: z.ZodString;
|
|
352
|
+
delayInHours: z.ZodNumber;
|
|
353
|
+
}, z.core.$strip>>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
}, z.core.$strip>>;
|
|
357
|
+
}, z.core.$strip>, import("@orpc/contract", { with: { "resolution-mode": "import" } }).MergedErrorMap<Record<never, never>, {
|
|
358
|
+
BAD_REQUEST: {
|
|
359
|
+
status: number;
|
|
360
|
+
data: z.ZodObject<{
|
|
361
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
362
|
+
message: z.ZodString;
|
|
363
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
364
|
+
}, z.core.$strip>>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
};
|
|
367
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
368
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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.content = exports.MicroLessonsResponse = exports.ArticlesResponse = exports.ContentLanguagesResponse = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const languages_zod_1 = require("../data/languages/languages.zod");
|
|
9
|
+
const articles_1 = require("../types/articles");
|
|
10
|
+
const microLessons_1 = require("../types/microLessons");
|
|
11
|
+
const fields_1 = require("./fields");
|
|
12
|
+
const procedure_1 = require("./procedure");
|
|
13
|
+
/*
|
|
14
|
+
* Read-only content for the app, served by the website from its content
|
|
15
|
+
* collections. Public, because the same content is on the website and shipped
|
|
16
|
+
* app versions send no credentials. The query parameter keeps its kebab-case
|
|
17
|
+
* name because shipped app versions send it.
|
|
18
|
+
*
|
|
19
|
+
* Shipped app versions parse these responses with their own copies of
|
|
20
|
+
* `ArticleEntry` and `MicroLessonEntry` (named `ResponseArticle` and
|
|
21
|
+
* `ResponseMicroLesson` through 9.4.0), which ignore unknown keys. So those
|
|
22
|
+
* schemas, and the `Article` and `MicroLesson` inside them, can gain
|
|
23
|
+
* optional fields, but can't drop a field or make one required while a
|
|
24
|
+
* shipped version still requires it. The output schemas here stripping
|
|
25
|
+
* unknown keys doesn't break this: the website's collections are parsed with
|
|
26
|
+
* the same `Article` and `MicroLesson`, so the only keys stripped are Astro's
|
|
27
|
+
* own entry fields (`filePath`, `digest`, `rendered`, `collection`), which no
|
|
28
|
+
* version reads.
|
|
29
|
+
*/
|
|
30
|
+
const ContentQuery = zod_1.default.object({
|
|
31
|
+
/** Includes drafts, which only the test website serves. */
|
|
32
|
+
'include-drafts': fields_1.QueryBoolean.optional(),
|
|
33
|
+
});
|
|
34
|
+
/** The ids of the languages that have content of a kind. */
|
|
35
|
+
exports.ContentLanguagesResponse = zod_1.default.object({ data: zod_1.default.array(zod_1.default.string()) });
|
|
36
|
+
exports.ArticlesResponse = zod_1.default.object({ data: zod_1.default.array(articles_1.ArticleEntry) });
|
|
37
|
+
exports.MicroLessonsResponse = zod_1.default.object({
|
|
38
|
+
data: zod_1.default.array(microLessons_1.MicroLessonEntry),
|
|
39
|
+
});
|
|
40
|
+
/** The languages that have at least one app article. */
|
|
41
|
+
const articleLanguages = procedure_1.publicProcedure
|
|
42
|
+
.route({ method: 'GET', path: '/article-languages' })
|
|
43
|
+
.input(ContentQuery)
|
|
44
|
+
.output(exports.ContentLanguagesResponse);
|
|
45
|
+
/** A language's app articles. */
|
|
46
|
+
const articles = procedure_1.publicProcedure
|
|
47
|
+
.route({ method: 'GET', path: '/{languageId}/articles' })
|
|
48
|
+
.input(ContentQuery.extend({ languageId: languages_zod_1.LanguageId }))
|
|
49
|
+
.output(exports.ArticlesResponse);
|
|
50
|
+
/** The languages that have at least one micro-lesson. */
|
|
51
|
+
const microLessonLanguages = procedure_1.publicProcedure
|
|
52
|
+
.route({ method: 'GET', path: '/micro-lessons-languages' })
|
|
53
|
+
.input(ContentQuery)
|
|
54
|
+
.output(exports.ContentLanguagesResponse);
|
|
55
|
+
/** A language's app micro-lessons. */
|
|
56
|
+
const microLessons = procedure_1.publicProcedure
|
|
57
|
+
.route({ method: 'GET', path: '/{languageId}/micro-lessons' })
|
|
58
|
+
.input(ContentQuery.extend({ languageId: languages_zod_1.LanguageId }))
|
|
59
|
+
.output(exports.MicroLessonsResponse);
|
|
60
|
+
exports.content = {
|
|
61
|
+
articleLanguages,
|
|
62
|
+
articles,
|
|
63
|
+
microLessonLanguages,
|
|
64
|
+
microLessons,
|
|
65
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const CreatePaymentIntentInput: z.ZodObject<{
|
|
3
|
+
amount: z.ZodNumber;
|
|
4
|
+
currency: z.ZodString;
|
|
5
|
+
useTestKey: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type CreatePaymentIntentInput = z.infer<typeof CreatePaymentIntentInput>;
|
|
8
|
+
/** What the app's Stripe PaymentSheet needs to take the payment. */
|
|
9
|
+
export declare const PaymentSheetParams: z.ZodObject<{
|
|
10
|
+
clientSecret: z.ZodString;
|
|
11
|
+
ephemeralKey: z.ZodString;
|
|
12
|
+
customer: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type PaymentSheetParams = z.infer<typeof PaymentSheetParams>;
|
|
15
|
+
export declare const donations: {
|
|
16
|
+
createPaymentIntent: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
17
|
+
amount: z.ZodNumber;
|
|
18
|
+
currency: z.ZodString;
|
|
19
|
+
useTestKey: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
clientSecret: z.ZodString;
|
|
22
|
+
ephemeralKey: z.ZodString;
|
|
23
|
+
customer: z.ZodString;
|
|
24
|
+
}, z.core.$strip>, 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>, {
|
|
25
|
+
BAD_REQUEST: {
|
|
26
|
+
status: number;
|
|
27
|
+
data: z.ZodObject<{
|
|
28
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
29
|
+
message: z.ZodString;
|
|
30
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
};
|
|
34
|
+
}>, {
|
|
35
|
+
UNAUTHORIZED: {
|
|
36
|
+
status: number;
|
|
37
|
+
data: z.ZodObject<{
|
|
38
|
+
reason: z.ZodEnum<{
|
|
39
|
+
missing_credentials: "missing_credentials";
|
|
40
|
+
invalid_token: "invalid_token";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
};
|
|
44
|
+
}>, {
|
|
45
|
+
UPSTREAM_FAILED: {
|
|
46
|
+
status: number;
|
|
47
|
+
data: z.ZodObject<{
|
|
48
|
+
service: z.ZodEnum<{
|
|
49
|
+
resend: "resend";
|
|
50
|
+
stripe: "stripe";
|
|
51
|
+
firestore: "firestore";
|
|
52
|
+
recaptcha: "recaptcha";
|
|
53
|
+
storage: "storage";
|
|
54
|
+
}>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
};
|
|
57
|
+
}>, import("./procedure").ApiMeta & Record<never, never>>;
|
|
58
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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.donations = exports.PaymentSheetParams = exports.CreatePaymentIntentInput = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const donations_1 = require("../functions/donations");
|
|
9
|
+
const errors_1 = require("./errors");
|
|
10
|
+
const procedure_1 = require("./procedure");
|
|
11
|
+
exports.CreatePaymentIntentInput = zod_1.default
|
|
12
|
+
.object({
|
|
13
|
+
/** In Stripe's units for `currency`, from `toStripeAmount`. */
|
|
14
|
+
amount: zod_1.default.number().int(),
|
|
15
|
+
/** An ISO 4217 code, in either case. */
|
|
16
|
+
currency: zod_1.default.string().regex(/^[a-z]{3}$/i),
|
|
17
|
+
/** Charges with Stripe's test key, for testing donations on a build. */
|
|
18
|
+
useTestKey: zod_1.default.boolean().optional(),
|
|
19
|
+
})
|
|
20
|
+
.superRefine(({ amount, currency }, ctx) => {
|
|
21
|
+
if ((0, donations_1.isValidStripeDonationAmount)(amount, currency))
|
|
22
|
+
return;
|
|
23
|
+
const { min, max } = (0, donations_1.getDonationLimits)(currency);
|
|
24
|
+
ctx.addIssue({
|
|
25
|
+
code: 'custom',
|
|
26
|
+
path: ['amount'],
|
|
27
|
+
message: `${(0, donations_1.fromStripeAmount)(amount, currency)} ${currency} is outside the ${min}–${max} donation limits.`,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
/** What the app's Stripe PaymentSheet needs to take the payment. */
|
|
31
|
+
exports.PaymentSheetParams = zod_1.default.object({
|
|
32
|
+
clientSecret: zod_1.default.string(),
|
|
33
|
+
ephemeralKey: zod_1.default.string(),
|
|
34
|
+
/** The Stripe customer for the caller's Firebase uid. */
|
|
35
|
+
customer: zod_1.default.string(),
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Creates a Stripe PaymentIntent for an app donation, under a Stripe customer
|
|
39
|
+
* keyed by the caller's Firebase uid.
|
|
40
|
+
*/
|
|
41
|
+
const createPaymentIntent = procedure_1.accountProcedure
|
|
42
|
+
.route({ method: 'POST', path: '/create-payment-intent' })
|
|
43
|
+
.errors({ UPSTREAM_FAILED: errors_1.UPSTREAM_FAILED })
|
|
44
|
+
.input(exports.CreatePaymentIntentInput)
|
|
45
|
+
.output(exports.PaymentSheetParams);
|
|
46
|
+
exports.donations = { createPaymentIntent };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The request didn't match its input schema. oRPC's server throws this itself,
|
|
4
|
+
* with this code, status, and data, whenever input validation fails.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BAD_REQUEST: {
|
|
7
|
+
status: number;
|
|
8
|
+
data: z.ZodObject<{
|
|
9
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
10
|
+
message: z.ZodString;
|
|
11
|
+
path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The caller sent no credentials the procedure accepts, or a Firebase ID
|
|
17
|
+
* token in the `Authorization` header that didn't verify.
|
|
18
|
+
*/
|
|
19
|
+
export declare const UNAUTHORIZED: {
|
|
20
|
+
status: number;
|
|
21
|
+
data: z.ZodObject<{
|
|
22
|
+
reason: z.ZodEnum<{
|
|
23
|
+
missing_credentials: "missing_credentials";
|
|
24
|
+
invalid_token: "invalid_token";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
};
|
|
28
|
+
/** reCAPTCHA didn't verify the request's captcha token as human. */
|
|
29
|
+
export declare const CAPTCHA_FAILED: {
|
|
30
|
+
status: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The account behind the ID token has no email address, which every anonymous
|
|
34
|
+
* account is.
|
|
35
|
+
*/
|
|
36
|
+
export declare const NO_ACCOUNT_EMAIL: {
|
|
37
|
+
status: number;
|
|
38
|
+
};
|
|
39
|
+
/** The Resend contact an unsubscribe link points to doesn't exist. */
|
|
40
|
+
export declare const CONTACT_NOT_FOUND: {
|
|
41
|
+
status: number;
|
|
42
|
+
};
|
|
43
|
+
/** A service the website depends on failed, so retrying later may work. */
|
|
44
|
+
export declare const UPSTREAM_FAILED: {
|
|
45
|
+
status: number;
|
|
46
|
+
data: z.ZodObject<{
|
|
47
|
+
service: z.ZodEnum<{
|
|
48
|
+
resend: "resend";
|
|
49
|
+
stripe: "stripe";
|
|
50
|
+
firestore: "firestore";
|
|
51
|
+
recaptcha: "recaptcha";
|
|
52
|
+
storage: "storage";
|
|
53
|
+
}>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
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.UPSTREAM_FAILED = exports.CONTACT_NOT_FOUND = exports.NO_ACCOUNT_EMAIL = exports.CAPTCHA_FAILED = exports.UNAUTHORIZED = exports.BAD_REQUEST = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
/*
|
|
9
|
+
* Every error a website API procedure can return on purpose. Each procedure
|
|
10
|
+
* lists the ones it can actually throw, so a client's error type is exactly
|
|
11
|
+
* the set it has to handle. Anything else (a missing env var, a bug) reaches
|
|
12
|
+
* the client as an undefined `INTERNAL_SERVER_ERROR`, and the real cause only
|
|
13
|
+
* goes to the server logs.
|
|
14
|
+
*
|
|
15
|
+
* Messages are for developers and logs, not users: clients pick their own
|
|
16
|
+
* translated text from the error's `code`.
|
|
17
|
+
*/
|
|
18
|
+
/** One problem with a request's input, as reported by its Zod schema. */
|
|
19
|
+
const InputIssue = zod_1.default.object({
|
|
20
|
+
message: zod_1.default.string(),
|
|
21
|
+
path: zod_1.default.array(zod_1.default.union([zod_1.default.string(), zod_1.default.number()])).optional(),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* The request didn't match its input schema. oRPC's server throws this itself,
|
|
25
|
+
* with this code, status, and data, whenever input validation fails.
|
|
26
|
+
*/
|
|
27
|
+
exports.BAD_REQUEST = {
|
|
28
|
+
status: 400,
|
|
29
|
+
data: zod_1.default.object({ issues: zod_1.default.array(InputIssue) }),
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The caller sent no credentials the procedure accepts, or a Firebase ID
|
|
33
|
+
* token in the `Authorization` header that didn't verify.
|
|
34
|
+
*/
|
|
35
|
+
exports.UNAUTHORIZED = {
|
|
36
|
+
status: 401,
|
|
37
|
+
data: zod_1.default.object({ reason: zod_1.default.enum(['missing_credentials', 'invalid_token']) }),
|
|
38
|
+
};
|
|
39
|
+
/** reCAPTCHA didn't verify the request's captcha token as human. */
|
|
40
|
+
exports.CAPTCHA_FAILED = {
|
|
41
|
+
status: 403,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The account behind the ID token has no email address, which every anonymous
|
|
45
|
+
* account is.
|
|
46
|
+
*/
|
|
47
|
+
exports.NO_ACCOUNT_EMAIL = {
|
|
48
|
+
status: 403,
|
|
49
|
+
};
|
|
50
|
+
/** The Resend contact an unsubscribe link points to doesn't exist. */
|
|
51
|
+
exports.CONTACT_NOT_FOUND = {
|
|
52
|
+
status: 404,
|
|
53
|
+
};
|
|
54
|
+
/** A service the website depends on failed, so retrying later may work. */
|
|
55
|
+
exports.UPSTREAM_FAILED = {
|
|
56
|
+
status: 502,
|
|
57
|
+
data: zod_1.default.object({
|
|
58
|
+
service: zod_1.default.enum(['resend', 'stripe', 'firestore', 'recaptcha', 'storage']),
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A boolean query parameter. Query values arrive as strings, so `"false"`
|
|
4
|
+
* must parse as false (which `z.coerce.boolean()` gets wrong), while typed
|
|
5
|
+
* callers still pass a real boolean.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QueryBoolean: z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>;
|
|
8
|
+
/** An email address someone typed into a form. */
|
|
9
|
+
export declare const Email: z.ZodPipe<z.ZodString, z.ZodEmail>;
|
|
10
|
+
/** A person's name as they typed it. */
|
|
11
|
+
export declare const Name: z.ZodString;
|