n_a_types 3.1.2 → 3.1.4

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.
Files changed (2) hide show
  1. package/index.ts +39 -3
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -306,8 +306,6 @@ export const guidebookSchema = z.object({
306
306
  })
307
307
  export type Guidebook = z.infer<typeof guidebookSchema>
308
308
 
309
-
310
-
311
309
  export const userProfileDataSchema = z.object({
312
310
  homeGym: z.string().nullable(),
313
311
  homeCrag: z.string().nullable(),
@@ -318,7 +316,6 @@ export const userProfileDataSchema = z.object({
318
316
 
319
317
  export type UserProfileData = z.infer<typeof userProfileDataSchema>;
320
318
 
321
-
322
319
  export const logInOrSignUpResultSchema = z.object({
323
320
  auth_token: z.string(),
324
321
  userId: z.string(),
@@ -326,3 +323,42 @@ export const logInOrSignUpResultSchema = z.object({
326
323
  });
327
324
 
328
325
  export type LogInOrSignUpResult = z.infer<typeof logInOrSignUpResultSchema>
326
+
327
+ export const commentSchema = z.object({
328
+ id: z.string(),
329
+ body: z.string(),
330
+ userId: z.string().nullable(),
331
+ createdAt: z.string(),
332
+ climbId: z.number(),
333
+ user: z.object({
334
+ id: z.string(),
335
+ publicDisplayName: z.string().nullable(),
336
+ profileImage: z.object({ s3URL: z.string() }).nullable()
337
+ }).nullable()
338
+ })
339
+ export type CommentType = z.infer<typeof commentSchema>
340
+
341
+
342
+ export const commentWithChildrenSchema = commentSchema.extend({ children: z.array(commentSchema) });
343
+ export type CommentWithChildren = z.infer<typeof commentWithChildrenSchema>
344
+
345
+
346
+ const commentCursorSchema = z.object({
347
+ id: z.string(),
348
+ createdAt: z.string(), // parse as string
349
+ })
350
+ export type CommentCursor = z.infer<typeof commentCursorSchema>
351
+
352
+
353
+ export const commentFetchSchema = z.object({
354
+ data: z.array(commentSchema),
355
+ nextCursor: commentCursorSchema.nullable()
356
+ });
357
+ export type CommentFetchResponse = z.infer<typeof commentFetchSchema>
358
+
359
+
360
+ export const commentWithChildrenFetchSchema = z.object({
361
+ data: z.array(commentWithChildrenSchema),
362
+ nextCursor: commentCursorSchema.nullable()
363
+ });
364
+ export type CommentWithChildrenFetchResponse = z.infer<typeof commentWithChildrenFetchSchema>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n_a_types",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "types",
5
5
  "main": "index.ts",
6
6
  "author": "",