@timothyw/pat-common 1.0.37 → 1.0.39
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 +12 -1
- package/dist/types/api/habits/create-habit-entry-types.js +3 -2
- package/dist/types/api/habits/create-habit-types.d.ts +17 -0
- package/dist/types/api/habits/create-habit-types.js +2 -1
- package/dist/types/api/habits/update-habit-types.d.ts +17 -0
- package/dist/types/api/habits/update-habit-types.js +2 -1
- package/dist/types/models/habit-data.d.ts +2 -2
- package/package.json +1 -1
- package/src/types/api/habits/create-habit-entry-types.ts +3 -3
- package/src/types/api/habits/create-habit-types.ts +1 -1
- package/src/types/api/habits/update-habit-types.ts +1 -1
- package/src/types/models/habit-data.ts +2 -4
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
|
+
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
4
|
+
date: z.ZodDate;
|
|
5
|
+
status: z.ZodEnum<["completed", "excused", "missed"]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
status: "completed" | "excused" | "missed";
|
|
8
|
+
date: Date;
|
|
9
|
+
}, {
|
|
10
|
+
status: "completed" | "excused" | "missed";
|
|
11
|
+
date: Date;
|
|
12
|
+
}>;
|
|
2
13
|
export interface CreateHabitEntryRequest {
|
|
3
|
-
date:
|
|
14
|
+
date: Date;
|
|
4
15
|
status: 'completed' | 'excused' | 'missed';
|
|
5
16
|
}
|
|
6
17
|
export interface CreateHabitEntryResponse {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHabitEntryRequestSchema = void 0;
|
|
3
4
|
const zod_1 = require("zod");
|
|
4
|
-
|
|
5
|
-
date: zod_1.z.
|
|
5
|
+
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
6
|
+
date: zod_1.z.date(),
|
|
6
7
|
status: zod_1.z.enum(['completed', 'excused', 'missed'])
|
|
7
8
|
});
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
|
+
export declare const createHabitRequestSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
frequency: z.ZodLiteral<"daily">;
|
|
7
|
+
rolloverTime: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
frequency: "daily";
|
|
11
|
+
rolloverTime: string;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
frequency: "daily";
|
|
16
|
+
rolloverTime: string;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
}>;
|
|
2
19
|
export interface CreateHabitRequest {
|
|
3
20
|
name: string;
|
|
4
21
|
description?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHabitRequestSchema = void 0;
|
|
3
4
|
const zod_1 = require("zod");
|
|
4
|
-
|
|
5
|
+
exports.createHabitRequestSchema = zod_1.z.object({
|
|
5
6
|
name: zod_1.z.string().min(1, 'Name is required').trim(),
|
|
6
7
|
description: zod_1.z.string().trim().optional(),
|
|
7
8
|
frequency: zod_1.z.literal('daily'),
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
|
+
export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
frequency: z.ZodOptional<z.ZodLiteral<"daily">>;
|
|
7
|
+
rolloverTime: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name?: string | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
frequency?: "daily" | undefined;
|
|
12
|
+
rolloverTime?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
frequency?: "daily" | undefined;
|
|
17
|
+
rolloverTime?: string | undefined;
|
|
18
|
+
}>;
|
|
2
19
|
export interface UpdateHabitRequest {
|
|
3
20
|
name?: string;
|
|
4
21
|
description?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateHabitRequestSchema = void 0;
|
|
3
4
|
const zod_1 = require("zod");
|
|
4
|
-
|
|
5
|
+
exports.updateHabitRequestSchema = zod_1.z.object({
|
|
5
6
|
name: zod_1.z.string().min(1, 'Name is required').trim().optional(),
|
|
6
7
|
description: zod_1.z.string().trim().optional(),
|
|
7
8
|
frequency: zod_1.z.literal('daily').optional(),
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
3
|
|
|
4
|
-
const createHabitEntryRequestSchema = z.object({
|
|
5
|
-
date: z.
|
|
4
|
+
export const createHabitEntryRequestSchema = z.object({
|
|
5
|
+
date: z.date(),
|
|
6
6
|
status: z.enum(['completed', 'excused', 'missed'])
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export interface CreateHabitEntryRequest {
|
|
10
|
-
date:
|
|
10
|
+
date: Date;
|
|
11
11
|
status: 'completed' | 'excused' | 'missed';
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
3
|
|
|
4
|
-
const createHabitRequestSchema = z.object({
|
|
4
|
+
export const createHabitRequestSchema = z.object({
|
|
5
5
|
name: z.string().min(1, 'Name is required').trim(),
|
|
6
6
|
description: z.string().trim().optional(),
|
|
7
7
|
frequency: z.literal('daily'),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { HabitWithEntries } from "../../models/habit-data";
|
|
3
3
|
|
|
4
|
-
const updateHabitRequestSchema = z.object({
|
|
4
|
+
export const updateHabitRequestSchema = z.object({
|
|
5
5
|
name: z.string().min(1, 'Name is required').trim().optional(),
|
|
6
6
|
description: z.string().trim().optional(),
|
|
7
7
|
frequency: z.literal('daily').optional(),
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { TaskId, TaskListId, UserId } from "../id-types";
|
|
2
|
-
|
|
3
1
|
export interface HabitEntryData {
|
|
4
2
|
_id: string;
|
|
5
3
|
habitId: string;
|
|
6
|
-
date:
|
|
7
|
-
status: 'completed' | 'excused'
|
|
4
|
+
date: Date;
|
|
5
|
+
status: 'completed' | 'excused';
|
|
8
6
|
createdAt: Date;
|
|
9
7
|
updatedAt: Date;
|
|
10
8
|
}
|