@timothyw/pat-common 1.0.82 → 1.0.85

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,9 @@
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>;
4
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, import("../..").UserId, string>>;
5
+ createdAt: z.ZodOptional<z.ZodDate>;
6
+ updatedAt: z.ZodOptional<z.ZodDate>;
5
7
  sandbox: z.ZodOptional<z.ZodObject<{
6
8
  discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7
9
  devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -22,6 +24,7 @@ export declare const updateUserRequestSchema: z.ZodObject<{
22
24
  pushToken?: string | undefined;
23
25
  }[] | undefined;
24
26
  }>>;
27
+ name: z.ZodOptional<z.ZodString>;
25
28
  timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
26
29
  config: z.ZodOptional<z.ZodObject<{
27
30
  modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -77,6 +80,9 @@ export declare const updateUserRequestSchema: z.ZodObject<{
77
80
  }[] | undefined;
78
81
  }>>;
79
82
  }, "strict", z.ZodTypeAny, {
83
+ id?: import("../..").UserId | undefined;
84
+ createdAt?: Date | undefined;
85
+ updatedAt?: Date | undefined;
80
86
  name?: string | undefined;
81
87
  sandbox?: {
82
88
  discordId?: string | undefined;
@@ -99,6 +105,9 @@ export declare const updateUserRequestSchema: z.ZodObject<{
99
105
  }[] | undefined;
100
106
  } | undefined;
101
107
  }, {
108
+ id?: string | undefined;
109
+ createdAt?: Date | undefined;
110
+ updatedAt?: Date | undefined;
102
111
  name?: string | undefined;
103
112
  sandbox?: {
104
113
  discordId?: string | undefined;
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateUserRequestSchema = void 0;
4
4
  const models_1 = require("../../models");
5
5
  exports.updateUserRequestSchema = models_1.userDataSchema
6
- .omit({ _id: true, createdAt: true, updatedAt: true })
6
+ // .omit({ _id: true, createdAt: true, updatedAt: true })
7
7
  .deepPartial()
8
8
  .strict();
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
  export declare const completeItemRequestSchema: z.ZodObject<{
4
4
  completed: z.ZodBoolean;
5
5
  }, "strip", z.ZodTypeAny, {
@@ -9,5 +9,5 @@ export declare const completeItemRequestSchema: z.ZodObject<{
9
9
  }>;
10
10
  export type CompleteItemRequest = z.infer<typeof completeItemRequestSchema>;
11
11
  export interface CompleteItemResponse {
12
- item: ItemData;
12
+ item: Serialized<ItemData>;
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
  export declare const createItemRequestSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -24,5 +24,5 @@ export declare const createItemRequestSchema: z.ZodObject<{
24
24
  }>;
25
25
  export type CreateItemRequest = z.infer<typeof createItemRequestSchema>;
26
26
  export interface CreateItemResponse {
27
- item: ItemData;
27
+ item: Serialized<ItemData>;
28
28
  }
@@ -1,4 +1,4 @@
1
- import { ItemData } from "../../models";
1
+ import { ItemData, Serialized } from "../../models";
2
2
  export interface GetItemsResponse {
3
- items: ItemData[];
3
+ items: Serialized<ItemData>[];
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
  export declare const updateItemRequestSchema: z.ZodObject<{
4
4
  name: z.ZodOptional<z.ZodString>;
5
5
  dueDate: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>>;
@@ -24,5 +24,5 @@ export declare const updateItemRequestSchema: z.ZodObject<{
24
24
  }>;
25
25
  export type UpdateItemRequest = z.infer<typeof updateItemRequestSchema>;
26
26
  export interface UpdateItemResponse {
27
- item: ItemData;
27
+ item: Serialized<ItemData>;
28
28
  }
@@ -1,6 +1,6 @@
1
1
  import { AuthId, UserId } from "../id-types";
2
2
  export interface AuthData {
3
- _id: AuthId;
3
+ id: AuthId;
4
4
  createdAt: Date;
5
5
  updatedAt: Date;
6
6
  userId: UserId;
@@ -12,7 +12,7 @@ export declare enum HabitEntryStatus {
12
12
  EXCUSED = "excused"
13
13
  }
14
14
  export interface HabitEntryData {
15
- _id: HabitEntryId;
15
+ id: HabitEntryId;
16
16
  habitId: HabitId;
17
17
  userId: UserId;
18
18
  date: DateOnlyString;
@@ -21,7 +21,7 @@ export interface HabitEntryData {
21
21
  updatedAt: Date;
22
22
  }
23
23
  export interface HabitData {
24
- _id: HabitId;
24
+ id: HabitId;
25
25
  userId: UserId;
26
26
  name: string;
27
27
  description?: string | null;
@@ -1,6 +1,6 @@
1
1
  import { ItemId, UserId } from "../id-types";
2
2
  export interface ItemData {
3
- _id: ItemId;
3
+ id: ItemId;
4
4
  userId: UserId;
5
5
  createdAt: Date;
6
6
  updatedAt: Date;
@@ -4,7 +4,7 @@ export interface PersonProperty {
4
4
  value: string;
5
5
  }
6
6
  export interface PersonNoteData {
7
- _id: PersonNoteId;
7
+ id: PersonNoteId;
8
8
  personId: PersonId;
9
9
  userId: UserId;
10
10
  content: string;
@@ -12,7 +12,7 @@ export interface PersonNoteData {
12
12
  updatedAt: Date;
13
13
  }
14
14
  export interface PersonData {
15
- _id: PersonId;
15
+ id: PersonId;
16
16
  userId: UserId;
17
17
  createdAt: Date;
18
18
  updatedAt: Date;
@@ -21,7 +21,7 @@ export interface PersonData {
21
21
  noteIds: PersonNoteId[];
22
22
  }
23
23
  export interface Person {
24
- _id: PersonId;
24
+ id: PersonId;
25
25
  userId: UserId;
26
26
  createdAt: Date;
27
27
  updatedAt: Date;
@@ -1,6 +1,6 @@
1
1
  import { TaskId, TaskListId, UserId } from "../id-types";
2
2
  export interface TaskData {
3
- _id: TaskId;
3
+ id: TaskId;
4
4
  userId: UserId;
5
5
  createdAt: Date;
6
6
  updatedAt: Date;
@@ -10,7 +10,7 @@ export interface TaskData {
10
10
  taskListId: TaskListId;
11
11
  }
12
12
  export interface TaskListData {
13
- _id: TaskListId;
13
+ id: TaskListId;
14
14
  userId: UserId;
15
15
  createdAt: Date;
16
16
  updatedAt: Date;
@@ -1,6 +1,6 @@
1
1
  import { ThoughtId, UserId } from "../id-types";
2
2
  export interface ThoughtData {
3
- _id: ThoughtId;
3
+ id: ThoughtId;
4
4
  userId: UserId;
5
5
  createdAt: Date;
6
6
  updatedAt: Date;
@@ -11,7 +11,7 @@ declare const moduleSchema: z.ZodObject<{
11
11
  visible: boolean;
12
12
  }>;
13
13
  export declare const userDataSchema: z.ZodObject<{
14
- _id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
14
+ id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
15
15
  createdAt: z.ZodDate;
16
16
  updatedAt: z.ZodDate;
17
17
  sandbox: z.ZodObject<{
@@ -90,7 +90,7 @@ export declare const userDataSchema: z.ZodObject<{
90
90
  }[];
91
91
  }>;
92
92
  }, "strip", z.ZodTypeAny, {
93
- _id: string & {
93
+ id: string & {
94
94
  readonly __brand: "UserId";
95
95
  };
96
96
  createdAt: Date;
@@ -117,7 +117,7 @@ export declare const userDataSchema: z.ZodObject<{
117
117
  }[];
118
118
  };
119
119
  }, {
120
- _id: string;
120
+ id: string;
121
121
  createdAt: Date;
122
122
  updatedAt: Date;
123
123
  name: string;
@@ -12,7 +12,7 @@ const deviceSchema = zod_1.z.object({
12
12
  pushToken: zod_1.z.string()
13
13
  });
14
14
  exports.userDataSchema = zod_1.z.object({
15
- _id: id_types_1.userIdSchema,
15
+ id: id_types_1.userIdSchema,
16
16
  createdAt: zod_1.z.date(),
17
17
  updatedAt: zod_1.z.date(),
18
18
  sandbox: zod_1.z.object({
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.82",
5
+ "version": "1.0.85",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { UserData, userDataSchema } from "../../models";
3
3
 
4
4
  export const updateUserRequestSchema = userDataSchema
5
- .omit({ _id: true, createdAt: true, updatedAt: true })
5
+ // .omit({ _id: true, createdAt: true, updatedAt: true })
6
6
  .deepPartial()
7
7
  .strict();
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
 
4
4
  export const completeItemRequestSchema = z.object({
5
5
  completed: z.boolean()
@@ -8,5 +8,5 @@ export const completeItemRequestSchema = z.object({
8
8
  export type CompleteItemRequest = z.infer<typeof completeItemRequestSchema>;
9
9
 
10
10
  export interface CompleteItemResponse {
11
- item: ItemData;
11
+ item: Serialized<ItemData>;
12
12
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
 
4
4
  export const createItemRequestSchema = z.object({
5
5
  name: z.string().min(1),
@@ -13,5 +13,5 @@ export const createItemRequestSchema = z.object({
13
13
  export type CreateItemRequest = z.infer<typeof createItemRequestSchema>;
14
14
 
15
15
  export interface CreateItemResponse {
16
- item: ItemData;
16
+ item: Serialized<ItemData>;
17
17
  }
@@ -1,5 +1,5 @@
1
- import { ItemData } from "../../models";
1
+ import { ItemData, Serialized } from "../../models";
2
2
 
3
3
  export interface GetItemsResponse {
4
- items: ItemData[];
4
+ items: Serialized<ItemData>[];
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ItemData } from "../../models";
2
+ import { ItemData, Serialized } from "../../models";
3
3
 
4
4
  export const updateItemRequestSchema = z.object({
5
5
  name: z.string().min(1).optional(),
@@ -13,5 +13,5 @@ export const updateItemRequestSchema = z.object({
13
13
  export type UpdateItemRequest = z.infer<typeof updateItemRequestSchema>;
14
14
 
15
15
  export interface UpdateItemResponse {
16
- item: ItemData;
16
+ item: Serialized<ItemData>;
17
17
  }
@@ -1,7 +1,7 @@
1
1
  import { AuthId, UserId } from "../id-types";
2
2
 
3
3
  export interface AuthData {
4
- _id: AuthId;
4
+ id: AuthId;
5
5
  createdAt: Date;
6
6
  updatedAt: Date;
7
7
 
@@ -15,7 +15,7 @@ export enum HabitEntryStatus {
15
15
  }
16
16
 
17
17
  export interface HabitEntryData {
18
- _id: HabitEntryId;
18
+ id: HabitEntryId;
19
19
  habitId: HabitId;
20
20
  userId: UserId;
21
21
  date: DateOnlyString;
@@ -25,7 +25,7 @@ export interface HabitEntryData {
25
25
  }
26
26
 
27
27
  export interface HabitData {
28
- _id: HabitId;
28
+ id: HabitId;
29
29
  userId: UserId;
30
30
  name: string;
31
31
  description?: string | null;
@@ -1,7 +1,7 @@
1
1
  import { ItemId, UserId } from "../id-types";
2
2
 
3
3
  export interface ItemData {
4
- _id: ItemId;
4
+ id: ItemId;
5
5
  userId: UserId;
6
6
  createdAt: Date;
7
7
  updatedAt: Date;
@@ -6,7 +6,7 @@ export interface PersonProperty {
6
6
  }
7
7
 
8
8
  export interface PersonNoteData {
9
- _id: PersonNoteId;
9
+ id: PersonNoteId;
10
10
  personId: PersonId;
11
11
  userId: UserId;
12
12
  content: string;
@@ -15,7 +15,7 @@ export interface PersonNoteData {
15
15
  }
16
16
 
17
17
  export interface PersonData {
18
- _id: PersonId;
18
+ id: PersonId;
19
19
  userId: UserId;
20
20
  createdAt: Date;
21
21
  updatedAt: Date;
@@ -25,7 +25,7 @@ export interface PersonData {
25
25
  }
26
26
 
27
27
  export interface Person {
28
- _id: PersonId;
28
+ id: PersonId;
29
29
  userId: UserId;
30
30
  createdAt: Date;
31
31
  updatedAt: Date;
@@ -1,7 +1,7 @@
1
1
  import { TaskId, TaskListId, UserId } from "../id-types";
2
2
 
3
3
  export interface TaskData {
4
- _id: TaskId;
4
+ id: TaskId;
5
5
  userId: UserId;
6
6
  createdAt: Date;
7
7
  updatedAt: Date;
@@ -12,7 +12,7 @@ export interface TaskData {
12
12
  }
13
13
 
14
14
  export interface TaskListData {
15
- _id: TaskListId;
15
+ id: TaskListId;
16
16
  userId: UserId;
17
17
  createdAt: Date;
18
18
  updatedAt: Date;
@@ -1,7 +1,7 @@
1
1
  import { ThoughtId, UserId } from "../id-types";
2
2
 
3
3
  export interface ThoughtData {
4
- _id: ThoughtId;
4
+ id: ThoughtId;
5
5
  userId: UserId;
6
6
  createdAt: Date;
7
7
  updatedAt: Date;
@@ -12,7 +12,7 @@ const deviceSchema = z.object({
12
12
  });
13
13
 
14
14
  export const userDataSchema = z.object({
15
- _id: userIdSchema,
15
+ id: userIdSchema,
16
16
  createdAt: z.date(),
17
17
  updatedAt: z.date(),
18
18