@timothyw/pat-common 1.0.63 → 1.0.64

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.
@@ -4,28 +4,22 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
4
4
  name: z.ZodOptional<z.ZodString>;
5
5
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
6
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
- frequency: z.ZodOptional<z.ZodLiteral<"daily">>;
7
+ frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
8
8
  rolloverTime: z.ZodOptional<z.ZodString>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name?: string | undefined;
11
11
  description?: string | null | undefined;
12
12
  notes?: string | null | undefined;
13
- frequency?: "daily" | undefined;
13
+ frequency?: HabitFrequency | undefined;
14
14
  rolloverTime?: string | undefined;
15
15
  }, {
16
16
  name?: string | undefined;
17
17
  description?: string | null | undefined;
18
18
  notes?: string | null | undefined;
19
- frequency?: "daily" | undefined;
19
+ frequency?: HabitFrequency | undefined;
20
20
  rolloverTime?: string | undefined;
21
21
  }>;
22
- export interface UpdateHabitRequest {
23
- name?: string;
24
- description?: string;
25
- notes?: string;
26
- frequency?: HabitFrequency;
27
- rolloverTime?: string;
28
- }
22
+ export type UpdateHabitRequest = z.infer<typeof updateHabitRequestSchema>;
29
23
  export interface UpdateHabitResponse {
30
24
  habit: Habit;
31
25
  }
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateHabitRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
5
6
  exports.updateHabitRequestSchema = zod_1.z.object({
6
7
  name: zod_1.z.string().min(1, 'Name is required').trim().optional(),
7
8
  description: zod_1.z.string().trim().nullish(),
8
9
  notes: zod_1.z.string().trim().nullish(),
9
- frequency: zod_1.z.literal('daily').optional(),
10
+ frequency: zod_1.z.nativeEnum(models_1.HabitFrequency).optional(),
10
11
  rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, 'rolloverTime must be in HH:MM format').optional()
11
12
  });
@@ -12,10 +12,10 @@ export declare const updatePersonRequestSchema: z.ZodObject<{
12
12
  value: string;
13
13
  key: string;
14
14
  }>, "many">>;
15
- notes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../../id-types").PersonId, string>, "many">>;
15
+ notes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, PersonNoteId, string>, "many">>;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  name?: string | undefined;
18
- notes?: import("../../id-types").PersonId[] | undefined;
18
+ notes?: PersonNoteId[] | undefined;
19
19
  properties?: {
20
20
  value: string;
21
21
  key: string;
@@ -9,5 +9,5 @@ exports.updatePersonRequestSchema = zod_1.z.object({
9
9
  key: zod_1.z.string().min(1),
10
10
  value: zod_1.z.string().min(1)
11
11
  })).optional(),
12
- notes: zod_1.z.array(id_types_1.personIdSchema).optional()
12
+ notes: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
13
13
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.63",
5
+ "version": "1.0.64",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -5,17 +5,11 @@ export const updateHabitRequestSchema = z.object({
5
5
  name: z.string().min(1, 'Name is required').trim().optional(),
6
6
  description: z.string().trim().nullish(),
7
7
  notes: z.string().trim().nullish(),
8
- frequency: z.literal('daily').optional(),
8
+ frequency: z.nativeEnum(HabitFrequency).optional(),
9
9
  rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, 'rolloverTime must be in HH:MM format').optional()
10
10
  });
11
11
 
12
- export interface UpdateHabitRequest {
13
- name?: string;
14
- description?: string;
15
- notes?: string;
16
- frequency?: HabitFrequency;
17
- rolloverTime?: string;
18
- }
12
+ export type UpdateHabitRequest = z.infer<typeof updateHabitRequestSchema>;
19
13
 
20
14
  export interface UpdateHabitResponse {
21
15
  habit: Habit;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { personIdSchema, PersonNoteId } from "../../id-types";
2
+ import { personIdSchema, PersonNoteId, personNoteIdSchema } from "../../id-types";
3
3
 
4
4
  export const updatePersonRequestSchema = z.object({
5
5
  name: z.string().min(1).optional(),
@@ -7,7 +7,7 @@ export const updatePersonRequestSchema = z.object({
7
7
  key: z.string().min(1),
8
8
  value: z.string().min(1)
9
9
  })).optional(),
10
- notes: z.array(personIdSchema).optional()
10
+ notes: z.array(personNoteIdSchema).optional()
11
11
  });
12
12
 
13
13
  export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;