@timothyw/pat-common 1.0.58 → 1.0.59

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.
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { UserData } from "../../models";
3
3
  export declare const updateUserRequestSchema: z.ZodObject<{
4
- name: z.ZodOptional<z.ZodString>;
5
4
  sandbox: z.ZodOptional<z.ZodObject<{
6
5
  discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7
6
  devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -22,6 +21,7 @@ export declare const updateUserRequestSchema: z.ZodObject<{
22
21
  pushToken?: string | undefined;
23
22
  }[] | undefined;
24
23
  }>>;
24
+ name: z.ZodOptional<z.ZodString>;
25
25
  timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
26
26
  config: z.ZodOptional<z.ZodObject<{
27
27
  modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -77,13 +77,13 @@ export declare const updateUserRequestSchema: z.ZodObject<{
77
77
  }[] | undefined;
78
78
  }>>;
79
79
  }, "strict", z.ZodTypeAny, {
80
- name?: string | undefined;
81
80
  sandbox?: {
82
81
  discordId?: string | undefined;
83
82
  devices?: {
84
83
  pushToken?: string | undefined;
85
84
  }[] | undefined;
86
85
  } | undefined;
86
+ name?: string | undefined;
87
87
  timezone?: string | undefined;
88
88
  config?: {
89
89
  agenda?: {
@@ -99,13 +99,13 @@ export declare const updateUserRequestSchema: z.ZodObject<{
99
99
  }[] | undefined;
100
100
  } | undefined;
101
101
  }, {
102
- name?: string | undefined;
103
102
  sandbox?: {
104
103
  discordId?: string | undefined;
105
104
  devices?: {
106
105
  pushToken?: string | undefined;
107
106
  }[] | undefined;
108
107
  } | undefined;
108
+ name?: string | undefined;
109
109
  timezone?: string | undefined;
110
110
  config?: {
111
111
  agenda?: {
@@ -5,13 +5,13 @@ export declare const createHabitEntryRequestSchema: z.ZodObject<{
5
5
  date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, DateOnlyString, string>;
6
6
  status: z.ZodNativeEnum<typeof HabitEntryStatus>;
7
7
  }, "strip", z.ZodTypeAny, {
8
+ status: HabitEntryStatus;
8
9
  date: string & {
9
10
  readonly __brand: "DateOnlyString";
10
11
  };
11
- status: HabitEntryStatus;
12
12
  }, {
13
- date: string;
14
13
  status: HabitEntryStatus;
14
+ date: string;
15
15
  }>;
16
16
  export interface CreateHabitEntryRequest {
17
17
  date: DateOnlyString;
@@ -9,14 +9,14 @@ export declare const createItemRequestSchema: z.ZodObject<{
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name: string;
11
11
  urgent: boolean;
12
- notes?: string | undefined;
13
12
  type?: string | null | undefined;
13
+ notes?: string | undefined;
14
14
  dueDate?: string | null | undefined;
15
15
  category?: string | null | undefined;
16
16
  }, {
17
17
  name: string;
18
- notes?: string | undefined;
19
18
  type?: string | null | undefined;
19
+ notes?: string | undefined;
20
20
  dueDate?: string | null | undefined;
21
21
  urgent?: boolean | undefined;
22
22
  category?: string | null | undefined;
@@ -7,16 +7,16 @@ export declare const updateItemRequestSchema: z.ZodObject<{
7
7
  category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
8
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
9
  }, "strip", z.ZodTypeAny, {
10
+ type?: string | null | undefined;
10
11
  name?: string | undefined;
11
12
  notes?: string | undefined;
12
- type?: string | null | undefined;
13
13
  dueDate?: string | null | undefined;
14
14
  urgent?: boolean | undefined;
15
15
  category?: string | null | undefined;
16
16
  }, {
17
+ type?: string | null | undefined;
17
18
  name?: string | undefined;
18
19
  notes?: string | undefined;
19
- type?: string | null | undefined;
20
20
  dueDate?: string | null | undefined;
21
21
  urgent?: boolean | undefined;
22
22
  category?: string | null | undefined;
@@ -1,4 +1,4 @@
1
- import { DateOnlyString, ToDateString } from "../misc-types";
1
+ import { DateOnlyString } from "../misc-types";
2
2
  export declare enum HabitFrequency {
3
3
  DAILY = "daily",
4
4
  WEEKLY = "weekly",
@@ -37,8 +37,8 @@ export interface HabitStats {
37
37
  missedDays: number;
38
38
  completionRate: number;
39
39
  }
40
- export type HabitEntry = ToDateString<HabitEntryData>;
41
- export type Habit = ToDateString<HabitData> & {
40
+ export type HabitEntry = HabitEntryData;
41
+ export type Habit = HabitData & {
42
42
  entries: HabitEntry[];
43
43
  stats: HabitStats;
44
44
  };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toHabit = exports.HabitEntryStatus = exports.HabitFrequency = void 0;
4
- const utils_1 = require("../../utils");
5
4
  var HabitFrequency;
6
5
  (function (HabitFrequency) {
7
6
  HabitFrequency["DAILY"] = "daily";
@@ -18,13 +17,7 @@ var HabitEntryStatus;
18
17
  const toHabit = (data, entries, stats) => {
19
18
  return {
20
19
  ...data,
21
- createdAt: (0, utils_1.toDateString)(data.createdAt),
22
- updatedAt: (0, utils_1.toDateString)(data.updatedAt),
23
- entries: entries.map(entry => ({
24
- ...entry,
25
- createdAt: (0, utils_1.toDateString)(entry.createdAt),
26
- updatedAt: (0, utils_1.toDateString)(entry.updatedAt)
27
- })),
20
+ entries,
28
21
  stats
29
22
  };
30
23
  };
@@ -95,13 +95,13 @@ export declare const userDataSchema: z.ZodObject<{
95
95
  };
96
96
  createdAt: Date;
97
97
  updatedAt: Date;
98
- name: string;
99
98
  sandbox: {
100
99
  devices: {
101
100
  pushToken: string;
102
101
  }[];
103
102
  discordId?: string | undefined;
104
103
  };
104
+ name: string;
105
105
  timezone: string;
106
106
  config: {
107
107
  agenda: {
@@ -120,13 +120,13 @@ export declare const userDataSchema: z.ZodObject<{
120
120
  _id: string;
121
121
  createdAt: Date;
122
122
  updatedAt: Date;
123
- name: string;
124
123
  sandbox: {
125
124
  devices: {
126
125
  pushToken: string;
127
126
  }[];
128
127
  discordId?: string | undefined;
129
128
  };
129
+ name: string;
130
130
  timezone: string;
131
131
  config: {
132
132
  agenda: {
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.58",
5
+ "version": "1.0.59",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -44,9 +44,9 @@ export interface HabitStats {
44
44
  completionRate: number;
45
45
  }
46
46
 
47
- export type HabitEntry = ToDateString<HabitEntryData>;
47
+ export type HabitEntry = HabitEntryData;
48
48
 
49
- export type Habit = ToDateString<HabitData> & {
49
+ export type Habit = HabitData & {
50
50
  entries: HabitEntry[];
51
51
  stats: HabitStats;
52
52
  }
@@ -54,13 +54,7 @@ export type Habit = ToDateString<HabitData> & {
54
54
  export const toHabit = (data: HabitData, entries: HabitEntryData[], stats: HabitStats): Habit => {
55
55
  return {
56
56
  ...data,
57
- createdAt: toDateString(data.createdAt),
58
- updatedAt: toDateString(data.updatedAt),
59
- entries: entries.map(entry => ({
60
- ...entry,
61
- createdAt: toDateString(entry.createdAt),
62
- updatedAt: toDateString(entry.updatedAt)
63
- })),
57
+ entries,
64
58
  stats
65
59
  };
66
60
  }