@timothyw/pat-common 1.0.66 → 1.0.68
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/create-habit-entry-types.d.ts +1 -4
- package/dist/types/api/habits/create-habit-types.d.ts +5 -11
- package/dist/types/api/habits/create-habit-types.js +2 -1
- package/dist/types/api/people/get-people-types.d.ts +2 -5
- package/package.json +1 -1
- package/src/types/api/habits/create-habit-entry-types.ts +2 -4
- package/src/types/api/habits/create-habit-types.ts +4 -9
- package/src/types/api/people/get-people-types.ts +3 -5
|
@@ -13,10 +13,7 @@ export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
|
13
13
|
status: HabitEntryStatus;
|
|
14
14
|
date: string;
|
|
15
15
|
}>;
|
|
16
|
-
export
|
|
17
|
-
date: DateOnlyString;
|
|
18
|
-
status: HabitEntryStatus;
|
|
19
|
-
}
|
|
16
|
+
export type CreateHabitEntryRequest = z.infer<typeof createHabitEntryRequestSchema>;
|
|
20
17
|
export interface CreateHabitEntryResponse {
|
|
21
18
|
habit: Habit;
|
|
22
19
|
}
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Habit } from "../../models/habit-data";
|
|
2
|
+
import { Habit, HabitFrequency } from "../../models/habit-data";
|
|
3
3
|
export declare const createHabitRequestSchema: z.ZodObject<{
|
|
4
4
|
name: z.ZodString;
|
|
5
5
|
description: z.ZodOptional<z.ZodString>;
|
|
6
6
|
notes: z.ZodOptional<z.ZodString>;
|
|
7
|
-
frequency: z.
|
|
7
|
+
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
8
8
|
rolloverTime: z.ZodString;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
name: string;
|
|
11
|
-
frequency:
|
|
11
|
+
frequency: HabitFrequency;
|
|
12
12
|
rolloverTime: string;
|
|
13
13
|
description?: string | undefined;
|
|
14
14
|
notes?: string | undefined;
|
|
15
15
|
}, {
|
|
16
16
|
name: string;
|
|
17
|
-
frequency:
|
|
17
|
+
frequency: HabitFrequency;
|
|
18
18
|
rolloverTime: string;
|
|
19
19
|
description?: string | undefined;
|
|
20
20
|
notes?: string | undefined;
|
|
21
21
|
}>;
|
|
22
|
-
export
|
|
23
|
-
name: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
notes?: string;
|
|
26
|
-
frequency: 'daily';
|
|
27
|
-
rolloverTime: string;
|
|
28
|
-
}
|
|
22
|
+
export type CreateHabitRequest = z.infer<typeof createHabitRequestSchema>;
|
|
29
23
|
export interface CreateHabitResponse {
|
|
30
24
|
habit: Habit;
|
|
31
25
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createHabitRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const habit_data_1 = require("../../models/habit-data");
|
|
5
6
|
exports.createHabitRequestSchema = zod_1.z.object({
|
|
6
7
|
name: zod_1.z.string().min(1, 'Name is required').trim(),
|
|
7
8
|
description: zod_1.z.string().trim().optional(),
|
|
8
9
|
notes: zod_1.z.string().trim().optional(),
|
|
9
|
-
frequency: zod_1.z.
|
|
10
|
+
frequency: zod_1.z.nativeEnum(habit_data_1.HabitFrequency),
|
|
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')
|
|
11
12
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PersonNoteId } from "../../id-types";
|
|
1
2
|
export interface GetPeopleResponse {
|
|
2
3
|
people: Array<{
|
|
3
4
|
id: string;
|
|
@@ -6,10 +7,6 @@ export interface GetPeopleResponse {
|
|
|
6
7
|
key: string;
|
|
7
8
|
value: string;
|
|
8
9
|
}>;
|
|
9
|
-
notes: Array<
|
|
10
|
-
content: string;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
}>;
|
|
10
|
+
notes: Array<PersonNoteId>;
|
|
14
11
|
}>;
|
|
15
12
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Habit, HabitEntryStatus } from "../../models";
|
|
3
3
|
import { DateOnlyString, dateOnlyStringSchema } from "../../misc-types";
|
|
4
|
+
import { createHabitRequestSchema } from "./create-habit-types";
|
|
4
5
|
|
|
5
6
|
export const createHabitEntryRequestSchema = z.object({
|
|
6
7
|
date: dateOnlyStringSchema,
|
|
7
8
|
status: z.nativeEnum(HabitEntryStatus)
|
|
8
9
|
});
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
-
date: DateOnlyString;
|
|
12
|
-
status: HabitEntryStatus;
|
|
13
|
-
}
|
|
11
|
+
export type CreateHabitEntryRequest = z.infer<typeof createHabitEntryRequestSchema>;
|
|
14
12
|
|
|
15
13
|
export interface CreateHabitEntryResponse {
|
|
16
14
|
habit: Habit;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Habit } from "../../models/habit-data";
|
|
2
|
+
import { Habit, HabitFrequency } from "../../models/habit-data";
|
|
3
|
+
import { createAccountRequestSchema } from "../auth";
|
|
3
4
|
|
|
4
5
|
export const createHabitRequestSchema = z.object({
|
|
5
6
|
name: z.string().min(1, 'Name is required').trim(),
|
|
6
7
|
description: z.string().trim().optional(),
|
|
7
8
|
notes: z.string().trim().optional(),
|
|
8
|
-
frequency: z.
|
|
9
|
+
frequency: z.nativeEnum(HabitFrequency),
|
|
9
10
|
rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, 'rolloverTime must be in HH:MM format')
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
-
name: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
notes?: string;
|
|
16
|
-
frequency: 'daily';
|
|
17
|
-
rolloverTime: string;
|
|
18
|
-
}
|
|
13
|
+
export type CreateHabitRequest = z.infer<typeof createHabitRequestSchema>;
|
|
19
14
|
|
|
20
15
|
export interface CreateHabitResponse {
|
|
21
16
|
habit: Habit;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PersonNoteId } from "../../id-types";
|
|
2
|
+
|
|
1
3
|
export interface GetPeopleResponse {
|
|
2
4
|
people: Array<{
|
|
3
5
|
id: string;
|
|
@@ -6,10 +8,6 @@ export interface GetPeopleResponse {
|
|
|
6
8
|
key: string;
|
|
7
9
|
value: string;
|
|
8
10
|
}>;
|
|
9
|
-
notes: Array<
|
|
10
|
-
content: string;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
}>;
|
|
11
|
+
notes: Array<PersonNoteId>;
|
|
14
12
|
}>;
|
|
15
13
|
}
|