@nyig/models 0.2.24 → 0.2.26
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 +404 -40
- package/index.d.ts +404 -40
- package/index.js +65 -52
- package/index.mjs +54 -44
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -40,6 +40,13 @@ __export(src_exports, {
|
|
|
40
40
|
zCourseTable: () => zCourseTable,
|
|
41
41
|
zDetailsTable: () => zDetailsTable,
|
|
42
42
|
zDiscount: () => zDiscount,
|
|
43
|
+
zEventConfig: () => zEventConfig,
|
|
44
|
+
zEventConfigResponse: () => zEventConfigResponse,
|
|
45
|
+
zEventReg: () => zEventReg,
|
|
46
|
+
zEventRegResponse: () => zEventRegResponse,
|
|
47
|
+
zEventTicket: () => zEventTicket,
|
|
48
|
+
zEventTicketReg: () => zEventTicketReg,
|
|
49
|
+
zEventTicketRegResponse: () => zEventTicketRegResponse,
|
|
43
50
|
zGroupBooking: () => zGroupBooking,
|
|
44
51
|
zGroupTracker: () => zGroupTracker,
|
|
45
52
|
zImageDef: () => zImageDef,
|
|
@@ -51,6 +58,10 @@ __export(src_exports, {
|
|
|
51
58
|
zMCampTracker: () => zMCampTracker,
|
|
52
59
|
zMClassTracker: () => zMClassTracker,
|
|
53
60
|
zMCourse: () => zMCourse,
|
|
61
|
+
zMEventConfig: () => zMEventConfig,
|
|
62
|
+
zMEventReg: () => zMEventReg,
|
|
63
|
+
zMEventRegResponse: () => zMEventRegResponse,
|
|
64
|
+
zMEventTicket: () => zMEventTicket,
|
|
54
65
|
zMGroupBooking: () => zMGroupBooking,
|
|
55
66
|
zMGroupTracker: () => zMGroupTracker,
|
|
56
67
|
zMInvoice: () => zMInvoice,
|
|
@@ -58,10 +69,7 @@ __export(src_exports, {
|
|
|
58
69
|
zMReportTicket: () => zMReportTicket,
|
|
59
70
|
zMSemester: () => zMSemester,
|
|
60
71
|
zMStudent: () => zMStudent,
|
|
61
|
-
zMTConfig: () => zMTConfig,
|
|
62
72
|
zMTConfigResponse: () => zMTConfigResponse,
|
|
63
|
-
zMTReg: () => zMTReg,
|
|
64
|
-
zMTTicket: () => zMTTicket,
|
|
65
73
|
zMTeacher: () => zMTeacher,
|
|
66
74
|
zMTeacherPayment: () => zMTeacherPayment,
|
|
67
75
|
zMUser: () => zMUser,
|
|
@@ -71,11 +79,6 @@ __export(src_exports, {
|
|
|
71
79
|
zScheduleTable: () => zScheduleTable,
|
|
72
80
|
zSemester: () => zSemester,
|
|
73
81
|
zStudent: () => zStudent,
|
|
74
|
-
zTConfig: () => zTConfig,
|
|
75
|
-
zTConfigResponse: () => zTConfigResponse,
|
|
76
|
-
zTReg: () => zTReg,
|
|
77
|
-
zTTicket: () => zTTicket,
|
|
78
|
-
zTTicketReg: () => zTTicketReg,
|
|
79
82
|
zTeacher: () => zTeacher,
|
|
80
83
|
zTeacherDisplay: () => zTeacherDisplay,
|
|
81
84
|
zTeacherPayment: () => zTeacherPayment,
|
|
@@ -134,9 +137,9 @@ var import_zod13 = require("zod");
|
|
|
134
137
|
// src/interface/mongoose/mongoose.ts
|
|
135
138
|
var import_zod3 = require("zod");
|
|
136
139
|
var import_mongoose2 = require("mongoose");
|
|
137
|
-
function extendZodObjectForMongoose(original) {
|
|
140
|
+
function extendZodObjectForMongoose(original, isIdString) {
|
|
138
141
|
return original.extend({
|
|
139
|
-
_id: import_zod3.z.instanceof(import_mongoose2.Types.ObjectId).or(import_zod3.z.string()),
|
|
142
|
+
_id: !isIdString ? import_zod3.z.instanceof(import_mongoose2.Types.ObjectId).or(import_zod3.z.string()) : import_zod3.z.string(),
|
|
140
143
|
createdAt: import_zod3.z.coerce.date().optional(),
|
|
141
144
|
updatedAt: import_zod3.z.coerce.date().optional()
|
|
142
145
|
});
|
|
@@ -484,47 +487,47 @@ var zSemester = import_zod19.z.object({
|
|
|
484
487
|
});
|
|
485
488
|
var zMSemester = extendZodObjectForMongoose(zSemester);
|
|
486
489
|
|
|
487
|
-
// src/interface/
|
|
490
|
+
// src/interface/event/eConfig.ts
|
|
488
491
|
var import_mongoose25 = require("mongoose");
|
|
489
492
|
var import_zod22 = require("zod");
|
|
490
493
|
|
|
491
|
-
// src/interface/
|
|
494
|
+
// src/interface/event/eTicket.ts
|
|
492
495
|
var import_zod20 = require("zod");
|
|
493
|
-
var
|
|
494
|
-
|
|
495
|
-
fields: import_zod20.z.array(import_zod20.z.string()).length(2),
|
|
496
|
-
data: zTable
|
|
497
|
-
});
|
|
498
|
-
var zScheduleTable = import_zod20.z.object({
|
|
499
|
-
fields: import_zod20.z.array(import_zod20.z.string()).length(2),
|
|
500
|
-
data: import_zod20.z.record(import_zod20.z.string(), zTable)
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
// src/interface/tournament/tTicket.ts
|
|
504
|
-
var import_zod21 = require("zod");
|
|
505
|
-
var zTTicket = import_zod21.z.object({
|
|
506
|
-
name: import_zod21.z.string(),
|
|
496
|
+
var zEventTicket = import_zod20.z.object({
|
|
497
|
+
name: import_zod20.z.string().min(5, "Name must be at least 5 characters"),
|
|
507
498
|
/**
|
|
508
499
|
* Price in cents
|
|
509
500
|
*/
|
|
510
|
-
price:
|
|
501
|
+
price: import_zod20.z.number().min(1, "Price must be at least $1"),
|
|
511
502
|
/**
|
|
512
503
|
* @optional description of the ticket
|
|
513
504
|
*/
|
|
514
|
-
description:
|
|
505
|
+
description: import_zod20.z.string().optional(),
|
|
515
506
|
/**
|
|
516
507
|
* @optional The ticket cannot be purchased if true
|
|
517
508
|
*/
|
|
518
|
-
isNotBuyable:
|
|
509
|
+
isNotBuyable: import_zod20.z.boolean().optional(),
|
|
519
510
|
/**
|
|
520
511
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
521
512
|
*/
|
|
522
|
-
lastBuyableDate:
|
|
513
|
+
lastBuyableDate: import_zod20.z.coerce.date().optional()
|
|
514
|
+
});
|
|
515
|
+
var zMEventTicket = extendZodObjectForMongoose(zEventTicket);
|
|
516
|
+
|
|
517
|
+
// src/interface/event/table.ts
|
|
518
|
+
var import_zod21 = require("zod");
|
|
519
|
+
var zTable = import_zod21.z.array(import_zod21.z.object({}));
|
|
520
|
+
var zDetailsTable = import_zod21.z.object({
|
|
521
|
+
fields: import_zod21.z.array(import_zod21.z.string()).length(2),
|
|
522
|
+
data: zTable
|
|
523
|
+
});
|
|
524
|
+
var zScheduleTable = import_zod21.z.object({
|
|
525
|
+
fields: import_zod21.z.array(import_zod21.z.string()).length(2),
|
|
526
|
+
data: import_zod21.z.record(import_zod21.z.string(), zTable)
|
|
523
527
|
});
|
|
524
|
-
var zMTTicket = extendZodObjectForMongoose(zTTicket);
|
|
525
528
|
|
|
526
|
-
// src/interface/
|
|
527
|
-
var
|
|
529
|
+
// src/interface/event/eConfig.ts
|
|
530
|
+
var zEventConfig = import_zod22.z.object({
|
|
528
531
|
/**
|
|
529
532
|
* Location of the event
|
|
530
533
|
*/
|
|
@@ -585,32 +588,35 @@ var zTConfig = import_zod22.z.object({
|
|
|
585
588
|
*/
|
|
586
589
|
image: zImageDef.optional()
|
|
587
590
|
});
|
|
588
|
-
var
|
|
589
|
-
tickets: import_zod22.z.array(
|
|
591
|
+
var zEventConfigResponse = zEventConfig.extend({
|
|
592
|
+
tickets: import_zod22.z.array(zMEventTicket)
|
|
590
593
|
});
|
|
591
|
-
var
|
|
592
|
-
var zMTConfigResponse = extendZodObjectForMongoose(
|
|
594
|
+
var zMEventConfig = extendZodObjectForMongoose(zEventConfig);
|
|
595
|
+
var zMTConfigResponse = extendZodObjectForMongoose(zEventConfigResponse, true);
|
|
593
596
|
|
|
594
|
-
// src/interface/
|
|
597
|
+
// src/interface/event/eReg.ts
|
|
595
598
|
var import_mongoose28 = require("mongoose");
|
|
596
599
|
var import_zod24 = require("zod");
|
|
597
600
|
|
|
598
|
-
// src/interface/
|
|
601
|
+
// src/interface/event/eTicketReg.ts
|
|
599
602
|
var import_zod23 = require("zod");
|
|
600
603
|
var import_mongoose27 = require("mongoose");
|
|
601
|
-
var
|
|
604
|
+
var zEventTicketReg = import_zod23.z.object({
|
|
602
605
|
ticket: import_zod23.z.instanceof(import_mongoose27.Types.ObjectId).or(import_zod23.z.string()),
|
|
603
606
|
/**
|
|
604
607
|
* integer minimum 1, otherwise no ticket is being bought
|
|
605
608
|
*/
|
|
606
609
|
amount: import_zod23.z.number().int().min(1)
|
|
607
610
|
});
|
|
611
|
+
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
612
|
+
ticket: zMEventTicket
|
|
613
|
+
});
|
|
608
614
|
|
|
609
|
-
// src/interface/
|
|
610
|
-
var
|
|
615
|
+
// src/interface/event/eReg.ts
|
|
616
|
+
var zEventReg = import_zod24.z.object({
|
|
611
617
|
agaId: import_zod24.z.string(),
|
|
612
618
|
tournamentId: import_zod24.z.instanceof(import_mongoose28.Types.ObjectId).or(import_zod24.z.string()),
|
|
613
|
-
tickets: import_zod24.z.array(
|
|
619
|
+
tickets: import_zod24.z.array(zEventTicketReg),
|
|
614
620
|
/**
|
|
615
621
|
* @units CENTS - Donation in cents
|
|
616
622
|
*/
|
|
@@ -624,7 +630,11 @@ var zTReg = import_zod24.z.object({
|
|
|
624
630
|
*/
|
|
625
631
|
edited: import_zod24.z.instanceof(import_mongoose28.Types.ObjectId).optional()
|
|
626
632
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
627
|
-
var
|
|
633
|
+
var zEventRegResponse = zEventReg.extend({
|
|
634
|
+
tickets: import_zod24.z.array(zEventTicketRegResponse)
|
|
635
|
+
});
|
|
636
|
+
var zMEventReg = extendZodObjectForMongoose(zEventReg);
|
|
637
|
+
var zMEventRegResponse = extendZodObjectForMongoose(zEventRegResponse, true);
|
|
628
638
|
|
|
629
639
|
// src/interface/user/goRank.ts
|
|
630
640
|
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
@@ -758,6 +768,13 @@ var zUserRoles = import_zod26.z.object({
|
|
|
758
768
|
zCourseTable,
|
|
759
769
|
zDetailsTable,
|
|
760
770
|
zDiscount,
|
|
771
|
+
zEventConfig,
|
|
772
|
+
zEventConfigResponse,
|
|
773
|
+
zEventReg,
|
|
774
|
+
zEventRegResponse,
|
|
775
|
+
zEventTicket,
|
|
776
|
+
zEventTicketReg,
|
|
777
|
+
zEventTicketRegResponse,
|
|
761
778
|
zGroupBooking,
|
|
762
779
|
zGroupTracker,
|
|
763
780
|
zImageDef,
|
|
@@ -769,6 +786,10 @@ var zUserRoles = import_zod26.z.object({
|
|
|
769
786
|
zMCampTracker,
|
|
770
787
|
zMClassTracker,
|
|
771
788
|
zMCourse,
|
|
789
|
+
zMEventConfig,
|
|
790
|
+
zMEventReg,
|
|
791
|
+
zMEventRegResponse,
|
|
792
|
+
zMEventTicket,
|
|
772
793
|
zMGroupBooking,
|
|
773
794
|
zMGroupTracker,
|
|
774
795
|
zMInvoice,
|
|
@@ -776,10 +797,7 @@ var zUserRoles = import_zod26.z.object({
|
|
|
776
797
|
zMReportTicket,
|
|
777
798
|
zMSemester,
|
|
778
799
|
zMStudent,
|
|
779
|
-
zMTConfig,
|
|
780
800
|
zMTConfigResponse,
|
|
781
|
-
zMTReg,
|
|
782
|
-
zMTTicket,
|
|
783
801
|
zMTeacher,
|
|
784
802
|
zMTeacherPayment,
|
|
785
803
|
zMUser,
|
|
@@ -789,11 +807,6 @@ var zUserRoles = import_zod26.z.object({
|
|
|
789
807
|
zScheduleTable,
|
|
790
808
|
zSemester,
|
|
791
809
|
zStudent,
|
|
792
|
-
zTConfig,
|
|
793
|
-
zTConfigResponse,
|
|
794
|
-
zTReg,
|
|
795
|
-
zTTicket,
|
|
796
|
-
zTTicketReg,
|
|
797
810
|
zTeacher,
|
|
798
811
|
zTeacherDisplay,
|
|
799
812
|
zTeacherPayment,
|
package/index.mjs
CHANGED
|
@@ -46,9 +46,9 @@ import { z as z13 } from "zod";
|
|
|
46
46
|
// src/interface/mongoose/mongoose.ts
|
|
47
47
|
import { z as z3 } from "zod";
|
|
48
48
|
import { Types as Types2 } from "mongoose";
|
|
49
|
-
function extendZodObjectForMongoose(original) {
|
|
49
|
+
function extendZodObjectForMongoose(original, isIdString) {
|
|
50
50
|
return original.extend({
|
|
51
|
-
_id: z3.instanceof(Types2.ObjectId).or(z3.string()),
|
|
51
|
+
_id: !isIdString ? z3.instanceof(Types2.ObjectId).or(z3.string()) : z3.string(),
|
|
52
52
|
createdAt: z3.coerce.date().optional(),
|
|
53
53
|
updatedAt: z3.coerce.date().optional()
|
|
54
54
|
});
|
|
@@ -396,47 +396,47 @@ var zSemester = z19.object({
|
|
|
396
396
|
});
|
|
397
397
|
var zMSemester = extendZodObjectForMongoose(zSemester);
|
|
398
398
|
|
|
399
|
-
// src/interface/
|
|
399
|
+
// src/interface/event/eConfig.ts
|
|
400
400
|
import { Types as Types12 } from "mongoose";
|
|
401
401
|
import { z as z22 } from "zod";
|
|
402
402
|
|
|
403
|
-
// src/interface/
|
|
403
|
+
// src/interface/event/eTicket.ts
|
|
404
404
|
import { z as z20 } from "zod";
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
fields: z20.array(z20.string()).length(2),
|
|
408
|
-
data: zTable
|
|
409
|
-
});
|
|
410
|
-
var zScheduleTable = z20.object({
|
|
411
|
-
fields: z20.array(z20.string()).length(2),
|
|
412
|
-
data: z20.record(z20.string(), zTable)
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
// src/interface/tournament/tTicket.ts
|
|
416
|
-
import { z as z21 } from "zod";
|
|
417
|
-
var zTTicket = z21.object({
|
|
418
|
-
name: z21.string(),
|
|
405
|
+
var zEventTicket = z20.object({
|
|
406
|
+
name: z20.string().min(5, "Name must be at least 5 characters"),
|
|
419
407
|
/**
|
|
420
408
|
* Price in cents
|
|
421
409
|
*/
|
|
422
|
-
price:
|
|
410
|
+
price: z20.number().min(1, "Price must be at least $1"),
|
|
423
411
|
/**
|
|
424
412
|
* @optional description of the ticket
|
|
425
413
|
*/
|
|
426
|
-
description:
|
|
414
|
+
description: z20.string().optional(),
|
|
427
415
|
/**
|
|
428
416
|
* @optional The ticket cannot be purchased if true
|
|
429
417
|
*/
|
|
430
|
-
isNotBuyable:
|
|
418
|
+
isNotBuyable: z20.boolean().optional(),
|
|
431
419
|
/**
|
|
432
420
|
* @optional If date is provided and in the past, ticket cannot be purchased
|
|
433
421
|
*/
|
|
434
|
-
lastBuyableDate:
|
|
422
|
+
lastBuyableDate: z20.coerce.date().optional()
|
|
423
|
+
});
|
|
424
|
+
var zMEventTicket = extendZodObjectForMongoose(zEventTicket);
|
|
425
|
+
|
|
426
|
+
// src/interface/event/table.ts
|
|
427
|
+
import { z as z21 } from "zod";
|
|
428
|
+
var zTable = z21.array(z21.object({}));
|
|
429
|
+
var zDetailsTable = z21.object({
|
|
430
|
+
fields: z21.array(z21.string()).length(2),
|
|
431
|
+
data: zTable
|
|
432
|
+
});
|
|
433
|
+
var zScheduleTable = z21.object({
|
|
434
|
+
fields: z21.array(z21.string()).length(2),
|
|
435
|
+
data: z21.record(z21.string(), zTable)
|
|
435
436
|
});
|
|
436
|
-
var zMTTicket = extendZodObjectForMongoose(zTTicket);
|
|
437
437
|
|
|
438
|
-
// src/interface/
|
|
439
|
-
var
|
|
438
|
+
// src/interface/event/eConfig.ts
|
|
439
|
+
var zEventConfig = z22.object({
|
|
440
440
|
/**
|
|
441
441
|
* Location of the event
|
|
442
442
|
*/
|
|
@@ -497,32 +497,35 @@ var zTConfig = z22.object({
|
|
|
497
497
|
*/
|
|
498
498
|
image: zImageDef.optional()
|
|
499
499
|
});
|
|
500
|
-
var
|
|
501
|
-
tickets: z22.array(
|
|
500
|
+
var zEventConfigResponse = zEventConfig.extend({
|
|
501
|
+
tickets: z22.array(zMEventTicket)
|
|
502
502
|
});
|
|
503
|
-
var
|
|
504
|
-
var zMTConfigResponse = extendZodObjectForMongoose(
|
|
503
|
+
var zMEventConfig = extendZodObjectForMongoose(zEventConfig);
|
|
504
|
+
var zMTConfigResponse = extendZodObjectForMongoose(zEventConfigResponse, true);
|
|
505
505
|
|
|
506
|
-
// src/interface/
|
|
506
|
+
// src/interface/event/eReg.ts
|
|
507
507
|
import { Types as Types14 } from "mongoose";
|
|
508
508
|
import { z as z24 } from "zod";
|
|
509
509
|
|
|
510
|
-
// src/interface/
|
|
510
|
+
// src/interface/event/eTicketReg.ts
|
|
511
511
|
import { z as z23 } from "zod";
|
|
512
512
|
import { Types as Types13 } from "mongoose";
|
|
513
|
-
var
|
|
513
|
+
var zEventTicketReg = z23.object({
|
|
514
514
|
ticket: z23.instanceof(Types13.ObjectId).or(z23.string()),
|
|
515
515
|
/**
|
|
516
516
|
* integer minimum 1, otherwise no ticket is being bought
|
|
517
517
|
*/
|
|
518
518
|
amount: z23.number().int().min(1)
|
|
519
519
|
});
|
|
520
|
+
var zEventTicketRegResponse = zEventTicketReg.extend({
|
|
521
|
+
ticket: zMEventTicket
|
|
522
|
+
});
|
|
520
523
|
|
|
521
|
-
// src/interface/
|
|
522
|
-
var
|
|
524
|
+
// src/interface/event/eReg.ts
|
|
525
|
+
var zEventReg = z24.object({
|
|
523
526
|
agaId: z24.string(),
|
|
524
527
|
tournamentId: z24.instanceof(Types14.ObjectId).or(z24.string()),
|
|
525
|
-
tickets: z24.array(
|
|
528
|
+
tickets: z24.array(zEventTicketReg),
|
|
526
529
|
/**
|
|
527
530
|
* @units CENTS - Donation in cents
|
|
528
531
|
*/
|
|
@@ -536,7 +539,11 @@ var zTReg = z24.object({
|
|
|
536
539
|
*/
|
|
537
540
|
edited: z24.instanceof(Types14.ObjectId).optional()
|
|
538
541
|
}).merge(zBUserInfo).merge(zBPaymentInfo);
|
|
539
|
-
var
|
|
542
|
+
var zEventRegResponse = zEventReg.extend({
|
|
543
|
+
tickets: z24.array(zEventTicketRegResponse)
|
|
544
|
+
});
|
|
545
|
+
var zMEventReg = extendZodObjectForMongoose(zEventReg);
|
|
546
|
+
var zMEventRegResponse = extendZodObjectForMongoose(zEventRegResponse, true);
|
|
540
547
|
|
|
541
548
|
// src/interface/user/goRank.ts
|
|
542
549
|
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
@@ -669,6 +676,13 @@ export {
|
|
|
669
676
|
zCourseTable,
|
|
670
677
|
zDetailsTable,
|
|
671
678
|
zDiscount,
|
|
679
|
+
zEventConfig,
|
|
680
|
+
zEventConfigResponse,
|
|
681
|
+
zEventReg,
|
|
682
|
+
zEventRegResponse,
|
|
683
|
+
zEventTicket,
|
|
684
|
+
zEventTicketReg,
|
|
685
|
+
zEventTicketRegResponse,
|
|
672
686
|
zGroupBooking,
|
|
673
687
|
zGroupTracker,
|
|
674
688
|
zImageDef,
|
|
@@ -680,6 +694,10 @@ export {
|
|
|
680
694
|
zMCampTracker,
|
|
681
695
|
zMClassTracker,
|
|
682
696
|
zMCourse,
|
|
697
|
+
zMEventConfig,
|
|
698
|
+
zMEventReg,
|
|
699
|
+
zMEventRegResponse,
|
|
700
|
+
zMEventTicket,
|
|
683
701
|
zMGroupBooking,
|
|
684
702
|
zMGroupTracker,
|
|
685
703
|
zMInvoice,
|
|
@@ -687,10 +705,7 @@ export {
|
|
|
687
705
|
zMReportTicket,
|
|
688
706
|
zMSemester,
|
|
689
707
|
zMStudent,
|
|
690
|
-
zMTConfig,
|
|
691
708
|
zMTConfigResponse,
|
|
692
|
-
zMTReg,
|
|
693
|
-
zMTTicket,
|
|
694
709
|
zMTeacher,
|
|
695
710
|
zMTeacherPayment,
|
|
696
711
|
zMUser,
|
|
@@ -700,11 +715,6 @@ export {
|
|
|
700
715
|
zScheduleTable,
|
|
701
716
|
zSemester,
|
|
702
717
|
zStudent,
|
|
703
|
-
zTConfig,
|
|
704
|
-
zTConfigResponse,
|
|
705
|
-
zTReg,
|
|
706
|
-
zTTicket,
|
|
707
|
-
zTTicketReg,
|
|
708
718
|
zTeacher,
|
|
709
719
|
zTeacherDisplay,
|
|
710
720
|
zTeacherPayment,
|