@nyig/models 0.2.37 → 0.2.38
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 +561 -269
- package/index.d.ts +561 -269
- package/index.js +61 -57
- package/index.mjs +60 -57
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -69,6 +69,7 @@ __export(src_exports, {
|
|
|
69
69
|
zInvoice: () => zInvoice,
|
|
70
70
|
zInvoiceItem: () => zInvoiceItem,
|
|
71
71
|
zInvoicePackage: () => zInvoicePackage,
|
|
72
|
+
zInvoiceResponse: () => zInvoiceResponse,
|
|
72
73
|
zPrivateBooking: () => zPrivateBooking,
|
|
73
74
|
zReportTicket: () => zReportTicket,
|
|
74
75
|
zScheduleData: () => zScheduleData,
|
|
@@ -201,7 +202,7 @@ var zCampTracker = addAutoProps(zBCampTracker);
|
|
|
201
202
|
var import_zod11 = require("zod");
|
|
202
203
|
|
|
203
204
|
// src/interface/payment/invoice.ts
|
|
204
|
-
var
|
|
205
|
+
var import_zod9 = require("zod");
|
|
205
206
|
|
|
206
207
|
// src/interface/payment/paymentMethod.ts
|
|
207
208
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -212,36 +213,6 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
212
213
|
return PaymentMethod2;
|
|
213
214
|
})(PaymentMethod || {});
|
|
214
215
|
|
|
215
|
-
// src/interface/payment/invoice.ts
|
|
216
|
-
var zDiscount = import_zod7.z.object({
|
|
217
|
-
desc: import_zod7.z.string(),
|
|
218
|
-
amount: import_zod7.z.number()
|
|
219
|
-
});
|
|
220
|
-
var zInvoiceItem = import_zod7.z.object({
|
|
221
|
-
course: import_zod7.z.string().min(1),
|
|
222
|
-
price: import_zod7.z.number(),
|
|
223
|
-
units: import_zod7.z.number()
|
|
224
|
-
});
|
|
225
|
-
var zInvoicePackage = import_zod7.z.object({
|
|
226
|
-
student: import_zod7.z.string(),
|
|
227
|
-
items: import_zod7.z.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
228
|
-
});
|
|
229
|
-
var zBInvoice = import_zod7.z.object({
|
|
230
|
-
billTo: import_zod7.z.string().min(1, "The 'Bill To' field must not be empty"),
|
|
231
|
-
packages: import_zod7.z.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
232
|
-
discounts: import_zod7.z.array(zDiscount),
|
|
233
|
-
textbook: import_zod7.z.number().int().min(0).optional(),
|
|
234
|
-
shipping: import_zod7.z.number().int().min(0).optional(),
|
|
235
|
-
paid: import_zod7.z.nativeEnum(PaymentMethod).optional(),
|
|
236
|
-
notes: import_zod7.z.string().optional(),
|
|
237
|
-
createdBy: import_zod7.z.string(),
|
|
238
|
-
lastEditBy: import_zod7.z.string().optional()
|
|
239
|
-
});
|
|
240
|
-
var zInvoice = addAutoProps(zBInvoice);
|
|
241
|
-
|
|
242
|
-
// src/interface/payment/teacherPayment.ts
|
|
243
|
-
var import_zod10 = require("zod");
|
|
244
|
-
|
|
245
216
|
// src/interface/user/goRank.ts
|
|
246
217
|
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
247
218
|
GoRank2["KYU1"] = "1k";
|
|
@@ -289,44 +260,44 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
289
260
|
})(GoRank || {});
|
|
290
261
|
|
|
291
262
|
// src/interface/user/user.ts
|
|
292
|
-
var
|
|
293
|
-
var zBUser =
|
|
294
|
-
name:
|
|
295
|
-
username:
|
|
296
|
-
password:
|
|
297
|
-
roles:
|
|
298
|
-
email:
|
|
299
|
-
address:
|
|
300
|
-
country:
|
|
263
|
+
var import_zod7 = require("zod");
|
|
264
|
+
var zBUser = import_zod7.z.object({
|
|
265
|
+
name: import_zod7.z.string().min(2).max(100),
|
|
266
|
+
username: import_zod7.z.string().optional(),
|
|
267
|
+
password: import_zod7.z.string().optional(),
|
|
268
|
+
roles: import_zod7.z.array(import_zod7.z.number().int()).optional(),
|
|
269
|
+
email: import_zod7.z.string().max(100).email().or(import_zod7.z.literal("")).optional(),
|
|
270
|
+
address: import_zod7.z.string().or(import_zod7.z.literal("")).optional(),
|
|
271
|
+
country: import_zod7.z.string().length(2, {
|
|
301
272
|
message: "Enter the 2-letter country code"
|
|
302
|
-
}).or(
|
|
303
|
-
phoneNumber:
|
|
273
|
+
}).or(import_zod7.z.literal("")).optional(),
|
|
274
|
+
phoneNumber: import_zod7.z.string().regex(/^\d{10}/, {
|
|
304
275
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
305
|
-
}).or(
|
|
306
|
-
birthDate:
|
|
276
|
+
}).or(import_zod7.z.literal("")).optional(),
|
|
277
|
+
birthDate: import_zod7.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
307
278
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
308
|
-
}).or(
|
|
279
|
+
}).or(import_zod7.z.literal("")).optional()
|
|
309
280
|
});
|
|
310
281
|
var zUser = addAutoProps(zBUser);
|
|
311
282
|
var zStudent = zUser.extend({
|
|
312
|
-
rank:
|
|
313
|
-
guardian:
|
|
283
|
+
rank: import_zod7.z.nativeEnum(GoRank),
|
|
284
|
+
guardian: import_zod7.z.string().optional()
|
|
314
285
|
});
|
|
315
286
|
var zTeacher = zUser.extend({
|
|
316
|
-
rank:
|
|
287
|
+
rank: import_zod7.z.nativeEnum(GoRank),
|
|
317
288
|
/**
|
|
318
289
|
* Inactive teachers are not shown on public endpoints
|
|
319
290
|
*/
|
|
320
|
-
isInactive:
|
|
291
|
+
isInactive: import_zod7.z.boolean().optional(),
|
|
321
292
|
/**
|
|
322
293
|
* Teacher's position, e.g., instructor, president
|
|
323
294
|
*/
|
|
324
|
-
title:
|
|
295
|
+
title: import_zod7.z.string().optional(),
|
|
325
296
|
/**
|
|
326
297
|
* Teacher's bio text describing experience
|
|
327
298
|
* new lines will be rendered as paragraphs
|
|
328
299
|
*/
|
|
329
|
-
bio:
|
|
300
|
+
bio: import_zod7.z.string().optional(),
|
|
330
301
|
/** Format is illustrated below, where teacher is available
|
|
331
302
|
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
332
303
|
* [
|
|
@@ -339,18 +310,50 @@ var zTeacher = zUser.extend({
|
|
|
339
310
|
* [],
|
|
340
311
|
* ]
|
|
341
312
|
*/
|
|
342
|
-
available:
|
|
313
|
+
available: import_zod7.z.array(import_zod7.z.array(import_zod7.z.array(import_zod7.z.number()))).optional()
|
|
343
314
|
});
|
|
344
315
|
|
|
345
316
|
// src/interface/user/userRoles.ts
|
|
346
|
-
var
|
|
347
|
-
var zUserRoles =
|
|
348
|
-
user:
|
|
349
|
-
admin:
|
|
350
|
-
superadmin:
|
|
317
|
+
var import_zod8 = require("zod");
|
|
318
|
+
var zUserRoles = import_zod8.z.object({
|
|
319
|
+
user: import_zod8.z.number().int(),
|
|
320
|
+
admin: import_zod8.z.number().int(),
|
|
321
|
+
superadmin: import_zod8.z.number().int()
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// src/interface/payment/invoice.ts
|
|
325
|
+
var zDiscount = import_zod9.z.object({
|
|
326
|
+
desc: import_zod9.z.string().min(1, "Discount description cannot be empty"),
|
|
327
|
+
amount: import_zod9.z.coerce.number()
|
|
328
|
+
});
|
|
329
|
+
var zInvoiceItem = import_zod9.z.object({
|
|
330
|
+
course: import_zod9.z.string().min(1, "Course description cannot be empty"),
|
|
331
|
+
price: import_zod9.z.coerce.number(),
|
|
332
|
+
units: import_zod9.z.coerce.number()
|
|
333
|
+
});
|
|
334
|
+
var zInvoicePackage = import_zod9.z.object({
|
|
335
|
+
student: import_zod9.z.string(),
|
|
336
|
+
items: import_zod9.z.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
337
|
+
});
|
|
338
|
+
var zBInvoice = import_zod9.z.object({
|
|
339
|
+
billTo: import_zod9.z.string().min(1, "The 'Bill To' field must not be empty"),
|
|
340
|
+
packages: import_zod9.z.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
341
|
+
discounts: import_zod9.z.array(zDiscount),
|
|
342
|
+
textbook: import_zod9.z.coerce.number().int().min(0).optional(),
|
|
343
|
+
shipping: import_zod9.z.coerce.number().int().min(0).optional(),
|
|
344
|
+
paid: import_zod9.z.nativeEnum(PaymentMethod).optional(),
|
|
345
|
+
notes: import_zod9.z.string().or(import_zod9.z.literal("")).optional(),
|
|
346
|
+
createdBy: import_zod9.z.string(),
|
|
347
|
+
lastEditBy: import_zod9.z.string().optional()
|
|
348
|
+
});
|
|
349
|
+
var zInvoice = addAutoProps(zBInvoice);
|
|
350
|
+
var zInvoiceResponse = zInvoice.extend({
|
|
351
|
+
createdBy: zTeacher,
|
|
352
|
+
lastEditBy: zTeacher.optional()
|
|
351
353
|
});
|
|
352
354
|
|
|
353
355
|
// src/interface/payment/teacherPayment.ts
|
|
356
|
+
var import_zod10 = require("zod");
|
|
354
357
|
var zTeacherPaymentRow = import_zod10.z.object({
|
|
355
358
|
course: import_zod10.z.string().min(1, "select or enter a course"),
|
|
356
359
|
length: import_zod10.z.coerce.number().gt(0, "must be > 0"),
|
|
@@ -778,6 +781,7 @@ var zEventRegResponse = zEventReg.extend({
|
|
|
778
781
|
zInvoice,
|
|
779
782
|
zInvoiceItem,
|
|
780
783
|
zInvoicePackage,
|
|
784
|
+
zInvoiceResponse,
|
|
781
785
|
zPrivateBooking,
|
|
782
786
|
zReportTicket,
|
|
783
787
|
zScheduleData,
|
package/index.mjs
CHANGED
|
@@ -113,7 +113,7 @@ var zCampTracker = addAutoProps(zBCampTracker);
|
|
|
113
113
|
import { z as z11 } from "zod";
|
|
114
114
|
|
|
115
115
|
// src/interface/payment/invoice.ts
|
|
116
|
-
import { z as
|
|
116
|
+
import { z as z9 } from "zod";
|
|
117
117
|
|
|
118
118
|
// src/interface/payment/paymentMethod.ts
|
|
119
119
|
var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
@@ -124,36 +124,6 @@ var PaymentMethod = /* @__PURE__ */ ((PaymentMethod2) => {
|
|
|
124
124
|
return PaymentMethod2;
|
|
125
125
|
})(PaymentMethod || {});
|
|
126
126
|
|
|
127
|
-
// src/interface/payment/invoice.ts
|
|
128
|
-
var zDiscount = z7.object({
|
|
129
|
-
desc: z7.string(),
|
|
130
|
-
amount: z7.number()
|
|
131
|
-
});
|
|
132
|
-
var zInvoiceItem = z7.object({
|
|
133
|
-
course: z7.string().min(1),
|
|
134
|
-
price: z7.number(),
|
|
135
|
-
units: z7.number()
|
|
136
|
-
});
|
|
137
|
-
var zInvoicePackage = z7.object({
|
|
138
|
-
student: z7.string(),
|
|
139
|
-
items: z7.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
140
|
-
});
|
|
141
|
-
var zBInvoice = z7.object({
|
|
142
|
-
billTo: z7.string().min(1, "The 'Bill To' field must not be empty"),
|
|
143
|
-
packages: z7.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
144
|
-
discounts: z7.array(zDiscount),
|
|
145
|
-
textbook: z7.number().int().min(0).optional(),
|
|
146
|
-
shipping: z7.number().int().min(0).optional(),
|
|
147
|
-
paid: z7.nativeEnum(PaymentMethod).optional(),
|
|
148
|
-
notes: z7.string().optional(),
|
|
149
|
-
createdBy: z7.string(),
|
|
150
|
-
lastEditBy: z7.string().optional()
|
|
151
|
-
});
|
|
152
|
-
var zInvoice = addAutoProps(zBInvoice);
|
|
153
|
-
|
|
154
|
-
// src/interface/payment/teacherPayment.ts
|
|
155
|
-
import { z as z10 } from "zod";
|
|
156
|
-
|
|
157
127
|
// src/interface/user/goRank.ts
|
|
158
128
|
var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
159
129
|
GoRank2["KYU1"] = "1k";
|
|
@@ -201,44 +171,44 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
201
171
|
})(GoRank || {});
|
|
202
172
|
|
|
203
173
|
// src/interface/user/user.ts
|
|
204
|
-
import { z as
|
|
205
|
-
var zBUser =
|
|
206
|
-
name:
|
|
207
|
-
username:
|
|
208
|
-
password:
|
|
209
|
-
roles:
|
|
210
|
-
email:
|
|
211
|
-
address:
|
|
212
|
-
country:
|
|
174
|
+
import { z as z7 } from "zod";
|
|
175
|
+
var zBUser = z7.object({
|
|
176
|
+
name: z7.string().min(2).max(100),
|
|
177
|
+
username: z7.string().optional(),
|
|
178
|
+
password: z7.string().optional(),
|
|
179
|
+
roles: z7.array(z7.number().int()).optional(),
|
|
180
|
+
email: z7.string().max(100).email().or(z7.literal("")).optional(),
|
|
181
|
+
address: z7.string().or(z7.literal("")).optional(),
|
|
182
|
+
country: z7.string().length(2, {
|
|
213
183
|
message: "Enter the 2-letter country code"
|
|
214
|
-
}).or(
|
|
215
|
-
phoneNumber:
|
|
184
|
+
}).or(z7.literal("")).optional(),
|
|
185
|
+
phoneNumber: z7.string().regex(/^\d{10}/, {
|
|
216
186
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
217
|
-
}).or(
|
|
218
|
-
birthDate:
|
|
187
|
+
}).or(z7.literal("")).optional(),
|
|
188
|
+
birthDate: z7.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
219
189
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
220
|
-
}).or(
|
|
190
|
+
}).or(z7.literal("")).optional()
|
|
221
191
|
});
|
|
222
192
|
var zUser = addAutoProps(zBUser);
|
|
223
193
|
var zStudent = zUser.extend({
|
|
224
|
-
rank:
|
|
225
|
-
guardian:
|
|
194
|
+
rank: z7.nativeEnum(GoRank),
|
|
195
|
+
guardian: z7.string().optional()
|
|
226
196
|
});
|
|
227
197
|
var zTeacher = zUser.extend({
|
|
228
|
-
rank:
|
|
198
|
+
rank: z7.nativeEnum(GoRank),
|
|
229
199
|
/**
|
|
230
200
|
* Inactive teachers are not shown on public endpoints
|
|
231
201
|
*/
|
|
232
|
-
isInactive:
|
|
202
|
+
isInactive: z7.boolean().optional(),
|
|
233
203
|
/**
|
|
234
204
|
* Teacher's position, e.g., instructor, president
|
|
235
205
|
*/
|
|
236
|
-
title:
|
|
206
|
+
title: z7.string().optional(),
|
|
237
207
|
/**
|
|
238
208
|
* Teacher's bio text describing experience
|
|
239
209
|
* new lines will be rendered as paragraphs
|
|
240
210
|
*/
|
|
241
|
-
bio:
|
|
211
|
+
bio: z7.string().optional(),
|
|
242
212
|
/** Format is illustrated below, where teacher is available
|
|
243
213
|
* Mon 9-12am 3-6pm & Tue 10-12am 6-10pm
|
|
244
214
|
* [
|
|
@@ -251,18 +221,50 @@ var zTeacher = zUser.extend({
|
|
|
251
221
|
* [],
|
|
252
222
|
* ]
|
|
253
223
|
*/
|
|
254
|
-
available:
|
|
224
|
+
available: z7.array(z7.array(z7.array(z7.number()))).optional()
|
|
255
225
|
});
|
|
256
226
|
|
|
257
227
|
// src/interface/user/userRoles.ts
|
|
258
|
-
import { z as
|
|
259
|
-
var zUserRoles =
|
|
260
|
-
user:
|
|
261
|
-
admin:
|
|
262
|
-
superadmin:
|
|
228
|
+
import { z as z8 } from "zod";
|
|
229
|
+
var zUserRoles = z8.object({
|
|
230
|
+
user: z8.number().int(),
|
|
231
|
+
admin: z8.number().int(),
|
|
232
|
+
superadmin: z8.number().int()
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// src/interface/payment/invoice.ts
|
|
236
|
+
var zDiscount = z9.object({
|
|
237
|
+
desc: z9.string().min(1, "Discount description cannot be empty"),
|
|
238
|
+
amount: z9.coerce.number()
|
|
239
|
+
});
|
|
240
|
+
var zInvoiceItem = z9.object({
|
|
241
|
+
course: z9.string().min(1, "Course description cannot be empty"),
|
|
242
|
+
price: z9.coerce.number(),
|
|
243
|
+
units: z9.coerce.number()
|
|
244
|
+
});
|
|
245
|
+
var zInvoicePackage = z9.object({
|
|
246
|
+
student: z9.string(),
|
|
247
|
+
items: z9.array(zInvoiceItem).min(1, "Package must contain at least one item")
|
|
248
|
+
});
|
|
249
|
+
var zBInvoice = z9.object({
|
|
250
|
+
billTo: z9.string().min(1, "The 'Bill To' field must not be empty"),
|
|
251
|
+
packages: z9.array(zInvoicePackage).min(1, "Invoice must include at least one package"),
|
|
252
|
+
discounts: z9.array(zDiscount),
|
|
253
|
+
textbook: z9.coerce.number().int().min(0).optional(),
|
|
254
|
+
shipping: z9.coerce.number().int().min(0).optional(),
|
|
255
|
+
paid: z9.nativeEnum(PaymentMethod).optional(),
|
|
256
|
+
notes: z9.string().or(z9.literal("")).optional(),
|
|
257
|
+
createdBy: z9.string(),
|
|
258
|
+
lastEditBy: z9.string().optional()
|
|
259
|
+
});
|
|
260
|
+
var zInvoice = addAutoProps(zBInvoice);
|
|
261
|
+
var zInvoiceResponse = zInvoice.extend({
|
|
262
|
+
createdBy: zTeacher,
|
|
263
|
+
lastEditBy: zTeacher.optional()
|
|
263
264
|
});
|
|
264
265
|
|
|
265
266
|
// src/interface/payment/teacherPayment.ts
|
|
267
|
+
import { z as z10 } from "zod";
|
|
266
268
|
var zTeacherPaymentRow = z10.object({
|
|
267
269
|
course: z10.string().min(1, "select or enter a course"),
|
|
268
270
|
length: z10.coerce.number().gt(0, "must be > 0"),
|
|
@@ -689,6 +691,7 @@ export {
|
|
|
689
691
|
zInvoice,
|
|
690
692
|
zInvoiceItem,
|
|
691
693
|
zInvoicePackage,
|
|
694
|
+
zInvoiceResponse,
|
|
692
695
|
zPrivateBooking,
|
|
693
696
|
zReportTicket,
|
|
694
697
|
zScheduleData,
|