@samoa-house-lib/shl-types 1.10.4 → 1.11.0

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/package.json +1 -1
  2. package/src/types.ts +4 -5
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.10.4",
2
+ "version": "1.11.0",
3
3
  "name": "@samoa-house-lib/shl-types",
4
4
  "description": "Shared Types & Constants",
5
5
  "main": "src/index.ts",
package/src/types.ts CHANGED
@@ -43,6 +43,7 @@ export const shlIdSchema = z.string()
43
43
  .brand("SamoaHouseLibraryID")
44
44
 
45
45
  export const nameSchema = z.string()
46
+ .max(200)
46
47
  .transform((val) => {
47
48
  const initial = val.charAt(0).toUpperCase()
48
49
  return initial.concat(val.slice(1, val.length))
@@ -57,13 +58,11 @@ export const termsSchema = z.union([
57
58
  z.literal("D"),
58
59
  z.literal("R")
59
60
  ])
60
- .optional()
61
61
  .brand("SamoaHouseLibraryTerms")
62
+ .optional()
62
63
 
63
64
  export const infoSchema = z.string()
64
65
  .max(300)
65
- .optional()
66
- .nullable()
67
66
  .brand("SamoaHouseLibraryInfo")
68
67
 
69
68
  export const recipientSchema = z.string()
@@ -110,8 +109,8 @@ export const addBookRequest = z.object({
110
109
  book_type: textTypeSchema.optional(),
111
110
  publisher: nameSchema.optional().nullable(),
112
111
  date_published: dateSchema.optional().nullable(),
113
- notes: infoSchema,
114
- special_conditions: infoSchema,
112
+ notes: infoSchema.optional().nullable(),
113
+ special_conditions: infoSchema.optional().nullable(),
115
114
  condition: conditionSchema.optional(),
116
115
  deaccessioned: z.boolean().default(false)
117
116
  })