@nyig/models 0.2.35 → 0.2.37
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/index.d.mts +407 -261
- package/index.d.ts +407 -261
- package/index.js +255 -248
- package/index.mjs +254 -248
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -78,6 +78,7 @@ __export(src_exports, {
|
|
|
78
78
|
zTeacher: () => zTeacher,
|
|
79
79
|
zTeacherDisplay: () => zTeacherDisplay,
|
|
80
80
|
zTeacherPayment: () => zTeacherPayment,
|
|
81
|
+
zTeacherPaymentResponse: () => zTeacherPaymentResponse,
|
|
81
82
|
zTeacherPaymentRow: () => zTeacherPaymentRow,
|
|
82
83
|
zTuition: () => zTuition,
|
|
83
84
|
zUser: () => zUser,
|
|
@@ -127,7 +128,7 @@ var BookingType = /* @__PURE__ */ ((BookingType2) => {
|
|
|
127
128
|
})(BookingType || {});
|
|
128
129
|
|
|
129
130
|
// src/interface/booking/campBooking.ts
|
|
130
|
-
var
|
|
131
|
+
var import_zod15 = require("zod");
|
|
131
132
|
|
|
132
133
|
// src/interface/tracking/attendState.ts
|
|
133
134
|
var AttendState = /* @__PURE__ */ ((AttendState2) => {
|
|
@@ -197,7 +198,7 @@ var zBCampTracker = import_zod6.z.object({
|
|
|
197
198
|
var zCampTracker = addAutoProps(zBCampTracker);
|
|
198
199
|
|
|
199
200
|
// src/interface/tracking/classTracker.ts
|
|
200
|
-
var
|
|
201
|
+
var import_zod11 = require("zod");
|
|
201
202
|
|
|
202
203
|
// src/interface/payment/invoice.ts
|
|
203
204
|
var import_zod7 = require("zod");
|
|
@@ -239,47 +240,160 @@ var zBInvoice = import_zod7.z.object({
|
|
|
239
240
|
var zInvoice = addAutoProps(zBInvoice);
|
|
240
241
|
|
|
241
242
|
// src/interface/payment/teacherPayment.ts
|
|
243
|
+
var import_zod10 = require("zod");
|
|
244
|
+
|
|
245
|
+
// src/interface/user/goRank.ts
|
|
246
|
+
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
247
|
+
GoRank2["KYU1"] = "1k";
|
|
248
|
+
GoRank2["KYU2"] = "2k";
|
|
249
|
+
GoRank2["KYU3"] = "3k";
|
|
250
|
+
GoRank2["KYU4"] = "4k";
|
|
251
|
+
GoRank2["KYU5"] = "5k";
|
|
252
|
+
GoRank2["KYU6"] = "6k";
|
|
253
|
+
GoRank2["KYU7"] = "7k";
|
|
254
|
+
GoRank2["KYU8"] = "8k";
|
|
255
|
+
GoRank2["KYU9"] = "9k";
|
|
256
|
+
GoRank2["KYU10"] = "10k";
|
|
257
|
+
GoRank2["KYU11"] = "11k";
|
|
258
|
+
GoRank2["KYU12"] = "12k";
|
|
259
|
+
GoRank2["KYU13"] = "13k";
|
|
260
|
+
GoRank2["KYU14"] = "14k";
|
|
261
|
+
GoRank2["KYU15"] = "15k";
|
|
262
|
+
GoRank2["KYU16"] = "16k";
|
|
263
|
+
GoRank2["KYU17"] = "17k";
|
|
264
|
+
GoRank2["KYU18"] = "18k";
|
|
265
|
+
GoRank2["KYU19"] = "19k";
|
|
266
|
+
GoRank2["KYU20"] = "20k";
|
|
267
|
+
GoRank2["KYU21"] = "21k";
|
|
268
|
+
GoRank2["KYU22"] = "22k";
|
|
269
|
+
GoRank2["KYU23"] = "23k";
|
|
270
|
+
GoRank2["KYU24"] = "24k";
|
|
271
|
+
GoRank2["KYU25"] = "25k";
|
|
272
|
+
GoRank2["DAN1"] = "1d";
|
|
273
|
+
GoRank2["DAN2"] = "2d";
|
|
274
|
+
GoRank2["DAN3"] = "3d";
|
|
275
|
+
GoRank2["DAN4"] = "4d";
|
|
276
|
+
GoRank2["DAN5"] = "5d";
|
|
277
|
+
GoRank2["DAN6"] = "6d";
|
|
278
|
+
GoRank2["DAN7"] = "7d";
|
|
279
|
+
GoRank2["PRO1"] = "1p";
|
|
280
|
+
GoRank2["PRO2"] = "2p";
|
|
281
|
+
GoRank2["PRO3"] = "3p";
|
|
282
|
+
GoRank2["PRO4"] = "4p";
|
|
283
|
+
GoRank2["PRO5"] = "5p";
|
|
284
|
+
GoRank2["PRO6"] = "6p";
|
|
285
|
+
GoRank2["PRO7"] = "7p";
|
|
286
|
+
GoRank2["PRO8"] = "8p";
|
|
287
|
+
GoRank2["PRO9"] = "9p";
|
|
288
|
+
return GoRank2;
|
|
289
|
+
})(GoRank || {});
|
|
290
|
+
|
|
291
|
+
// src/interface/user/user.ts
|
|
242
292
|
var import_zod8 = require("zod");
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
293
|
+
var zBUser = import_zod8.z.object({
|
|
294
|
+
name: import_zod8.z.string().min(2).max(100),
|
|
295
|
+
username: import_zod8.z.string().optional(),
|
|
296
|
+
password: import_zod8.z.string().optional(),
|
|
297
|
+
roles: import_zod8.z.array(import_zod8.z.number().int()).optional(),
|
|
298
|
+
email: import_zod8.z.string().max(100).email().or(import_zod8.z.literal("")).optional(),
|
|
299
|
+
address: import_zod8.z.string().or(import_zod8.z.literal("")).optional(),
|
|
300
|
+
country: import_zod8.z.string().length(2, {
|
|
301
|
+
message: "Enter the 2-letter country code"
|
|
302
|
+
}).or(import_zod8.z.literal("")).optional(),
|
|
303
|
+
phoneNumber: import_zod8.z.string().regex(/^\d{10}/, {
|
|
304
|
+
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
305
|
+
}).or(import_zod8.z.literal("")).optional(),
|
|
306
|
+
birthDate: import_zod8.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
307
|
+
message: "Enter a valid date in yyyy-mm-dd format"
|
|
308
|
+
}).or(import_zod8.z.literal("")).optional()
|
|
248
309
|
});
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
310
|
+
var zUser = addAutoProps(zBUser);
|
|
311
|
+
var zStudent = zUser.extend({
|
|
312
|
+
rank: import_zod8.z.nativeEnum(GoRank),
|
|
313
|
+
guardian: import_zod8.z.string().optional()
|
|
314
|
+
});
|
|
315
|
+
var zTeacher = zUser.extend({
|
|
316
|
+
rank: import_zod8.z.nativeEnum(GoRank),
|
|
317
|
+
/**
|
|
318
|
+
* Inactive teachers are not shown on public endpoints
|
|
319
|
+
*/
|
|
320
|
+
isInactive: import_zod8.z.boolean().optional(),
|
|
321
|
+
/**
|
|
322
|
+
* Teacher's position, e.g., instructor, president
|
|
323
|
+
*/
|
|
324
|
+
title: import_zod8.z.string().optional(),
|
|
325
|
+
/**
|
|
326
|
+
* Teacher's bio text describing experience
|
|
327
|
+
* new lines will be rendered as paragraphs
|
|
328
|
+
*/
|
|
329
|
+
bio: import_zod8.z.string().optional(),
|
|
330
|
+
/** Format is illustrated below, where teacher is available
|
|
331
|
+
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
332
|
+
* [
|
|
333
|
+
* [[9, 12], [15, 18]],
|
|
334
|
+
* [[10, 12], [18, 20]],
|
|
335
|
+
* [],
|
|
336
|
+
* [],
|
|
337
|
+
* [],
|
|
338
|
+
* [],
|
|
339
|
+
* [],
|
|
340
|
+
* ]
|
|
341
|
+
*/
|
|
342
|
+
available: import_zod8.z.array(import_zod8.z.array(import_zod8.z.array(import_zod8.z.number()))).optional()
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// src/interface/user/userRoles.ts
|
|
346
|
+
var import_zod9 = require("zod");
|
|
347
|
+
var zUserRoles = import_zod9.z.object({
|
|
348
|
+
user: import_zod9.z.number().int(),
|
|
349
|
+
admin: import_zod9.z.number().int(),
|
|
350
|
+
superadmin: import_zod9.z.number().int()
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// src/interface/payment/teacherPayment.ts
|
|
354
|
+
var zTeacherPaymentRow = import_zod10.z.object({
|
|
355
|
+
course: import_zod10.z.string().min(1, "select or enter a course"),
|
|
356
|
+
length: import_zod10.z.coerce.number().gt(0, "must be > 0"),
|
|
357
|
+
count: import_zod10.z.coerce.number().int().gt(0, "must be > 0"),
|
|
358
|
+
wage: import_zod10.z.coerce.number().gt(0, "wage must be > 0")
|
|
359
|
+
});
|
|
360
|
+
var zBTeacherPayment = import_zod10.z.object({
|
|
361
|
+
teacher: import_zod10.z.string().min(1, "select or enter a teacher"),
|
|
362
|
+
rows: import_zod10.z.array(zTeacherPaymentRow),
|
|
363
|
+
paid: import_zod10.z.boolean().optional()
|
|
253
364
|
});
|
|
254
365
|
var zTeacherPayment = addAutoProps(zBTeacherPayment);
|
|
366
|
+
var zTeacherPaymentResponse = zTeacherPayment.extend({
|
|
367
|
+
teacher: zTeacher
|
|
368
|
+
});
|
|
255
369
|
|
|
256
370
|
// src/interface/tracking/classTracker.ts
|
|
257
|
-
var zBClassTracker =
|
|
258
|
-
course:
|
|
259
|
-
teacher:
|
|
260
|
-
student:
|
|
261
|
-
classTimes:
|
|
262
|
-
completedList:
|
|
371
|
+
var zBClassTracker = import_zod11.z.object({
|
|
372
|
+
course: import_zod11.z.string(),
|
|
373
|
+
teacher: import_zod11.z.string(),
|
|
374
|
+
student: import_zod11.z.string(),
|
|
375
|
+
classTimes: import_zod11.z.array(import_zod11.z.coerce.date()),
|
|
376
|
+
completedList: import_zod11.z.array(import_zod11.z.boolean()),
|
|
263
377
|
/**
|
|
264
378
|
* Virtual mongoose field when all values in completedList is true
|
|
265
379
|
*/
|
|
266
|
-
completed:
|
|
380
|
+
completed: import_zod11.z.boolean().optional(),
|
|
267
381
|
tuition: zTuition.optional(),
|
|
268
|
-
paid:
|
|
269
|
-
paused:
|
|
270
|
-
notes:
|
|
382
|
+
paid: import_zod11.z.boolean().optional(),
|
|
383
|
+
paused: import_zod11.z.boolean().optional(),
|
|
384
|
+
notes: import_zod11.z.string().optional()
|
|
271
385
|
});
|
|
272
386
|
var zClassTracker = addAutoProps(zBClassTracker);
|
|
273
387
|
|
|
274
388
|
// src/interface/tracking/groupTracker.ts
|
|
275
|
-
var
|
|
389
|
+
var import_zod14 = require("zod");
|
|
276
390
|
|
|
277
391
|
// src/interface/tracking/scheduleData.ts
|
|
278
|
-
var
|
|
279
|
-
var zScheduleData =
|
|
280
|
-
startTime:
|
|
392
|
+
var import_zod12 = require("zod");
|
|
393
|
+
var zScheduleData = import_zod12.z.object({
|
|
394
|
+
startTime: import_zod12.z.string(),
|
|
281
395
|
// String in 24 hour "HH:mm" format
|
|
282
|
-
dayOfWeek:
|
|
396
|
+
dayOfWeek: import_zod12.z.number().int().min(0).max(6)
|
|
283
397
|
// integeters in 0 - 6
|
|
284
398
|
});
|
|
285
399
|
|
|
@@ -308,126 +422,126 @@ var NYIGSchool = /* @__PURE__ */ ((NYIGSchool2) => {
|
|
|
308
422
|
})(NYIGSchool || {});
|
|
309
423
|
|
|
310
424
|
// src/interface/course/course.ts
|
|
311
|
-
var
|
|
312
|
-
var zBCourse =
|
|
313
|
-
name:
|
|
314
|
-
category:
|
|
425
|
+
var import_zod13 = require("zod");
|
|
426
|
+
var zBCourse = import_zod13.z.object({
|
|
427
|
+
name: import_zod13.z.string(),
|
|
428
|
+
category: import_zod13.z.nativeEnum(CourseCategory),
|
|
315
429
|
/**
|
|
316
430
|
* @unit SECONDS - Duration of the course in seconds
|
|
317
431
|
*/
|
|
318
|
-
duration:
|
|
432
|
+
duration: import_zod13.z.coerce.number().int("Duration in seconds must be a whole number").min(1, "Duration in seconds must not be less than or equal to 0"),
|
|
319
433
|
/**
|
|
320
434
|
* @unit CENTS - Price of the course in cents
|
|
321
435
|
*/
|
|
322
|
-
price:
|
|
323
|
-
description:
|
|
436
|
+
price: import_zod13.z.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0"),
|
|
437
|
+
description: import_zod13.z.string().or(import_zod13.z.literal("")).optional(),
|
|
324
438
|
/**
|
|
325
439
|
* NYIG School locations
|
|
326
440
|
*/
|
|
327
|
-
nyigSchool:
|
|
441
|
+
nyigSchool: import_zod13.z.nativeEnum(NYIGSchool),
|
|
328
442
|
/**
|
|
329
443
|
* Recommended level before taking this course
|
|
330
444
|
*/
|
|
331
|
-
recLevel:
|
|
445
|
+
recLevel: import_zod13.z.string().or(import_zod13.z.literal("")).optional(),
|
|
332
446
|
/**
|
|
333
447
|
* Camp tuition for half-day option
|
|
334
448
|
*/
|
|
335
|
-
halfCampTuition:
|
|
449
|
+
halfCampTuition: import_zod13.z.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional(),
|
|
336
450
|
/**
|
|
337
451
|
* Camp tuition for full-day option
|
|
338
452
|
*/
|
|
339
|
-
fullCampTuition:
|
|
453
|
+
fullCampTuition: import_zod13.z.coerce.number().int("Tuition must be a whole number in cents").min(1, "Tuition must not be less than or equal to 0").optional()
|
|
340
454
|
});
|
|
341
455
|
var zCourse = addAutoProps(zBCourse);
|
|
342
456
|
|
|
343
457
|
// src/interface/tracking/groupTracker.ts
|
|
344
|
-
var zBGroupTracker =
|
|
345
|
-
course:
|
|
346
|
-
teacher:
|
|
347
|
-
semester:
|
|
458
|
+
var zBGroupTracker = import_zod14.z.object({
|
|
459
|
+
course: import_zod14.z.string(),
|
|
460
|
+
teacher: import_zod14.z.string(),
|
|
461
|
+
semester: import_zod14.z.string(),
|
|
348
462
|
scheduleData: zScheduleData,
|
|
349
463
|
/**
|
|
350
464
|
* occurrences are tracked by week for Groups
|
|
351
465
|
*/
|
|
352
|
-
occurrences:
|
|
466
|
+
occurrences: import_zod14.z.array(import_zod14.z.coerce.date()),
|
|
353
467
|
/**
|
|
354
468
|
* attendances are tracked by week for Groups
|
|
355
469
|
*/
|
|
356
|
-
attendances:
|
|
470
|
+
attendances: import_zod14.z.array(import_zod14.z.string()),
|
|
357
471
|
/**
|
|
358
472
|
* public-facing ID of the course instance, e.g., 101
|
|
359
473
|
*/
|
|
360
|
-
courseId:
|
|
474
|
+
courseId: import_zod14.z.string().optional(),
|
|
361
475
|
/**
|
|
362
476
|
* Age group of the class instance, e.g. "adult", "youth"
|
|
363
477
|
*/
|
|
364
|
-
ageGroup:
|
|
478
|
+
ageGroup: import_zod14.z.nativeEnum(AgeGroup).optional(),
|
|
365
479
|
/**
|
|
366
480
|
* If true, the course is hidden from public view
|
|
367
481
|
*/
|
|
368
|
-
isNonPublic:
|
|
369
|
-
notes:
|
|
482
|
+
isNonPublic: import_zod14.z.boolean().optional(),
|
|
483
|
+
notes: import_zod14.z.string().optional()
|
|
370
484
|
});
|
|
371
485
|
var zGroupTracker = addAutoProps(zBGroupTracker);
|
|
372
486
|
|
|
373
487
|
// src/interface/booking/campBooking.ts
|
|
374
|
-
var zBCampBooking =
|
|
375
|
-
ctId:
|
|
376
|
-
isOnline:
|
|
377
|
-
classDates:
|
|
378
|
-
campOption:
|
|
379
|
-
shipping:
|
|
488
|
+
var zBCampBooking = import_zod15.z.object({
|
|
489
|
+
ctId: import_zod15.z.string().optional(),
|
|
490
|
+
isOnline: import_zod15.z.boolean(),
|
|
491
|
+
classDates: import_zod15.z.string(),
|
|
492
|
+
campOption: import_zod15.z.nativeEnum(CampOption),
|
|
493
|
+
shipping: import_zod15.z.boolean().optional()
|
|
380
494
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
381
495
|
var zCampBooking = addAutoProps(zBCampBooking);
|
|
382
496
|
|
|
383
497
|
// src/interface/booking/groupBooking.ts
|
|
384
|
-
var
|
|
385
|
-
var zBGroupBooking =
|
|
386
|
-
gtId:
|
|
387
|
-
isTrial:
|
|
388
|
-
isOnline:
|
|
389
|
-
classDate:
|
|
390
|
-
shipping:
|
|
498
|
+
var import_zod16 = require("zod");
|
|
499
|
+
var zBGroupBooking = import_zod16.z.object({
|
|
500
|
+
gtId: import_zod16.z.string().optional(),
|
|
501
|
+
isTrial: import_zod16.z.boolean().optional(),
|
|
502
|
+
isOnline: import_zod16.z.boolean(),
|
|
503
|
+
classDate: import_zod16.z.string().optional(),
|
|
504
|
+
shipping: import_zod16.z.boolean().optional()
|
|
391
505
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
392
506
|
var zGroupBooking = addAutoProps(zBGroupBooking);
|
|
393
507
|
|
|
394
508
|
// src/interface/booking/privateBooking.ts
|
|
395
|
-
var
|
|
396
|
-
var zBPrivateBooking =
|
|
397
|
-
courseId:
|
|
398
|
-
teacherId:
|
|
399
|
-
classDate:
|
|
509
|
+
var import_zod17 = require("zod");
|
|
510
|
+
var zBPrivateBooking = import_zod17.z.object({
|
|
511
|
+
courseId: import_zod17.z.string(),
|
|
512
|
+
teacherId: import_zod17.z.string(),
|
|
513
|
+
classDate: import_zod17.z.string().optional()
|
|
400
514
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
401
515
|
var zPrivateBooking = addAutoProps(zBPrivateBooking);
|
|
402
516
|
|
|
403
517
|
// src/interface/public/aurora.ts
|
|
404
|
-
var
|
|
405
|
-
var zTeacherDisplay =
|
|
406
|
-
name:
|
|
407
|
-
email:
|
|
408
|
-
title:
|
|
409
|
-
imageUrl:
|
|
410
|
-
bio:
|
|
411
|
-
});
|
|
412
|
-
var zCourseTable =
|
|
413
|
-
id:
|
|
414
|
-
name:
|
|
415
|
-
duration:
|
|
416
|
-
dateAndTime:
|
|
417
|
-
recommendedLevel:
|
|
418
|
-
tuition:
|
|
518
|
+
var import_zod18 = require("zod");
|
|
519
|
+
var zTeacherDisplay = import_zod18.z.object({
|
|
520
|
+
name: import_zod18.z.string(),
|
|
521
|
+
email: import_zod18.z.string().email(),
|
|
522
|
+
title: import_zod18.z.string(),
|
|
523
|
+
imageUrl: import_zod18.z.string(),
|
|
524
|
+
bio: import_zod18.z.string()
|
|
525
|
+
});
|
|
526
|
+
var zCourseTable = import_zod18.z.object({
|
|
527
|
+
id: import_zod18.z.string(),
|
|
528
|
+
name: import_zod18.z.string(),
|
|
529
|
+
duration: import_zod18.z.number(),
|
|
530
|
+
dateAndTime: import_zod18.z.string(),
|
|
531
|
+
recommendedLevel: import_zod18.z.string(),
|
|
532
|
+
tuition: import_zod18.z.string()
|
|
419
533
|
});
|
|
420
534
|
|
|
421
535
|
// src/interface/public/imageDef.ts
|
|
422
|
-
var
|
|
423
|
-
var zImageDef =
|
|
424
|
-
url:
|
|
425
|
-
height:
|
|
426
|
-
width:
|
|
536
|
+
var import_zod19 = require("zod");
|
|
537
|
+
var zImageDef = import_zod19.z.object({
|
|
538
|
+
url: import_zod19.z.string(),
|
|
539
|
+
height: import_zod19.z.number(),
|
|
540
|
+
width: import_zod19.z.number()
|
|
427
541
|
});
|
|
428
542
|
|
|
429
543
|
// src/interface/reporting/reportTicket.ts
|
|
430
|
-
var
|
|
544
|
+
var import_zod20 = require("zod");
|
|
431
545
|
|
|
432
546
|
// src/interface/reporting/ticketStatus.ts
|
|
433
547
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -439,12 +553,12 @@ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
|
439
553
|
})(TicketStatus || {});
|
|
440
554
|
|
|
441
555
|
// src/interface/reporting/reportTicket.ts
|
|
442
|
-
var zBReportTicket =
|
|
443
|
-
requester:
|
|
444
|
-
resolver:
|
|
445
|
-
status:
|
|
446
|
-
title:
|
|
447
|
-
description:
|
|
556
|
+
var zBReportTicket = import_zod20.z.object({
|
|
557
|
+
requester: import_zod20.z.string(),
|
|
558
|
+
resolver: import_zod20.z.string().optional(),
|
|
559
|
+
status: import_zod20.z.nativeEnum(TicketStatus),
|
|
560
|
+
title: import_zod20.z.string(),
|
|
561
|
+
description: import_zod20.z.string()
|
|
448
562
|
});
|
|
449
563
|
var zReportTicket = addAutoProps(zBReportTicket);
|
|
450
564
|
|
|
@@ -457,96 +571,96 @@ var Season = /* @__PURE__ */ ((Season2) => {
|
|
|
457
571
|
})(Season || {});
|
|
458
572
|
|
|
459
573
|
// src/interface/semester/semester.ts
|
|
460
|
-
var
|
|
461
|
-
var zBSemester =
|
|
462
|
-
season:
|
|
463
|
-
year:
|
|
464
|
-
startDate:
|
|
465
|
-
endDate:
|
|
574
|
+
var import_zod21 = require("zod");
|
|
575
|
+
var zBSemester = import_zod21.z.object({
|
|
576
|
+
season: import_zod21.z.nativeEnum(Season),
|
|
577
|
+
year: import_zod21.z.number().min(2022).max(2999),
|
|
578
|
+
startDate: import_zod21.z.coerce.date(),
|
|
579
|
+
endDate: import_zod21.z.coerce.date(),
|
|
466
580
|
/**
|
|
467
581
|
* Format: start, end, start, end, ...
|
|
468
582
|
*/
|
|
469
|
-
blackoutDates:
|
|
583
|
+
blackoutDates: import_zod21.z.array(import_zod21.z.coerce.date()),
|
|
470
584
|
/**
|
|
471
585
|
* List of names of some break: date range
|
|
472
586
|
*/
|
|
473
|
-
importantDates:
|
|
587
|
+
importantDates: import_zod21.z.array(import_zod21.z.string())
|
|
474
588
|
});
|
|
475
589
|
var zSemester = addAutoProps(zBSemester);
|
|
476
590
|
|
|
477
591
|
// src/interface/event/eConfig.ts
|
|
478
|
-
var
|
|
592
|
+
var import_zod24 = require("zod");
|
|
479
593
|
|
|
480
594
|
// src/interface/event/eTicket.ts
|
|
481
|
-
var
|
|
482
|
-
var zBEventTicket =
|
|
483
|
-
name:
|
|
595
|
+
var import_zod22 = require("zod");
|
|
596
|
+
var zBEventTicket = import_zod22.z.object({
|
|
597
|
+
name: import_zod22.z.string().min(5, "Name must be at least 5 characters"),
|
|
484
598
|
/**
|
|
485
599
|
* Price in cents
|
|
486
600
|
*/
|
|
487
|
-
price:
|
|
601
|
+
price: import_zod22.z.number().min(1, "Price must be at least $1"),
|
|
488
602
|
/**
|
|
489
603
|
* @optional description of the ticket
|
|
490
604
|
*/
|
|
491
|
-
description:
|
|
605
|
+
description: import_zod22.z.string().optional(),
|
|
492
606
|
/**
|
|
493
607
|
* @optional The ticket cannot be purchased if true
|
|
494
608
|
*/
|
|
495
|
-
isNotBuyable:
|
|
609
|
+
isNotBuyable: import_zod22.z.boolean().optional(),
|
|
496
610
|
/**
|
|
497
611
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
498
612
|
*/
|
|
499
|
-
lastBuyableDate:
|
|
613
|
+
lastBuyableDate: import_zod22.z.coerce.date().optional()
|
|
500
614
|
});
|
|
501
615
|
var zEventTicket = addAutoProps(zBEventTicket);
|
|
502
616
|
|
|
503
617
|
// src/interface/event/table.ts
|
|
504
|
-
var
|
|
505
|
-
var zTable =
|
|
506
|
-
var zDetailsTable =
|
|
507
|
-
fields:
|
|
618
|
+
var import_zod23 = require("zod");
|
|
619
|
+
var zTable = import_zod23.z.array(import_zod23.z.record(import_zod23.z.string(), import_zod23.z.string()));
|
|
620
|
+
var zDetailsTable = import_zod23.z.object({
|
|
621
|
+
fields: import_zod23.z.array(import_zod23.z.string()).length(2),
|
|
508
622
|
data: zTable
|
|
509
623
|
});
|
|
510
|
-
var zScheduleTable =
|
|
511
|
-
fields:
|
|
512
|
-
data:
|
|
624
|
+
var zScheduleTable = import_zod23.z.object({
|
|
625
|
+
fields: import_zod23.z.array(import_zod23.z.string()).length(2),
|
|
626
|
+
data: import_zod23.z.record(import_zod23.z.string(), zTable)
|
|
513
627
|
});
|
|
514
628
|
|
|
515
629
|
// src/interface/event/eConfig.ts
|
|
516
|
-
var zBEventConfig =
|
|
630
|
+
var zBEventConfig = import_zod24.z.object({
|
|
517
631
|
/**
|
|
518
632
|
* Location of the event
|
|
519
633
|
*/
|
|
520
|
-
location:
|
|
634
|
+
location: import_zod24.z.string().optional(),
|
|
521
635
|
/**
|
|
522
636
|
* URL of the tournament on the official website
|
|
523
637
|
* Must be a valid URL link
|
|
524
638
|
*/
|
|
525
|
-
url:
|
|
639
|
+
url: import_zod24.z.string(),
|
|
526
640
|
/**
|
|
527
641
|
* Full name of the tournament
|
|
528
642
|
*/
|
|
529
|
-
title:
|
|
643
|
+
title: import_zod24.z.string(),
|
|
530
644
|
/**
|
|
531
645
|
* Abbreviated title of the tournament
|
|
532
646
|
*/
|
|
533
|
-
shortTitle:
|
|
647
|
+
shortTitle: import_zod24.z.string(),
|
|
534
648
|
/**
|
|
535
649
|
* Tournament start date and time
|
|
536
650
|
*/
|
|
537
|
-
tStart:
|
|
651
|
+
tStart: import_zod24.z.coerce.date(),
|
|
538
652
|
/**
|
|
539
653
|
* Tournament end date and time
|
|
540
654
|
*/
|
|
541
|
-
tEnd:
|
|
655
|
+
tEnd: import_zod24.z.coerce.date(),
|
|
542
656
|
/**
|
|
543
657
|
* Short description for tournament card
|
|
544
658
|
*/
|
|
545
|
-
shortDescription:
|
|
659
|
+
shortDescription: import_zod24.z.string(),
|
|
546
660
|
/**
|
|
547
661
|
* Full description
|
|
548
662
|
*/
|
|
549
|
-
description:
|
|
663
|
+
description: import_zod24.z.string(),
|
|
550
664
|
/**
|
|
551
665
|
* Defines the tournament details table with 2 columns
|
|
552
666
|
* typically Time and Event
|
|
@@ -560,15 +674,15 @@ var zBEventConfig = import_zod22.z.object({
|
|
|
560
674
|
/**
|
|
561
675
|
* List of ticket object IDs for this tournament
|
|
562
676
|
*/
|
|
563
|
-
tickets:
|
|
677
|
+
tickets: import_zod24.z.array(import_zod24.z.string()),
|
|
564
678
|
/**
|
|
565
679
|
* If false, the tournament registration is closed
|
|
566
680
|
*/
|
|
567
|
-
canRegister:
|
|
681
|
+
canRegister: import_zod24.z.boolean(),
|
|
568
682
|
/**
|
|
569
683
|
* If true, free form donation amounts are disabled.
|
|
570
684
|
*/
|
|
571
|
-
donationsDisabled:
|
|
685
|
+
donationsDisabled: import_zod24.z.boolean().optional(),
|
|
572
686
|
/**
|
|
573
687
|
* Defines URL, height, width of the image
|
|
574
688
|
*/
|
|
@@ -576,150 +690,42 @@ var zBEventConfig = import_zod22.z.object({
|
|
|
576
690
|
});
|
|
577
691
|
var zEventConfig = addAutoProps(zBEventConfig);
|
|
578
692
|
var zEventConfigResponse = zEventConfig.extend({
|
|
579
|
-
tickets:
|
|
693
|
+
tickets: import_zod24.z.array(zEventTicket)
|
|
580
694
|
});
|
|
581
695
|
|
|
582
696
|
// src/interface/event/eReg.ts
|
|
583
|
-
var
|
|
697
|
+
var import_zod26 = require("zod");
|
|
584
698
|
|
|
585
699
|
// src/interface/event/eTicketReg.ts
|
|
586
|
-
var
|
|
587
|
-
var zEventTicketReg =
|
|
588
|
-
ticket:
|
|
700
|
+
var import_zod25 = require("zod");
|
|
701
|
+
var zEventTicketReg = import_zod25.z.object({
|
|
702
|
+
ticket: import_zod25.z.string(),
|
|
589
703
|
/**
|
|
590
704
|
* integer minimum 1, otherwise no ticket is being bought
|
|
591
705
|
*/
|
|
592
|
-
amount:
|
|
706
|
+
amount: import_zod25.z.number().int().min(1)
|
|
593
707
|
});
|
|
594
708
|
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
595
709
|
ticket: zEventTicket
|
|
596
710
|
});
|
|
597
711
|
|
|
598
712
|
// src/interface/event/eReg.ts
|
|
599
|
-
var zBEventReg =
|
|
600
|
-
agaId:
|
|
601
|
-
tournamentId:
|
|
602
|
-
tickets:
|
|
713
|
+
var zBEventReg = import_zod26.z.object({
|
|
714
|
+
agaId: import_zod26.z.string(),
|
|
715
|
+
tournamentId: import_zod26.z.string(),
|
|
716
|
+
tickets: import_zod26.z.array(zEventTicketReg),
|
|
603
717
|
/**
|
|
604
718
|
* @units CENTS - Donation in cents
|
|
605
719
|
*/
|
|
606
|
-
donation:
|
|
720
|
+
donation: import_zod26.z.coerce.number().optional(),
|
|
607
721
|
/**
|
|
608
722
|
* How the registration was created, through public endpoint or admin
|
|
609
723
|
*/
|
|
610
|
-
createMethod:
|
|
724
|
+
createMethod: import_zod26.z.string().optional()
|
|
611
725
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
612
726
|
var zEventReg = addAutoProps(zBEventReg);
|
|
613
727
|
var zEventRegResponse = zEventReg.extend({
|
|
614
|
-
tickets:
|
|
615
|
-
});
|
|
616
|
-
|
|
617
|
-
// src/interface/user/goRank.ts
|
|
618
|
-
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
619
|
-
GoRank2["KYU1"] = "1k";
|
|
620
|
-
GoRank2["KYU2"] = "2k";
|
|
621
|
-
GoRank2["KYU3"] = "3k";
|
|
622
|
-
GoRank2["KYU4"] = "4k";
|
|
623
|
-
GoRank2["KYU5"] = "5k";
|
|
624
|
-
GoRank2["KYU6"] = "6k";
|
|
625
|
-
GoRank2["KYU7"] = "7k";
|
|
626
|
-
GoRank2["KYU8"] = "8k";
|
|
627
|
-
GoRank2["KYU9"] = "9k";
|
|
628
|
-
GoRank2["KYU10"] = "10k";
|
|
629
|
-
GoRank2["KYU11"] = "11k";
|
|
630
|
-
GoRank2["KYU12"] = "12k";
|
|
631
|
-
GoRank2["KYU13"] = "13k";
|
|
632
|
-
GoRank2["KYU14"] = "14k";
|
|
633
|
-
GoRank2["KYU15"] = "15k";
|
|
634
|
-
GoRank2["KYU16"] = "16k";
|
|
635
|
-
GoRank2["KYU17"] = "17k";
|
|
636
|
-
GoRank2["KYU18"] = "18k";
|
|
637
|
-
GoRank2["KYU19"] = "19k";
|
|
638
|
-
GoRank2["KYU20"] = "20k";
|
|
639
|
-
GoRank2["KYU21"] = "21k";
|
|
640
|
-
GoRank2["KYU22"] = "22k";
|
|
641
|
-
GoRank2["KYU23"] = "23k";
|
|
642
|
-
GoRank2["KYU24"] = "24k";
|
|
643
|
-
GoRank2["KYU25"] = "25k";
|
|
644
|
-
GoRank2["DAN1"] = "1d";
|
|
645
|
-
GoRank2["DAN2"] = "2d";
|
|
646
|
-
GoRank2["DAN3"] = "3d";
|
|
647
|
-
GoRank2["DAN4"] = "4d";
|
|
648
|
-
GoRank2["DAN5"] = "5d";
|
|
649
|
-
GoRank2["DAN6"] = "6d";
|
|
650
|
-
GoRank2["DAN7"] = "7d";
|
|
651
|
-
GoRank2["PRO1"] = "1p";
|
|
652
|
-
GoRank2["PRO2"] = "2p";
|
|
653
|
-
GoRank2["PRO3"] = "3p";
|
|
654
|
-
GoRank2["PRO4"] = "4p";
|
|
655
|
-
GoRank2["PRO5"] = "5p";
|
|
656
|
-
GoRank2["PRO6"] = "6p";
|
|
657
|
-
GoRank2["PRO7"] = "7p";
|
|
658
|
-
GoRank2["PRO8"] = "8p";
|
|
659
|
-
GoRank2["PRO9"] = "9p";
|
|
660
|
-
return GoRank2;
|
|
661
|
-
})(GoRank || {});
|
|
662
|
-
|
|
663
|
-
// src/interface/user/user.ts
|
|
664
|
-
var import_zod25 = require("zod");
|
|
665
|
-
var zBUser = import_zod25.z.object({
|
|
666
|
-
name: import_zod25.z.string().min(2).max(100),
|
|
667
|
-
username: import_zod25.z.string().optional(),
|
|
668
|
-
password: import_zod25.z.string().optional(),
|
|
669
|
-
roles: import_zod25.z.array(import_zod25.z.number().int()).optional(),
|
|
670
|
-
email: import_zod25.z.string().max(100).email().or(import_zod25.z.literal("")).optional(),
|
|
671
|
-
address: import_zod25.z.string().or(import_zod25.z.literal("")).optional(),
|
|
672
|
-
country: import_zod25.z.string().length(2, {
|
|
673
|
-
message: "Enter the 2-letter country code"
|
|
674
|
-
}).or(import_zod25.z.literal("")).optional(),
|
|
675
|
-
phoneNumber: import_zod25.z.string().regex(/^\d{10}/, {
|
|
676
|
-
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
677
|
-
}).or(import_zod25.z.literal("")).optional(),
|
|
678
|
-
birthDate: import_zod25.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
679
|
-
message: "Enter a valid date in yyyy-mm-dd format"
|
|
680
|
-
}).or(import_zod25.z.literal("")).optional()
|
|
681
|
-
});
|
|
682
|
-
var zUser = addAutoProps(zBUser);
|
|
683
|
-
var zStudent = zUser.extend({
|
|
684
|
-
rank: import_zod25.z.nativeEnum(GoRank),
|
|
685
|
-
guardian: import_zod25.z.string().optional()
|
|
686
|
-
});
|
|
687
|
-
var zTeacher = zUser.extend({
|
|
688
|
-
rank: import_zod25.z.nativeEnum(GoRank),
|
|
689
|
-
/**
|
|
690
|
-
* Inactive teachers are not shown on public endpoints
|
|
691
|
-
*/
|
|
692
|
-
isInactive: import_zod25.z.boolean().optional(),
|
|
693
|
-
/**
|
|
694
|
-
* Teacher's position, e.g., instructor, president
|
|
695
|
-
*/
|
|
696
|
-
title: import_zod25.z.string().optional(),
|
|
697
|
-
/**
|
|
698
|
-
* Teacher's bio text describing experience
|
|
699
|
-
* new lines will be rendered as paragraphs
|
|
700
|
-
*/
|
|
701
|
-
bio: import_zod25.z.string().optional(),
|
|
702
|
-
/** Format is illustrated below, where teacher is available
|
|
703
|
-
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
704
|
-
* [
|
|
705
|
-
* [[9, 12], [15, 18]],
|
|
706
|
-
* [[10, 12], [18, 20]],
|
|
707
|
-
* [],
|
|
708
|
-
* [],
|
|
709
|
-
* [],
|
|
710
|
-
* [],
|
|
711
|
-
* [],
|
|
712
|
-
* ]
|
|
713
|
-
*/
|
|
714
|
-
available: import_zod25.z.array(import_zod25.z.array(import_zod25.z.array(import_zod25.z.number()))).optional()
|
|
715
|
-
});
|
|
716
|
-
|
|
717
|
-
// src/interface/user/userRoles.ts
|
|
718
|
-
var import_zod26 = require("zod");
|
|
719
|
-
var zUserRoles = import_zod26.z.object({
|
|
720
|
-
user: import_zod26.z.number().int(),
|
|
721
|
-
admin: import_zod26.z.number().int(),
|
|
722
|
-
superadmin: import_zod26.z.number().int()
|
|
728
|
+
tickets: import_zod26.z.array(zEventTicketRegResponse)
|
|
723
729
|
});
|
|
724
730
|
// Annotate the CommonJS export names for ESM import in node:
|
|
725
731
|
0 && (module.exports = {
|
|
@@ -781,6 +787,7 @@ var zUserRoles = import_zod26.z.object({
|
|
|
781
787
|
zTeacher,
|
|
782
788
|
zTeacherDisplay,
|
|
783
789
|
zTeacherPayment,
|
|
790
|
+
zTeacherPaymentResponse,
|
|
784
791
|
zTeacherPaymentRow,
|
|
785
792
|
zTuition,
|
|
786
793
|
zUser,
|