@timothyw/pat-common 1.0.63 → 1.0.65
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/dist/types/api/habits/update-habit-types.d.ts +4 -10
- package/dist/types/api/habits/update-habit-types.js +2 -1
- package/dist/types/api/people/create-person-types.d.ts +3 -13
- package/dist/types/api/people/create-person-types.js +2 -3
- package/dist/types/api/people/update-person-types.d.ts +2 -2
- package/dist/types/api/people/update-person-types.js +1 -1
- package/package.json +1 -1
- package/src/types/api/habits/update-habit-types.ts +2 -8
- package/src/types/api/people/create-person-types.ts +2 -3
- package/src/types/api/people/update-person-types.ts +2 -2
|
@@ -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.
|
|
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?:
|
|
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?:
|
|
19
|
+
frequency?: HabitFrequency | undefined;
|
|
20
20
|
rolloverTime?: string | undefined;
|
|
21
21
|
}>;
|
|
22
|
-
export
|
|
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.
|
|
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
|
});
|
|
@@ -11,27 +11,17 @@ export declare const createPersonRequestSchema: z.ZodObject<{
|
|
|
11
11
|
value: string;
|
|
12
12
|
key: string;
|
|
13
13
|
}>, "many">>;
|
|
14
|
-
notes: z.ZodOptional<z.ZodArray<z.
|
|
15
|
-
content: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
content: string;
|
|
18
|
-
}, {
|
|
19
|
-
content: string;
|
|
20
|
-
}>, "many">>;
|
|
14
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../../id-types").PersonNoteId, string>, "many">>;
|
|
21
15
|
}, "strip", z.ZodTypeAny, {
|
|
22
16
|
name: string;
|
|
23
|
-
notes?:
|
|
24
|
-
content: string;
|
|
25
|
-
}[] | undefined;
|
|
17
|
+
notes?: import("../../id-types").PersonNoteId[] | undefined;
|
|
26
18
|
properties?: {
|
|
27
19
|
value: string;
|
|
28
20
|
key: string;
|
|
29
21
|
}[] | undefined;
|
|
30
22
|
}, {
|
|
31
23
|
name: string;
|
|
32
|
-
notes?:
|
|
33
|
-
content: string;
|
|
34
|
-
}[] | undefined;
|
|
24
|
+
notes?: string[] | undefined;
|
|
35
25
|
properties?: {
|
|
36
26
|
value: string;
|
|
37
27
|
key: string;
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPersonRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../../id-types");
|
|
5
6
|
exports.createPersonRequestSchema = zod_1.z.object({
|
|
6
7
|
name: zod_1.z.string().min(1),
|
|
7
8
|
properties: zod_1.z.array(zod_1.z.object({
|
|
8
9
|
key: zod_1.z.string().min(1),
|
|
9
10
|
value: zod_1.z.string().min(1)
|
|
10
11
|
})).optional(),
|
|
11
|
-
notes: zod_1.z.array(
|
|
12
|
-
content: zod_1.z.string().min(1)
|
|
13
|
-
})).optional()
|
|
12
|
+
notes: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
|
|
14
13
|
});
|
|
@@ -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,
|
|
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?:
|
|
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.
|
|
12
|
+
notes: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -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.
|
|
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
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { personNoteIdSchema } from "../../id-types";
|
|
2
3
|
|
|
3
4
|
export const createPersonRequestSchema = z.object({
|
|
4
5
|
name: z.string().min(1),
|
|
@@ -6,9 +7,7 @@ export const createPersonRequestSchema = z.object({
|
|
|
6
7
|
key: z.string().min(1),
|
|
7
8
|
value: z.string().min(1)
|
|
8
9
|
})).optional(),
|
|
9
|
-
notes: z.array(
|
|
10
|
-
content: z.string().min(1)
|
|
11
|
-
})).optional()
|
|
10
|
+
notes: z.array(personNoteIdSchema).optional()
|
|
12
11
|
});
|
|
13
12
|
|
|
14
13
|
export type CreatePersonRequest = z.infer<typeof createPersonRequestSchema>;
|
|
@@ -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(
|
|
10
|
+
notes: z.array(personNoteIdSchema).optional()
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;
|