@timothyw/pat-common 1.0.4 → 1.0.5

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.
Files changed (109) hide show
  1. package/dist/types/api/account/get-user-config-types.d.ts +4 -0
  2. package/dist/types/api/account/get-user-config-types.js +2 -0
  3. package/dist/types/api/account/index.d.ts +2 -0
  4. package/dist/types/api/account/index.js +18 -0
  5. package/dist/types/api/account/update-user-config-types.d.ts +87 -0
  6. package/dist/types/api/account/update-user-config-types.js +35 -0
  7. package/dist/types/api/auth/index.d.ts +5 -0
  8. package/dist/types/api/auth/index.js +21 -0
  9. package/dist/types/api/auth/login-types.d.ts +19 -0
  10. package/dist/types/api/auth/login-types.js +8 -0
  11. package/dist/types/api/auth/refresh-auth-types.d.ts +15 -0
  12. package/dist/types/api/auth/refresh-auth-types.js +7 -0
  13. package/dist/types/api/auth/register-types.d.ts +23 -0
  14. package/dist/types/api/auth/register-types.js +10 -0
  15. package/dist/types/api/auth/resend-verification-types.d.ts +3 -0
  16. package/dist/types/api/auth/resend-verification-types.js +2 -0
  17. package/dist/types/api/auth/verify-email-types.d.ts +3 -0
  18. package/dist/types/api/auth/verify-email-types.js +2 -0
  19. package/dist/types/api/index.d.ts +5 -0
  20. package/dist/types/api/index.js +21 -0
  21. package/dist/types/api/items/complete-item-types.d.ts +18 -0
  22. package/dist/types/api/items/complete-item-types.js +7 -0
  23. package/dist/types/api/items/create-item-types.d.ts +36 -0
  24. package/dist/types/api/items/create-item-types.js +12 -0
  25. package/dist/types/api/items/delete-item-types.d.ts +3 -0
  26. package/dist/types/api/items/delete-item-types.js +2 -0
  27. package/dist/types/api/items/get-items-types.d.ts +4 -0
  28. package/dist/types/api/items/get-items-types.js +2 -0
  29. package/dist/types/api/items/index.d.ts +5 -0
  30. package/dist/types/api/items/index.js +21 -0
  31. package/dist/types/api/items/update-item-types.d.ts +36 -0
  32. package/dist/types/api/items/update-item-types.js +12 -0
  33. package/dist/types/api/people/create-person-types.d.ts +55 -0
  34. package/dist/types/api/people/create-person-types.js +14 -0
  35. package/dist/types/api/people/delete-person-types.d.ts +3 -0
  36. package/dist/types/api/people/delete-person-types.js +2 -0
  37. package/dist/types/api/people/get-people-types.d.ts +15 -0
  38. package/dist/types/api/people/get-people-types.js +2 -0
  39. package/dist/types/api/people/index.d.ts +4 -0
  40. package/dist/types/api/people/index.js +20 -0
  41. package/dist/types/api/people/update-person-types.d.ts +55 -0
  42. package/dist/types/api/people/update-person-types.js +14 -0
  43. package/dist/types/api/thoguhts/create-thought-types.d.ts +15 -0
  44. package/dist/types/api/thoguhts/create-thought-types.js +7 -0
  45. package/dist/types/api/thoguhts/delete-thought-types.d.ts +3 -0
  46. package/dist/types/api/thoguhts/delete-thought-types.js +2 -0
  47. package/dist/types/api/thoguhts/get-thoughts-types.d.ts +6 -0
  48. package/dist/types/api/thoguhts/get-thoughts-types.js +2 -0
  49. package/dist/types/api/thoguhts/index.d.ts +4 -0
  50. package/dist/types/api/thoguhts/index.js +20 -0
  51. package/dist/types/api/thoguhts/update-thought-types.d.ts +15 -0
  52. package/dist/types/api/thoguhts/update-thought-types.js +7 -0
  53. package/dist/types/id-types.d.ts +15 -0
  54. package/dist/types/id-types.js +2 -0
  55. package/dist/types/index.d.ts +4 -0
  56. package/dist/types/index.js +4 -0
  57. package/dist/types/models/auth-data.d.ts +14 -0
  58. package/dist/types/models/auth-data.js +9 -0
  59. package/dist/types/models/index.d.ts +6 -0
  60. package/dist/types/models/index.js +22 -0
  61. package/dist/types/models/item-data.d.ts +14 -0
  62. package/dist/types/models/item-data.js +2 -0
  63. package/dist/types/models/person-data.d.ts +19 -0
  64. package/dist/types/models/person-data.js +2 -0
  65. package/dist/types/models/program-config.d.ts +17 -0
  66. package/dist/types/models/program-config.js +2 -0
  67. package/dist/types/models/thought-data.d.ts +8 -0
  68. package/dist/types/models/thought-data.js +2 -0
  69. package/dist/types/models/user-config.d.ts +24 -0
  70. package/dist/types/models/user-config.js +2 -0
  71. package/dist/types/panels.d.ts +2 -0
  72. package/dist/types/panels.js +4 -0
  73. package/package.json +5 -2
  74. package/src/types/api/account/get-user-config-types.ts +5 -0
  75. package/src/types/api/account/index.ts +2 -0
  76. package/src/types/api/account/update-user-config-types.ts +40 -0
  77. package/src/types/api/auth/index.ts +5 -0
  78. package/src/types/api/auth/login-types.ts +16 -0
  79. package/src/types/api/auth/refresh-auth-types.ts +14 -0
  80. package/src/types/api/auth/register-types.ts +16 -0
  81. package/src/types/api/auth/resend-verification-types.ts +3 -0
  82. package/src/types/api/auth/verify-email-types.ts +3 -0
  83. package/src/types/api/index.ts +5 -0
  84. package/src/types/api/items/complete-item-types.ts +17 -0
  85. package/src/types/api/items/create-item-types.ts +25 -0
  86. package/src/types/api/items/delete-item-types.ts +3 -0
  87. package/src/types/api/items/get-items-types.ts +5 -0
  88. package/src/types/api/items/index.ts +5 -0
  89. package/src/types/api/items/update-item-types.ts +25 -0
  90. package/src/types/api/people/create-person-types.ts +30 -0
  91. package/src/types/api/people/delete-person-types.ts +3 -0
  92. package/src/types/api/people/get-people-types.ts +15 -0
  93. package/src/types/api/people/index.ts +4 -0
  94. package/src/types/api/people/update-person-types.ts +30 -0
  95. package/src/types/api/thoguhts/create-thought-types.ts +14 -0
  96. package/src/types/api/thoguhts/delete-thought-types.ts +3 -0
  97. package/src/types/api/thoguhts/get-thoughts-types.ts +6 -0
  98. package/src/types/api/thoguhts/index.ts +4 -0
  99. package/src/types/api/thoguhts/update-thought-types.ts +14 -0
  100. package/src/types/id-types.ts +6 -0
  101. package/src/types/index.ts +5 -1
  102. package/src/types/models/auth-data.ts +21 -0
  103. package/src/types/models/index.ts +6 -0
  104. package/src/types/models/item-data.ts +17 -0
  105. package/src/types/models/person-data.ts +22 -0
  106. package/src/types/models/program-config.ts +17 -0
  107. package/src/types/models/thought-data.ts +9 -0
  108. package/src/types/models/user-config.ts +27 -0
  109. package/src/types/panels.ts +3 -0
@@ -0,0 +1,3 @@
1
+ export interface DeletePersonResponse {
2
+ deleted: boolean;
3
+ }
@@ -0,0 +1,15 @@
1
+ export interface GetPeopleResponse {
2
+ people: Array<{
3
+ id: string;
4
+ name: string;
5
+ properties: Array<{
6
+ key: string;
7
+ value: string;
8
+ }>;
9
+ notes: Array<{
10
+ content: string;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ }>;
14
+ }>;
15
+ }
@@ -0,0 +1,4 @@
1
+ export * from './create-person-types';
2
+ export * from './delete-person-types';
3
+ export * from './get-people-types';
4
+ export * from './update-person-types';
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+
3
+ export const updatePersonRequestSchema = z.object({
4
+ name: z.string().min(1).optional(),
5
+ properties: z.array(z.object({
6
+ key: z.string().min(1),
7
+ value: z.string().min(1)
8
+ })).optional(),
9
+ notes: z.array(z.object({
10
+ content: z.string().min(1)
11
+ })).optional()
12
+ });
13
+
14
+ export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;
15
+
16
+ export interface UpdatePersonResponse {
17
+ person: {
18
+ id: string;
19
+ name: string;
20
+ properties: Array<{
21
+ key: string;
22
+ value: string;
23
+ }>;
24
+ notes: Array<{
25
+ content: string;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ }>;
29
+ };
30
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+
3
+ export const createThoughtRequestSchema = z.object({
4
+ content: z.string().min(1)
5
+ });
6
+
7
+ export type CreateThoughtRequest = z.infer<typeof createThoughtRequestSchema>;
8
+
9
+ export interface CreateThoughtResponse {
10
+ thought: {
11
+ id: string;
12
+ content: string;
13
+ };
14
+ }
@@ -0,0 +1,3 @@
1
+ export interface DeleteThoughtResponse {
2
+ deleted: boolean;
3
+ }
@@ -0,0 +1,6 @@
1
+ export interface GetThoughtsResponse {
2
+ thoughts: Array<{
3
+ id: string;
4
+ content: string;
5
+ }>;
6
+ }
@@ -0,0 +1,4 @@
1
+ export * from './create-thought-types';
2
+ export * from './delete-thought-types';
3
+ export * from './get-thoughts-types';
4
+ export * from './update-thought-types';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+
3
+ export const updateThoughtRequestSchema = z.object({
4
+ content: z.string().min(1)
5
+ });
6
+
7
+ export type UpdateThoughtRequest = z.infer<typeof updateThoughtRequestSchema>;
8
+
9
+ export interface UpdateThoughtResponse {
10
+ thought: {
11
+ id: string;
12
+ content: string;
13
+ };
14
+ }
@@ -0,0 +1,6 @@
1
+ export type UserId = string & { readonly __brand: unique symbol };
2
+ export type AuthId = string & { readonly __brand: unique symbol };
3
+
4
+ export type ItemId = string & { readonly __brand: unique symbol };
5
+ export type PersonId = string & { readonly __brand: unique symbol };
6
+ export type ThoughtId = string & { readonly __brand: unique symbol };
@@ -1 +1,5 @@
1
- export * from './auth-tokens'
1
+ export * from './api'
2
+ export * from './models'
3
+ export * from './auth-tokens'
4
+ export * from './id-types'
5
+ export * from './panels'
@@ -0,0 +1,21 @@
1
+ import { AuthId, UserId } from "../id-types";
2
+
3
+ export interface AuthData {
4
+ _id: AuthId;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+
8
+ userId: UserId;
9
+ email: string;
10
+ passwordHash: string;
11
+ emailVerified: boolean;
12
+ }
13
+
14
+ export type PublicAuthData = Pick<AuthData, 'email' | 'emailVerified'> & { readonly __brand: unique symbol };
15
+
16
+ export function toPublicAuthData(data: AuthData): PublicAuthData {
17
+ return {
18
+ email: data.email,
19
+ emailVerified: data.emailVerified
20
+ } as PublicAuthData;
21
+ }
@@ -0,0 +1,6 @@
1
+ export * from './auth-data';
2
+ export * from './item-data';
3
+ export * from './person-data';
4
+ export * from './program-config';
5
+ export * from './thought-data';
6
+ export * from './user-config';
@@ -0,0 +1,17 @@
1
+ import { ItemId, UserId } from "../id-types";
2
+
3
+ export interface ItemData {
4
+ _id: ItemId;
5
+ userId: UserId;
6
+
7
+ createdAt: Date;
8
+ updatedAt: Date;
9
+
10
+ name: string;
11
+ dueDate?: Date | null;
12
+ notes?: string;
13
+ completed: boolean;
14
+ urgent: boolean;
15
+ category?: string | null;
16
+ type?: string | null;
17
+ }
@@ -0,0 +1,22 @@
1
+ import { PersonId, UserId } from "../id-types";
2
+
3
+ export interface PersonProperty {
4
+ key: string;
5
+ value: string;
6
+ }
7
+
8
+ export interface PersonNote {
9
+ content: string;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
13
+
14
+ export interface PersonData {
15
+ _id: PersonId;
16
+ userId: UserId;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ name: string;
20
+ properties: PersonProperty[];
21
+ notes: PersonNote[];
22
+ }
@@ -0,0 +1,17 @@
1
+ export interface ProgramConfigData extends Document {
2
+ dev: {
3
+ authorizedEmails: string[]
4
+ };
5
+ discord: {
6
+ token: string;
7
+ clientId: string;
8
+ guildId: string;
9
+ logChannelId?: string;
10
+ };
11
+ mailjet: {
12
+ apiKey: string;
13
+ secretKey: string;
14
+ };
15
+ updatedAt: Date;
16
+ createdAt: Date;
17
+ }
@@ -0,0 +1,9 @@
1
+ import { ThoughtId, UserId } from "../id-types";
2
+
3
+ export interface ThoughtData {
4
+ _id: ThoughtId;
5
+ userId: UserId;
6
+ createdAt: Date;
7
+ updatedAt: Date;
8
+ content: string;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { PanelType } from "../panels";
2
+ import { UserId } from "../id-types";
3
+
4
+ export interface Panel {
5
+ type: PanelType;
6
+ visible: boolean;
7
+ }
8
+
9
+ export interface UserConfig {
10
+ _id: UserId;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+
14
+ name: string;
15
+ timezone: string;
16
+ discordID?: string;
17
+ itemListTracking?: {
18
+ channelId: string;
19
+ messageId: string;
20
+ };
21
+ iosApp: {
22
+ panels: Panel[];
23
+ itemCategories: string[];
24
+ itemTypes: string[];
25
+ propertyKeys?: string[];
26
+ };
27
+ }
@@ -0,0 +1,3 @@
1
+ export const PANEL_TYPES = ['agenda', 'tasks', 'inbox', 'people', 'settings'] as const;
2
+
3
+ export type PanelType = (typeof PANEL_TYPES)[number];