@nyig/models 0.5.7 → 0.6.1
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 +7543 -475
- package/index.d.ts +7543 -475
- package/index.js +33 -33
- package/index.mjs +33 -33
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -264,7 +264,7 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
264
264
|
})(GoRank || {});
|
|
265
265
|
|
|
266
266
|
// src/interface/user/user.ts
|
|
267
|
-
var
|
|
267
|
+
var import_zod7 = require("zod");
|
|
268
268
|
|
|
269
269
|
// src/interface/user/roles.ts
|
|
270
270
|
var import_zod5 = require("zod");
|
|
@@ -280,55 +280,55 @@ var zUserRoles = import_zod5.z.object({
|
|
|
280
280
|
superadmin: import_zod5.z.number().int().optional()
|
|
281
281
|
});
|
|
282
282
|
|
|
283
|
-
// src/interface/user/
|
|
284
|
-
var
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
roles: zUserRoles.optional(),
|
|
289
|
-
email: import_zod6.z.string().max(100).email().or(import_zod6.z.literal("")).optional(),
|
|
283
|
+
// src/interface/user/userProfile.ts
|
|
284
|
+
var import_zod6 = require("zod");
|
|
285
|
+
var zBUserProfile = import_zod6.z.object({
|
|
286
|
+
firstName: import_zod6.z.string().min(2).max(50).or(import_zod6.z.literal("")).optional(),
|
|
287
|
+
lastName: import_zod6.z.string().min(2).max(50).or(import_zod6.z.literal("")).optional(),
|
|
290
288
|
address: import_zod6.z.string().or(import_zod6.z.literal("")).optional(),
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
rank: import_zod6.z.nativeEnum(GoRank).optional(),
|
|
290
|
+
agaId: import_zod6.z.string().regex(/^\d{4,5}$/, {
|
|
291
|
+
message: `Please enter a valid AGA ID`
|
|
293
292
|
}).or(import_zod6.z.literal("")).optional(),
|
|
293
|
+
participateAs: import_zod6.z.enum(["adult", "youth"]).optional(),
|
|
294
|
+
showOnWhoIsComing: import_zod6.z.boolean().optional(),
|
|
295
|
+
preferredEmail: import_zod6.z.string().email().optional(),
|
|
294
296
|
phoneNumber: import_zod6.z.string().regex(/^\d{10}/, {
|
|
295
297
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
296
298
|
}).or(import_zod6.z.literal("")).optional(),
|
|
297
299
|
birthDate: import_zod6.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
298
300
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
299
|
-
}).or(import_zod6.z.literal("")).optional()
|
|
300
|
-
/**
|
|
301
|
-
* For prompting the user to change their password on first login
|
|
302
|
-
*/
|
|
303
|
-
shouldChangePassword: import_zod6.z.boolean().optional(),
|
|
304
|
-
/**
|
|
305
|
-
* UserProfile Object storing user preferences
|
|
306
|
-
*/
|
|
307
|
-
profile: import_zod6.z.string().optional()
|
|
301
|
+
}).or(import_zod6.z.literal("")).optional()
|
|
308
302
|
});
|
|
309
|
-
var
|
|
303
|
+
var zUserProfile = addAutoProps(zBUserProfile);
|
|
310
304
|
|
|
311
|
-
// src/interface/user/
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
305
|
+
// src/interface/user/user.ts
|
|
306
|
+
var zBUser = import_zod7.z.object({
|
|
307
|
+
name: import_zod7.z.string().min(2).max(100),
|
|
308
|
+
username: import_zod7.z.string().optional(),
|
|
309
|
+
password: import_zod7.z.string().optional(),
|
|
310
|
+
roles: zUserRoles.optional(),
|
|
311
|
+
email: import_zod7.z.string().max(100).email().or(import_zod7.z.literal("")).optional(),
|
|
316
312
|
address: import_zod7.z.string().or(import_zod7.z.literal("")).optional(),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
message: `Please enter a valid AGA ID`
|
|
313
|
+
country: import_zod7.z.string().length(2, {
|
|
314
|
+
message: "Enter the 2-letter country code"
|
|
320
315
|
}).or(import_zod7.z.literal("")).optional(),
|
|
321
|
-
participateAs: import_zod7.z.enum(["adult", "youth"]).optional(),
|
|
322
|
-
showOnWhoIsComing: import_zod7.z.boolean().optional(),
|
|
323
|
-
preferredEmail: import_zod7.z.email().optional(),
|
|
324
316
|
phoneNumber: import_zod7.z.string().regex(/^\d{10}/, {
|
|
325
317
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
326
318
|
}).or(import_zod7.z.literal("")).optional(),
|
|
327
319
|
birthDate: import_zod7.z.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
328
320
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
329
|
-
}).or(import_zod7.z.literal("")).optional()
|
|
321
|
+
}).or(import_zod7.z.literal("")).optional(),
|
|
322
|
+
/**
|
|
323
|
+
* For prompting the user to change their password on first login
|
|
324
|
+
*/
|
|
325
|
+
shouldChangePassword: import_zod7.z.boolean().optional(),
|
|
326
|
+
/**
|
|
327
|
+
* UserProfile Object storing user preferences
|
|
328
|
+
*/
|
|
329
|
+
profiles: import_zod7.z.array(zUserProfile).optional()
|
|
330
330
|
});
|
|
331
|
-
var
|
|
331
|
+
var zUser = addAutoProps(zBUser);
|
|
332
332
|
|
|
333
333
|
// src/interface/user/student.ts
|
|
334
334
|
var import_zod8 = require("zod");
|
package/index.mjs
CHANGED
|
@@ -153,7 +153,7 @@ var GoRank = /* @__PURE__ */ ((GoRank2) => {
|
|
|
153
153
|
})(GoRank || {});
|
|
154
154
|
|
|
155
155
|
// src/interface/user/user.ts
|
|
156
|
-
import { z as
|
|
156
|
+
import { z as z7 } from "zod";
|
|
157
157
|
|
|
158
158
|
// src/interface/user/roles.ts
|
|
159
159
|
import { z as z5 } from "zod";
|
|
@@ -169,55 +169,55 @@ var zUserRoles = z5.object({
|
|
|
169
169
|
superadmin: z5.number().int().optional()
|
|
170
170
|
});
|
|
171
171
|
|
|
172
|
-
// src/interface/user/
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
roles: zUserRoles.optional(),
|
|
178
|
-
email: z6.string().max(100).email().or(z6.literal("")).optional(),
|
|
172
|
+
// src/interface/user/userProfile.ts
|
|
173
|
+
import { z as z6 } from "zod";
|
|
174
|
+
var zBUserProfile = z6.object({
|
|
175
|
+
firstName: z6.string().min(2).max(50).or(z6.literal("")).optional(),
|
|
176
|
+
lastName: z6.string().min(2).max(50).or(z6.literal("")).optional(),
|
|
179
177
|
address: z6.string().or(z6.literal("")).optional(),
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
rank: z6.nativeEnum(GoRank).optional(),
|
|
179
|
+
agaId: z6.string().regex(/^\d{4,5}$/, {
|
|
180
|
+
message: `Please enter a valid AGA ID`
|
|
182
181
|
}).or(z6.literal("")).optional(),
|
|
182
|
+
participateAs: z6.enum(["adult", "youth"]).optional(),
|
|
183
|
+
showOnWhoIsComing: z6.boolean().optional(),
|
|
184
|
+
preferredEmail: z6.string().email().optional(),
|
|
183
185
|
phoneNumber: z6.string().regex(/^\d{10}/, {
|
|
184
186
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
185
187
|
}).or(z6.literal("")).optional(),
|
|
186
188
|
birthDate: z6.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
187
189
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
188
|
-
}).or(z6.literal("")).optional()
|
|
189
|
-
/**
|
|
190
|
-
* For prompting the user to change their password on first login
|
|
191
|
-
*/
|
|
192
|
-
shouldChangePassword: z6.boolean().optional(),
|
|
193
|
-
/**
|
|
194
|
-
* UserProfile Object storing user preferences
|
|
195
|
-
*/
|
|
196
|
-
profile: z6.string().optional()
|
|
190
|
+
}).or(z6.literal("")).optional()
|
|
197
191
|
});
|
|
198
|
-
var
|
|
192
|
+
var zUserProfile = addAutoProps(zBUserProfile);
|
|
199
193
|
|
|
200
|
-
// src/interface/user/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
194
|
+
// src/interface/user/user.ts
|
|
195
|
+
var zBUser = z7.object({
|
|
196
|
+
name: z7.string().min(2).max(100),
|
|
197
|
+
username: z7.string().optional(),
|
|
198
|
+
password: z7.string().optional(),
|
|
199
|
+
roles: zUserRoles.optional(),
|
|
200
|
+
email: z7.string().max(100).email().or(z7.literal("")).optional(),
|
|
205
201
|
address: z7.string().or(z7.literal("")).optional(),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
message: `Please enter a valid AGA ID`
|
|
202
|
+
country: z7.string().length(2, {
|
|
203
|
+
message: "Enter the 2-letter country code"
|
|
209
204
|
}).or(z7.literal("")).optional(),
|
|
210
|
-
participateAs: z7.enum(["adult", "youth"]).optional(),
|
|
211
|
-
showOnWhoIsComing: z7.boolean().optional(),
|
|
212
|
-
preferredEmail: z7.email().optional(),
|
|
213
205
|
phoneNumber: z7.string().regex(/^\d{10}/, {
|
|
214
206
|
message: `Please enter a valid 10-digit US phone number with numbers only`
|
|
215
207
|
}).or(z7.literal("")).optional(),
|
|
216
208
|
birthDate: z7.string().regex(/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/, {
|
|
217
209
|
message: "Enter a valid date in yyyy-mm-dd format"
|
|
218
|
-
}).or(z7.literal("")).optional()
|
|
210
|
+
}).or(z7.literal("")).optional(),
|
|
211
|
+
/**
|
|
212
|
+
* For prompting the user to change their password on first login
|
|
213
|
+
*/
|
|
214
|
+
shouldChangePassword: z7.boolean().optional(),
|
|
215
|
+
/**
|
|
216
|
+
* UserProfile Object storing user preferences
|
|
217
|
+
*/
|
|
218
|
+
profiles: z7.array(zUserProfile).optional()
|
|
219
219
|
});
|
|
220
|
-
var
|
|
220
|
+
var zUser = addAutoProps(zBUser);
|
|
221
221
|
|
|
222
222
|
// src/interface/user/student.ts
|
|
223
223
|
import { z as z8 } from "zod";
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyig/models",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
7
7
|
"types": "index.d.ts",
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"zod": "
|
|
9
|
+
"zod": "^3.25.76"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@changesets/cli": "^2.29.8",
|