@timothyw/pat-common 1.0.54 → 1.0.56

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.
@@ -9,15 +9,15 @@ export declare const createItemRequestSchema: z.ZodObject<{
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name: string;
11
11
  urgent: boolean;
12
+ notes?: string | undefined;
12
13
  type?: string | null | undefined;
13
14
  dueDate?: string | null | undefined;
14
- notes?: string | undefined;
15
15
  category?: string | null | undefined;
16
16
  }, {
17
17
  name: string;
18
+ notes?: string | undefined;
18
19
  type?: string | null | undefined;
19
20
  dueDate?: string | null | undefined;
20
- notes?: string | undefined;
21
21
  urgent?: boolean | undefined;
22
22
  category?: string | null | undefined;
23
23
  }>;
@@ -8,16 +8,16 @@ export declare const updateItemRequestSchema: z.ZodObject<{
8
8
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name?: string | undefined;
11
+ notes?: string | undefined;
11
12
  type?: string | null | undefined;
12
13
  dueDate?: string | null | undefined;
13
- notes?: string | undefined;
14
14
  urgent?: boolean | undefined;
15
15
  category?: string | null | undefined;
16
16
  }, {
17
17
  name?: string | undefined;
18
+ notes?: string | undefined;
18
19
  type?: string | null | undefined;
19
20
  dueDate?: string | null | undefined;
20
- notes?: string | undefined;
21
21
  urgent?: boolean | undefined;
22
22
  category?: string | null | undefined;
23
23
  }>;
@@ -1,5 +1,5 @@
1
- export interface VersionRequest {
2
- clientVersion: number;
1
+ export interface VersionQuery {
2
+ clientVersion?: number;
3
3
  }
4
4
  export interface VersionResponse {
5
5
  serverVersion: number;
@@ -1,4 +1,7 @@
1
1
  import { z } from "zod";
2
+ export type DateOnlyString = string & {
3
+ readonly __brand: "DateOnlyString";
4
+ };
2
5
  export type DateString = string & {
3
6
  readonly __brand: "DateString";
4
7
  };
@@ -1,4 +1,4 @@
1
- import { ToDateString } from "../misc-types";
1
+ import { DateOnlyString, ToDateString } from "../misc-types";
2
2
  export declare enum HabitFrequency {
3
3
  DAILY = "daily",
4
4
  WEEKLY = "weekly",
@@ -13,7 +13,7 @@ export declare enum HabitEntryStatus {
13
13
  export interface HabitEntryData {
14
14
  _id: string;
15
15
  habitId: string;
16
- date: Date;
16
+ date: DateOnlyString;
17
17
  status: HabitEntryStatus;
18
18
  createdAt: Date;
19
19
  updatedAt: Date;
@@ -23,8 +23,10 @@ export interface HabitData {
23
23
  userId: string;
24
24
  name: string;
25
25
  description?: string;
26
+ notes?: string;
26
27
  frequency: HabitFrequency;
27
28
  rolloverTime: string;
29
+ firstDay: DateOnlyString;
28
30
  createdAt: Date;
29
31
  updatedAt: Date;
30
32
  }
@@ -22,7 +22,6 @@ const toHabit = (data, entries, stats) => {
22
22
  updatedAt: (0, utils_1.toDateString)(data.updatedAt),
23
23
  entries: entries.map(entry => ({
24
24
  ...entry,
25
- date: (0, utils_1.toDateString)(entry.date),
26
25
  createdAt: (0, utils_1.toDateString)(entry.createdAt),
27
26
  updatedAt: (0, utils_1.toDateString)(entry.updatedAt)
28
27
  })),
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.54",
5
+ "version": "1.0.56",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -1,5 +1,5 @@
1
- export interface VersionRequest {
2
- clientVersion: number;
1
+ export interface VersionQuery {
2
+ clientVersion?: number;
3
3
  }
4
4
 
5
5
  export interface VersionResponse {
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
2
 
3
+ export type DateOnlyString = string & { readonly __brand: "DateOnlyString" };
4
+
3
5
  export type DateString = string & { readonly __brand: "DateString" };
4
6
 
5
7
  export const dateStringSchema = z.string()
@@ -1,4 +1,4 @@
1
- import { ToDateString } from "../misc-types";
1
+ import { DateOnlyString, ToDateString } from "../misc-types";
2
2
  import { toDateString } from "../../utils";
3
3
 
4
4
  export enum HabitFrequency {
@@ -17,7 +17,7 @@ export enum HabitEntryStatus {
17
17
  export interface HabitEntryData {
18
18
  _id: string;
19
19
  habitId: string;
20
- date: Date;
20
+ date: DateOnlyString;
21
21
  status: HabitEntryStatus;
22
22
  createdAt: Date;
23
23
  updatedAt: Date;
@@ -28,8 +28,10 @@ export interface HabitData {
28
28
  userId: string;
29
29
  name: string;
30
30
  description?: string;
31
+ notes?: string;
31
32
  frequency: HabitFrequency;
32
33
  rolloverTime: string;
34
+ firstDay: DateOnlyString;
33
35
  createdAt: Date;
34
36
  updatedAt: Date;
35
37
  }
@@ -56,7 +58,6 @@ export const toHabit = (data: HabitData, entries: HabitEntryData[], stats: Habit
56
58
  updatedAt: toDateString(data.updatedAt),
57
59
  entries: entries.map(entry => ({
58
60
  ...entry,
59
- date: toDateString(entry.date),
60
61
  createdAt: toDateString(entry.createdAt),
61
62
  updatedAt: toDateString(entry.updatedAt)
62
63
  })),