@timothyw/pat-common 1.0.11 → 1.0.13

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.
@@ -0,0 +1,7 @@
1
+ export declare enum PanelType {
2
+ AGENDA = "agenda",
3
+ TASKS = "tasks",
4
+ INBOX = "inbox",
5
+ PEOPLE = "people",
6
+ SETTINGS = "settings"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PanelType = void 0;
4
+ var PanelType;
5
+ (function (PanelType) {
6
+ PanelType["AGENDA"] = "agenda";
7
+ PanelType["TASKS"] = "tasks";
8
+ PanelType["INBOX"] = "inbox";
9
+ PanelType["PEOPLE"] = "people";
10
+ PanelType["SETTINGS"] = "settings";
11
+ })(PanelType || (exports.PanelType = PanelType = {}));
@@ -5,79 +5,79 @@ export declare const updateUserConfigRequestSchema: z.ZodObject<{
5
5
  timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
6
6
  discordID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7
7
  itemListTracking: z.ZodOptional<z.ZodOptional<z.ZodObject<{
8
- channelId: z.ZodString;
9
- messageId: z.ZodString;
8
+ channelId: z.ZodOptional<z.ZodString>;
9
+ messageId: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- channelId: string;
12
- messageId: string;
11
+ channelId?: string | undefined;
12
+ messageId?: string | undefined;
13
13
  }, {
14
- channelId: string;
15
- messageId: string;
14
+ channelId?: string | undefined;
15
+ messageId?: string | undefined;
16
16
  }>>>;
17
17
  iosApp: z.ZodOptional<z.ZodObject<{
18
- panels: z.ZodArray<z.ZodObject<{
19
- type: z.ZodEnum<["agenda", "tasks", "inbox", "people", "settings"]>;
20
- visible: z.ZodBoolean;
18
+ panels: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
+ type: z.ZodOptional<z.ZodNativeEnum<typeof import("../../../enums/panel-type").PanelType>>;
20
+ visible: z.ZodOptional<z.ZodBoolean>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
23
- visible: boolean;
22
+ type?: import("../../../enums/panel-type").PanelType | undefined;
23
+ visible?: boolean | undefined;
24
24
  }, {
25
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
26
- visible: boolean;
27
- }>, "many">;
28
- itemCategories: z.ZodArray<z.ZodString, "many">;
29
- itemTypes: z.ZodArray<z.ZodString, "many">;
30
- propertyKeys: z.ZodArray<z.ZodString, "many">;
25
+ type?: import("../../../enums/panel-type").PanelType | undefined;
26
+ visible?: boolean | undefined;
27
+ }>, "many">>;
28
+ itemCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
29
+ itemTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
30
+ propertyKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
31
  }, "strip", z.ZodTypeAny, {
32
- panels: {
33
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
34
- visible: boolean;
35
- }[];
36
- itemCategories: string[];
37
- itemTypes: string[];
38
- propertyKeys: string[];
32
+ panels?: {
33
+ type?: import("../../../enums/panel-type").PanelType | undefined;
34
+ visible?: boolean | undefined;
35
+ }[] | undefined;
36
+ itemCategories?: string[] | undefined;
37
+ itemTypes?: string[] | undefined;
38
+ propertyKeys?: string[] | undefined;
39
39
  }, {
40
- panels: {
41
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
42
- visible: boolean;
43
- }[];
44
- itemCategories: string[];
45
- itemTypes: string[];
46
- propertyKeys: string[];
40
+ panels?: {
41
+ type?: import("../../../enums/panel-type").PanelType | undefined;
42
+ visible?: boolean | undefined;
43
+ }[] | undefined;
44
+ itemCategories?: string[] | undefined;
45
+ itemTypes?: string[] | undefined;
46
+ propertyKeys?: string[] | undefined;
47
47
  }>>;
48
48
  }, "strict", z.ZodTypeAny, {
49
49
  name?: string | undefined;
50
50
  timezone?: string | undefined;
51
51
  discordID?: string | undefined;
52
52
  itemListTracking?: {
53
- channelId: string;
54
- messageId: string;
53
+ channelId?: string | undefined;
54
+ messageId?: string | undefined;
55
55
  } | undefined;
56
56
  iosApp?: {
57
- panels: {
58
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
59
- visible: boolean;
60
- }[];
61
- itemCategories: string[];
62
- itemTypes: string[];
63
- propertyKeys: string[];
57
+ panels?: {
58
+ type?: import("../../../enums/panel-type").PanelType | undefined;
59
+ visible?: boolean | undefined;
60
+ }[] | undefined;
61
+ itemCategories?: string[] | undefined;
62
+ itemTypes?: string[] | undefined;
63
+ propertyKeys?: string[] | undefined;
64
64
  } | undefined;
65
65
  }, {
66
66
  name?: string | undefined;
67
67
  timezone?: string | undefined;
68
68
  discordID?: string | undefined;
69
69
  itemListTracking?: {
70
- channelId: string;
71
- messageId: string;
70
+ channelId?: string | undefined;
71
+ messageId?: string | undefined;
72
72
  } | undefined;
73
73
  iosApp?: {
74
- panels: {
75
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
76
- visible: boolean;
77
- }[];
78
- itemCategories: string[];
79
- itemTypes: string[];
80
- propertyKeys: string[];
74
+ panels?: {
75
+ type?: import("../../../enums/panel-type").PanelType | undefined;
76
+ visible?: boolean | undefined;
77
+ }[] | undefined;
78
+ itemCategories?: string[] | undefined;
79
+ itemTypes?: string[] | undefined;
80
+ propertyKeys?: string[] | undefined;
81
81
  } | undefined;
82
82
  }>;
83
83
  export type UpdateUserConfigRequest = z.infer<typeof updateUserConfigRequestSchema>;
@@ -4,5 +4,5 @@ exports.updateUserConfigRequestSchema = void 0;
4
4
  const models_1 = require("../../models");
5
5
  exports.updateUserConfigRequestSchema = models_1.userConfigSchema
6
6
  .omit({ _id: true, createdAt: true, updatedAt: true })
7
- .partial()
7
+ .deepPartial()
8
8
  .strict();
@@ -1,18 +1,17 @@
1
1
  import { z } from "zod";
2
- import { UserId } from "../id-types";
2
+ import { PanelType } from "../../enums/panel-type";
3
3
  declare const panelSchema: z.ZodObject<{
4
- type: z.ZodEnum<["agenda", "tasks", "inbox", "people", "settings"]>;
4
+ type: z.ZodNativeEnum<typeof PanelType>;
5
5
  visible: z.ZodBoolean;
6
6
  }, "strip", z.ZodTypeAny, {
7
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
7
+ type: PanelType;
8
8
  visible: boolean;
9
9
  }, {
10
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
10
+ type: PanelType;
11
11
  visible: boolean;
12
12
  }>;
13
- export type Panel = z.infer<typeof panelSchema>;
14
13
  export declare const userConfigSchema: z.ZodObject<{
15
- _id: z.ZodEffects<z.ZodString, UserId, string>;
14
+ _id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
16
15
  createdAt: z.ZodDate;
17
16
  updatedAt: z.ZodDate;
18
17
  name: z.ZodString;
@@ -30,13 +29,13 @@ export declare const userConfigSchema: z.ZodObject<{
30
29
  }>>;
31
30
  iosApp: z.ZodObject<{
32
31
  panels: z.ZodArray<z.ZodObject<{
33
- type: z.ZodEnum<["agenda", "tasks", "inbox", "people", "settings"]>;
32
+ type: z.ZodNativeEnum<typeof PanelType>;
34
33
  visible: z.ZodBoolean;
35
34
  }, "strip", z.ZodTypeAny, {
36
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
35
+ type: PanelType;
37
36
  visible: boolean;
38
37
  }, {
39
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
38
+ type: PanelType;
40
39
  visible: boolean;
41
40
  }>, "many">;
42
41
  itemCategories: z.ZodArray<z.ZodString, "many">;
@@ -44,7 +43,7 @@ export declare const userConfigSchema: z.ZodObject<{
44
43
  propertyKeys: z.ZodArray<z.ZodString, "many">;
45
44
  }, "strip", z.ZodTypeAny, {
46
45
  panels: {
47
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
46
+ type: PanelType;
48
47
  visible: boolean;
49
48
  }[];
50
49
  itemCategories: string[];
@@ -52,7 +51,7 @@ export declare const userConfigSchema: z.ZodObject<{
52
51
  propertyKeys: string[];
53
52
  }, {
54
53
  panels: {
55
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
54
+ type: PanelType;
56
55
  visible: boolean;
57
56
  }[];
58
57
  itemCategories: string[];
@@ -69,7 +68,7 @@ export declare const userConfigSchema: z.ZodObject<{
69
68
  timezone: string;
70
69
  iosApp: {
71
70
  panels: {
72
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
71
+ type: PanelType;
73
72
  visible: boolean;
74
73
  }[];
75
74
  itemCategories: string[];
@@ -89,7 +88,7 @@ export declare const userConfigSchema: z.ZodObject<{
89
88
  timezone: string;
90
89
  iosApp: {
91
90
  panels: {
92
- type: "agenda" | "tasks" | "inbox" | "people" | "settings";
91
+ type: PanelType;
93
92
  visible: boolean;
94
93
  }[];
95
94
  itemCategories: string[];
@@ -102,5 +101,6 @@ export declare const userConfigSchema: z.ZodObject<{
102
101
  messageId: string;
103
102
  } | undefined;
104
103
  }>;
104
+ export type Panel = z.infer<typeof panelSchema>;
105
105
  export type UserConfig = z.infer<typeof userConfigSchema>;
106
106
  export {};
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.userConfigSchema = void 0;
4
- const panels_1 = require("../panels");
5
4
  const zod_1 = require("zod");
6
5
  const id_types_1 = require("../id-types");
6
+ const panel_type_1 = require("../../enums/panel-type");
7
7
  const panelSchema = zod_1.z.object({
8
- type: zod_1.z.enum(panels_1.PANEL_TYPES),
8
+ type: zod_1.z.nativeEnum(panel_type_1.PanelType),
9
9
  visible: zod_1.z.boolean()
10
10
  });
11
- // export interface Panel {
12
- // type: PanelType;
13
- // visible: boolean;
14
- // }
15
11
  exports.userConfigSchema = zod_1.z.object({
16
12
  _id: id_types_1.userIdSchema,
17
13
  createdAt: zod_1.z.date(),
@@ -38,22 +34,3 @@ exports.userConfigSchema = zod_1.z.object({
38
34
  propertyKeys: zod_1.z.array(zod_1.z.string())
39
35
  })
40
36
  });
41
- // export interface UserConfig {
42
- // _id: UserId;
43
- // createdAt: Date;
44
- // updatedAt: Date;
45
- //
46
- // name: string;
47
- // timezone: string;
48
- // discordID?: string;
49
- // itemListTracking?: {
50
- // channelId: string;
51
- // messageId: string;
52
- // };
53
- // iosApp: {
54
- // panels: Panel[];
55
- // itemCategories: string[];
56
- // itemTypes: string[];
57
- // propertyKeys: string[];
58
- // };
59
- // }
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.11",
5
+ "version": "1.0.13",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -0,0 +1,7 @@
1
+ export enum PanelType {
2
+ AGENDA = 'agenda',
3
+ TASKS = 'tasks',
4
+ INBOX = 'inbox',
5
+ PEOPLE = 'people',
6
+ SETTINGS = 'settings'
7
+ }
@@ -3,7 +3,7 @@ import { UserConfig, userConfigSchema } from "../../models";
3
3
 
4
4
  export const updateUserConfigRequestSchema = userConfigSchema
5
5
  .omit({ _id: true, createdAt: true, updatedAt: true })
6
- .partial()
6
+ .deepPartial()
7
7
  .strict();
8
8
 
9
9
  export type UpdateUserConfigRequest = z.infer<typeof updateUserConfigRequestSchema>;
@@ -1,19 +1,12 @@
1
- import { PANEL_TYPES, PanelType } from "../panels";
2
1
  import { z } from "zod";
3
- import { AuthId, UserId, userIdSchema } from "../id-types";
2
+ import { userIdSchema } from "../id-types";
3
+ import { PanelType } from "../../enums/panel-type";
4
4
 
5
5
  const panelSchema = z.object({
6
- type: z.enum(PANEL_TYPES),
6
+ type: z.nativeEnum(PanelType),
7
7
  visible: z.boolean()
8
8
  });
9
9
 
10
- export type Panel = z.infer<typeof panelSchema>;
11
-
12
- // export interface Panel {
13
- // type: PanelType;
14
- // visible: boolean;
15
- // }
16
-
17
10
  export const userConfigSchema = z.object({
18
11
  _id: userIdSchema,
19
12
  createdAt: z.date(),
@@ -40,24 +33,5 @@ export const userConfigSchema = z.object({
40
33
  })
41
34
  });
42
35
 
43
- export type UserConfig = z.infer<typeof userConfigSchema>;
44
-
45
- // export interface UserConfig {
46
- // _id: UserId;
47
- // createdAt: Date;
48
- // updatedAt: Date;
49
- //
50
- // name: string;
51
- // timezone: string;
52
- // discordID?: string;
53
- // itemListTracking?: {
54
- // channelId: string;
55
- // messageId: string;
56
- // };
57
- // iosApp: {
58
- // panels: Panel[];
59
- // itemCategories: string[];
60
- // itemTypes: string[];
61
- // propertyKeys: string[];
62
- // };
63
- // }
36
+ export type Panel = z.infer<typeof panelSchema>;
37
+ export type UserConfig = z.infer<typeof userConfigSchema>;
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2016",
4
- "module": "commonjs",
3
+ "target": "ES2020",
4
+ "module": "CommonJS",
5
5
  "esModuleInterop": true,
6
6
  "forceConsistentCasingInFileNames": true,
7
7
  "strict": true,