@timothyw/pat-common 1.0.119 → 1.0.120

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 (111) hide show
  1. package/dist/types/agenda-types.d.ts +115 -0
  2. package/dist/types/agenda-types.js +37 -0
  3. package/dist/types/auth-types.d.ts +153 -0
  4. package/dist/types/auth-types.js +48 -0
  5. package/dist/types/habits-types.d.ts +315 -0
  6. package/dist/types/habits-types.js +70 -0
  7. package/dist/types/index.d.ts +11 -3
  8. package/dist/types/index.js +11 -6
  9. package/dist/types/lists-types.d.ts +162 -0
  10. package/dist/types/lists-types.js +50 -0
  11. package/dist/types/misc/index.d.ts +3 -0
  12. package/dist/types/misc/index.js +19 -0
  13. package/dist/types/misc/misc-types.d.ts +8 -0
  14. package/dist/types/misc/misc-types.js +9 -0
  15. package/dist/types/misc/socket-message-types.d.ts +17 -0
  16. package/dist/types/misc/socket-message-types.js +12 -0
  17. package/dist/types/misc/version-types.d.ts +26 -0
  18. package/dist/types/misc/version-types.js +13 -0
  19. package/dist/types/notifications-types.d.ts +570 -0
  20. package/dist/types/notifications-types.js +149 -0
  21. package/dist/types/people-types.d.ts +283 -0
  22. package/dist/types/people-types.js +58 -0
  23. package/dist/types/program-config-types.d.ts +105 -0
  24. package/dist/types/program-config-types.js +29 -0
  25. package/dist/types/thoughts-types.d.ts +56 -0
  26. package/dist/types/thoughts-types.js +18 -0
  27. package/dist/types/user-types.d.ts +283 -0
  28. package/dist/types/user-types.js +46 -0
  29. package/package.json +1 -1
  30. package/src/types/{new/agenda-types.ts → agenda-types.ts} +2 -2
  31. package/src/types/{new/auth-types.ts → auth-types.ts} +1 -1
  32. package/src/types/{new/habits-types.ts → habits-types.ts} +3 -3
  33. package/src/types/index.ts +12 -7
  34. package/src/types/{new/lists-types.ts → lists-types.ts} +2 -2
  35. package/src/types/misc/index.ts +3 -0
  36. package/src/types/{new/notifications-types.ts → notifications-types.ts} +56 -12
  37. package/src/types/{new/people-types.ts → people-types.ts} +2 -2
  38. package/src/types/{new/thoughts-types.ts → thoughts-types.ts} +2 -2
  39. package/src/types/{new/user-types.ts → user-types.ts} +3 -3
  40. package/src/types/new/index.ts +0 -10
  41. package/src/types/new/misc/index.ts +0 -1
  42. package/src/types/old/api/account/get-user-types.ts +0 -6
  43. package/src/types/old/api/account/index.ts +0 -2
  44. package/src/types/old/api/account/update-user-types.ts +0 -14
  45. package/src/types/old/api/auth/create-account-types.ts +0 -17
  46. package/src/types/old/api/auth/index.ts +0 -5
  47. package/src/types/old/api/auth/refresh-auth-types.ts +0 -14
  48. package/src/types/old/api/auth/resend-verification-types.ts +0 -3
  49. package/src/types/old/api/auth/sign-in-types.ts +0 -16
  50. package/src/types/old/api/auth/verify-email-types.ts +0 -3
  51. package/src/types/old/api/habits/create-habit-entry-types.ts +0 -15
  52. package/src/types/old/api/habits/create-habit-types.ts +0 -17
  53. package/src/types/old/api/habits/delete-habit-entry-types.ts +0 -6
  54. package/src/types/old/api/habits/delete-habit-types.ts +0 -3
  55. package/src/types/old/api/habits/get-habits-types.ts +0 -6
  56. package/src/types/old/api/habits/index.ts +0 -6
  57. package/src/types/old/api/habits/update-habit-types.ts +0 -17
  58. package/src/types/old/api/index.ts +0 -9
  59. package/src/types/old/api/items/complete-item-types.ts +0 -13
  60. package/src/types/old/api/items/create-item-types.ts +0 -18
  61. package/src/types/old/api/items/delete-item-types.ts +0 -3
  62. package/src/types/old/api/items/get-items-types.ts +0 -6
  63. package/src/types/old/api/items/index.ts +0 -5
  64. package/src/types/old/api/items/update-item-types.ts +0 -18
  65. package/src/types/old/api/lists/complete-list-item-types.ts +0 -13
  66. package/src/types/old/api/lists/create-list-item-types.ts +0 -16
  67. package/src/types/old/api/lists/create-list-types.ts +0 -14
  68. package/src/types/old/api/lists/get-list-item-types.ts +0 -6
  69. package/src/types/old/api/lists/get-lists-types.ts +0 -6
  70. package/src/types/old/api/lists/index.ts +0 -7
  71. package/src/types/old/api/lists/update-list-item-types.ts +0 -17
  72. package/src/types/old/api/lists/update-list-types.ts +0 -14
  73. package/src/types/old/api/misc/index.ts +0 -1
  74. package/src/types/old/api/misc/version-types.ts +0 -10
  75. package/src/types/old/api/notifications/create-notification-template-types.ts +0 -30
  76. package/src/types/old/api/notifications/delete-notification-template-types.ts +0 -8
  77. package/src/types/old/api/notifications/get-notification-templates-types.ts +0 -12
  78. package/src/types/old/api/notifications/index.ts +0 -6
  79. package/src/types/old/api/notifications/preview-notification-template-types.ts +0 -21
  80. package/src/types/old/api/notifications/sync-notification-template-types.ts +0 -14
  81. package/src/types/old/api/notifications/update-notification-template-types.ts +0 -30
  82. package/src/types/old/api/people/create-person-note-types.ts +0 -15
  83. package/src/types/old/api/people/create-person-types.ts +0 -19
  84. package/src/types/old/api/people/delete-person-notes-types.ts +0 -3
  85. package/src/types/old/api/people/delete-person-types.ts +0 -3
  86. package/src/types/old/api/people/get-people-types.ts +0 -6
  87. package/src/types/old/api/people/get-person-notes-types.ts +0 -6
  88. package/src/types/old/api/people/index.ts +0 -8
  89. package/src/types/old/api/people/update-person-note-types.ts +0 -13
  90. package/src/types/old/api/people/update-person-types.ts +0 -19
  91. package/src/types/old/api/thoughts/create-thought-types.ts +0 -13
  92. package/src/types/old/api/thoughts/delete-thought-types.ts +0 -3
  93. package/src/types/old/api/thoughts/get-thoughts-types.ts +0 -6
  94. package/src/types/old/api/thoughts/index.ts +0 -4
  95. package/src/types/old/api/thoughts/update-thought-types.ts +0 -13
  96. package/src/types/old/auth-tokens.ts +0 -13
  97. package/src/types/old/models/auth-data.ts +0 -21
  98. package/src/types/old/models/habit-data.ts +0 -62
  99. package/src/types/old/models/index.ts +0 -10
  100. package/src/types/old/models/item-data.ts +0 -16
  101. package/src/types/old/models/list-data.ts +0 -26
  102. package/src/types/old/models/notifiable.ts +0 -52
  103. package/src/types/old/models/notification-template-data.ts +0 -67
  104. package/src/types/old/models/person-data.ts +0 -35
  105. package/src/types/old/models/program-config.ts +0 -25
  106. package/src/types/old/models/thought-data.ts +0 -9
  107. package/src/types/old/models/user-data.ts +0 -47
  108. /package/src/types/{misc-types.ts → misc/misc-types.ts} +0 -0
  109. /package/src/types/{socket-message-types.ts → misc/socket-message-types.ts} +0 -0
  110. /package/src/types/{new/misc → misc}/version-types.ts +0 -0
  111. /package/src/types/{new/program-config-types.ts → program-config-types.ts} +0 -0
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- import { Habit, HabitFrequency } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const createHabitRequestSchema = z.object({
6
- name: z.string().min(1, 'Name is required').trim(),
7
- description: z.string().trim().optional(),
8
- notes: z.string().trim().optional(),
9
- frequency: z.nativeEnum(HabitFrequency),
10
- rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, 'rolloverTime must be in HH:MM format')
11
- });
12
-
13
- export type CreateHabitRequest = z.infer<typeof createHabitRequestSchema>;
14
-
15
- export interface CreateHabitResponse {
16
- habit: Serialized<Habit>;
17
- }
@@ -1,6 +0,0 @@
1
- import { Habit } from "../../models";
2
- import { Serialized } from "../../../../utils";
3
-
4
- export interface DeleteHabitEntryResponse {
5
- habit: Serialized<Habit>;
6
- }
@@ -1,3 +0,0 @@
1
- export interface DeleteHabitResponse {
2
- success: boolean;
3
- }
@@ -1,6 +0,0 @@
1
- import { Habit } from "../../models";
2
- import { Serialized } from "../../../../utils";
3
-
4
- export interface GetHabitsResponse {
5
- habits: Serialized<Habit>[];
6
- }
@@ -1,6 +0,0 @@
1
- export * from './create-habit-entry-types';
2
- export * from './create-habit-types';
3
- export * from './delete-habit-entry-types';
4
- export * from './delete-habit-types';
5
- export * from './get-habits-types';
6
- export * from './update-habit-types';
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- import { Habit, HabitFrequency } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const updateHabitRequestSchema = z.object({
6
- name: z.string().min(1, 'Name is required').trim().optional(),
7
- description: z.string().trim().nullish(),
8
- notes: z.string().trim().nullish(),
9
- frequency: z.nativeEnum(HabitFrequency).optional(),
10
- rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, 'rolloverTime must be in HH:MM format').optional()
11
- });
12
-
13
- export type UpdateHabitRequest = z.infer<typeof updateHabitRequestSchema>;
14
-
15
- export interface UpdateHabitResponse {
16
- habit: Serialized<Habit>;
17
- }
@@ -1,9 +0,0 @@
1
- export * from './account'
2
- export * from './auth'
3
- export * from './habits'
4
- export * from './items'
5
- export * from './misc'
6
- export * from './notifications'
7
- export * from './people'
8
- export * from './lists'
9
- export * from './thoughts'
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
- import { ItemData } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const completeItemRequestSchema = z.object({
6
- completed: z.boolean()
7
- });
8
-
9
- export type CompleteItemRequest = z.infer<typeof completeItemRequestSchema>;
10
-
11
- export interface CompleteItemResponse {
12
- item: Serialized<ItemData>;
13
- }
@@ -1,18 +0,0 @@
1
- import { z } from 'zod';
2
- import { ItemData } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const createItemRequestSchema = z.object({
6
- name: z.string().min(1),
7
- dueDate: z.string().optional(),
8
- notes: z.string().optional(),
9
- urgent: z.boolean().optional().default(false),
10
- category: z.string().optional(),
11
- type: z.string().optional()
12
- });
13
-
14
- export type CreateItemRequest = z.infer<typeof createItemRequestSchema>;
15
-
16
- export interface CreateItemResponse {
17
- item: Serialized<ItemData>;
18
- }
@@ -1,3 +0,0 @@
1
- export interface DeleteItemResponse {
2
- deleted: boolean;
3
- }
@@ -1,6 +0,0 @@
1
- import { ItemData } from "../../models";
2
- import { Serialized } from "../../../../utils";
3
-
4
- export interface GetItemsResponse {
5
- items: Serialized<ItemData>[];
6
- }
@@ -1,5 +0,0 @@
1
- export * from './complete-item-types';
2
- export * from './create-item-types';
3
- export * from './delete-item-types';
4
- export * from './get-items-types';
5
- export * from './update-item-types';
@@ -1,18 +0,0 @@
1
- import { z } from 'zod';
2
- import { ItemData } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const updateItemRequestSchema = z.object({
6
- name: z.string().min(1).optional(),
7
- dueDate: z.string().nullish(),
8
- notes: z.string().nullish(),
9
- urgent: z.boolean().optional(),
10
- category: z.string().nullish(),
11
- type: z.string().nullish()
12
- });
13
-
14
- export type UpdateItemRequest = z.infer<typeof updateItemRequestSchema>;
15
-
16
- export interface UpdateItemResponse {
17
- item: Serialized<ItemData>;
18
- }
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
- import { Serialized } from "../../../../utils";
3
- import { ListItemData } from "../../models";
4
-
5
- export const completeListItemRequestSchema = z.object({
6
- completed: z.boolean()
7
- });
8
-
9
- export type CompleteListItemRequest = z.infer<typeof completeListItemRequestSchema>;
10
-
11
- export interface CompleteListItemResponse {
12
- listItem: Serialized<ListItemData>;
13
- }
@@ -1,16 +0,0 @@
1
- import { z } from 'zod';
2
- import { listIdSchema } from '../../../id-types';
3
- import { Serialized } from "../../../../utils";
4
- import { ListItemData } from "../../models";
5
-
6
- export const createListItemRequestSchema = z.object({
7
- name: z.string().min(1),
8
- notes: z.string().optional(),
9
- listId: listIdSchema
10
- });
11
-
12
- export type CreateListItemRequest = z.infer<typeof createListItemRequestSchema>;
13
-
14
- export interface CreateListItemResponse {
15
- listItem: Serialized<ListItemData>;
16
- }
@@ -1,14 +0,0 @@
1
- import { z } from 'zod';
2
- import { Serialized } from "../../../../utils";
3
- import { ListData, ListType } from "../../models";
4
-
5
- export const createListRequestSchema = z.object({
6
- name: z.string().min(1),
7
- type: z.nativeEnum(ListType)
8
- });
9
-
10
- export type CreateListRequest = z.infer<typeof createListRequestSchema>;
11
-
12
- export interface CreateListResponse {
13
- list: Serialized<ListData>;
14
- }
@@ -1,6 +0,0 @@
1
- import { Serialized } from "../../../../utils";
2
- import { ListItemData } from "../../models";
3
-
4
- export interface GetListItemsResponse {
5
- listItems: Serialized<ListItemData>[];
6
- }
@@ -1,6 +0,0 @@
1
- import { Serialized } from "../../../../utils";
2
- import { ListData } from "../../models";
3
-
4
- export interface GetListsResponse {
5
- lists: Serialized<ListData>[];
6
- }
@@ -1,7 +0,0 @@
1
- export * from './complete-list-item-types';
2
- export * from './create-list-item-types';
3
- export * from './get-list-item-types';
4
- export * from './update-list-item-types';
5
- export * from './create-list-types';
6
- export * from './update-list-types';
7
- export * from './get-lists-types';
@@ -1,17 +0,0 @@
1
- import { z } from 'zod';
2
- import { listIdSchema } from '../../../id-types';
3
- import { Serialized } from "../../../../utils";
4
- import { ListItemData } from "../../models";
5
-
6
- export const updateListItemRequestSchema = z.object({
7
- name: z.string().min(1).optional(),
8
- notes: z.string().nullish(),
9
- completed: z.boolean().optional(),
10
- listId: listIdSchema.optional()
11
- });
12
-
13
- export type UpdateListItemRequest = z.infer<typeof updateListItemRequestSchema>;
14
-
15
- export interface UpdateListItemResponse {
16
- listItem: Serialized<ListItemData>;
17
- }
@@ -1,14 +0,0 @@
1
- import { z } from 'zod';
2
- import { Serialized } from "../../../../utils";
3
- import { ListData, ListType } from "../../models";
4
-
5
- export const updateListRequestSchema = z.object({
6
- name: z.string().min(1).optional(),
7
- type: z.nativeEnum(ListType).optional()
8
- });
9
-
10
- export type UpdateListRequest = z.infer<typeof updateListRequestSchema>;
11
-
12
- export interface UpdateListResponse {
13
- list: Serialized<ListData>;
14
- }
@@ -1 +0,0 @@
1
- export * from './version-types'
@@ -1,10 +0,0 @@
1
- export interface VersionQuery {
2
- iOSBuildVersion?: number;
3
- androidBuildVersion?: number;
4
- }
5
-
6
- export interface VersionResponse {
7
- minIOSBuildVersion: number;
8
- minAndroidBuildVersion: number;
9
- updateRequired: boolean;
10
- }
@@ -1,30 +0,0 @@
1
- import { z } from "zod";
2
- import { Serialized } from "../../../../utils";
3
- import { NotificationTemplateData, CreateNotificationTemplateData, notificationEntityTypeSchema, notificationTriggerTypeSchema } from "../../models/notification-template-data";
4
-
5
- // Request schema
6
- export const createNotificationTemplateRequestSchema = z.object({
7
- entityType: notificationEntityTypeSchema,
8
- entityId: z.string().optional(),
9
- name: z.string().min(1).max(100),
10
- description: z.string().max(500).optional(),
11
- trigger: z.object({
12
- type: notificationTriggerTypeSchema,
13
- conditions: z.record(z.any()),
14
- timing: z.record(z.any())
15
- }),
16
- content: z.object({
17
- title: z.string().min(1).max(200),
18
- body: z.string().min(1).max(1000),
19
- variables: z.record(z.string()).optional()
20
- }),
21
- active: z.boolean().default(true),
22
- inheritedFrom: z.string().optional(),
23
- customized: z.boolean().default(false)
24
- });
25
-
26
- export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
27
-
28
- export interface CreateNotificationTemplateResponse {
29
- template: Serialized<NotificationTemplateData>;
30
- }
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
-
3
- // Request schema - no body needed for DELETE
4
- export const deleteNotificationTemplateRequestSchema = z.object({});
5
-
6
- export type DeleteNotificationTemplateRequest = z.infer<typeof deleteNotificationTemplateRequestSchema>;
7
-
8
- export interface DeleteNotificationTemplateResponse {}
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
- import { Serialized } from "../../../../utils";
3
- import { NotificationTemplateData } from "../../models/notification-template-data";
4
-
5
- // Request schema - no body needed for GET
6
- export const getNotificationTemplatesRequestSchema = z.object({});
7
-
8
- export type GetNotificationTemplatesRequest = z.infer<typeof getNotificationTemplatesRequestSchema>;
9
-
10
- export interface GetNotificationTemplatesResponse {
11
- templates: Serialized<NotificationTemplateData>[];
12
- }
@@ -1,6 +0,0 @@
1
- export * from './get-notification-templates-types';
2
- export * from './create-notification-template-types';
3
- export * from './update-notification-template-types';
4
- export * from './delete-notification-template-types';
5
- export * from './preview-notification-template-types';
6
- export * from './sync-notification-template-types';
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
-
3
- // Request schema
4
- export const previewNotificationTemplateRequestSchema = z.object({
5
- templateTitle: z.string(),
6
- templateBody: z.string(),
7
- entityType: z.string(),
8
- entityId: z.string(),
9
- variables: z.record(z.any()).optional()
10
- });
11
-
12
- export type PreviewNotificationTemplateRequest = z.infer<typeof previewNotificationTemplateRequestSchema>;
13
-
14
- export interface PreviewNotificationTemplateResponse {
15
- preview: {
16
- title: string;
17
- body: string;
18
- variables: Record<string, any>;
19
- };
20
- missingVariables: string[];
21
- }
@@ -1,14 +0,0 @@
1
- import { z } from "zod";
2
- import { Serialized } from "../../../../utils";
3
- import { NotificationTemplateData } from "../../models/notification-template-data";
4
-
5
- // Request schema
6
- export const syncNotificationTemplateRequestSchema = z.object({
7
- sync: z.boolean() // true to sync with parent, false to unsync
8
- });
9
-
10
- export type SyncNotificationTemplateRequest = z.infer<typeof syncNotificationTemplateRequestSchema>;
11
-
12
- export interface SyncNotificationTemplateResponse {
13
- template: Serialized<NotificationTemplateData>;
14
- }
@@ -1,30 +0,0 @@
1
- import { z } from "zod";
2
- import { Serialized } from "../../../../utils";
3
- import {
4
- NotificationTemplateData,
5
- notificationTriggerTypeSchema
6
- } from "../../models";
7
-
8
- // Request schema
9
- export const updateNotificationTemplateRequestSchema = z.object({
10
- name: z.string().optional(),
11
- description: z.string().optional(),
12
- trigger: z.object({
13
- type: notificationTriggerTypeSchema,
14
- conditions: z.record(z.any()),
15
- timing: z.record(z.any())
16
- }).optional(),
17
- content: z.object({
18
- title: z.string(),
19
- body: z.string(),
20
- variables: z.record(z.string()).optional()
21
- }).optional(),
22
- active: z.boolean().optional(),
23
- customized: z.boolean().optional()
24
- });
25
-
26
- export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
27
-
28
- export interface UpdateNotificationTemplateResponse {
29
- template: Serialized<NotificationTemplateData>;
30
- }
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- import { personIdSchema } from "../../../id-types";
3
- import { PersonNoteData } from "../../models";
4
- import { Serialized } from "../../../../utils";
5
-
6
- export const createPersonNoteRequestSchema = z.object({
7
- personId: personIdSchema,
8
- content: z.string().min(1)
9
- });
10
-
11
- export type CreatePersonNoteRequest = z.infer<typeof createPersonNoteRequestSchema>;
12
-
13
- export interface CreatePersonNoteResponse {
14
- personNote: Serialized<PersonNoteData>;
15
- }
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- import { personNoteIdSchema } from "../../../id-types";
3
- import { Person } from "../../models";
4
- import { Serialized } from "../../../../utils";
5
-
6
- export const createPersonRequestSchema = z.object({
7
- name: z.string().min(1),
8
- properties: z.array(z.object({
9
- key: z.string().min(1),
10
- value: z.string().min(1)
11
- })).optional(),
12
- notes: z.array(personNoteIdSchema).optional()
13
- });
14
-
15
- export type CreatePersonRequest = z.infer<typeof createPersonRequestSchema>;
16
-
17
- export interface CreatePersonResponse {
18
- person: Serialized<Person>;
19
- }
@@ -1,3 +0,0 @@
1
- export interface DeletePersonNoteResponse {
2
- success: boolean;
3
- }
@@ -1,3 +0,0 @@
1
- export interface DeletePersonResponse {
2
- deleted: boolean;
3
- }
@@ -1,6 +0,0 @@
1
- import { Person } from "../../models";
2
- import { Serialized } from "../../../../utils";
3
-
4
- export interface GetPeopleResponse {
5
- people: Serialized<Person>[];
6
- }
@@ -1,6 +0,0 @@
1
- import { PersonNoteData } from "../../models";
2
- import { Serialized } from "../../../../utils";
3
-
4
- export interface GetPersonNotesResponse {
5
- personNotes: Serialized<PersonNoteData>[];
6
- }
@@ -1,8 +0,0 @@
1
- export * from './create-person-note-types';
2
- export * from './create-person-types';
3
- export * from './delete-person-notes-types';
4
- export * from './delete-person-types';
5
- export * from './get-people-types';
6
- export * from './get-person-notes-types';
7
- export * from './update-person-note-types';
8
- export * from './update-person-types';
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
- import { PersonNoteData } from "../../models";
3
- import { Serialized } from "../../../../utils";
4
-
5
- export const updatePersonNoteRequestSchema = z.object({
6
- content: z.string().min(1)
7
- });
8
-
9
- export type UpdatePersonNoteRequest = z.infer<typeof updatePersonNoteRequestSchema>;
10
-
11
- export interface UpdatePersonNoteResponse {
12
- personNote: Serialized<PersonNoteData>;
13
- }
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- import { personNoteIdSchema } from "../../../id-types";
3
- import { Person } from "../../models";
4
- import { Serialized } from "../../../../utils";
5
-
6
- export const updatePersonRequestSchema = z.object({
7
- name: z.string().min(1).optional(),
8
- properties: z.array(z.object({
9
- key: z.string().min(1),
10
- value: z.string().min(1)
11
- })).optional(),
12
- noteIds: z.array(personNoteIdSchema).optional()
13
- });
14
-
15
- export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;
16
-
17
- export interface UpdatePersonResponse {
18
- person: Serialized<Person>;
19
- }
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
- import { Serialized } from "../../../../utils";
3
- import { ThoughtData } from "../../models";
4
-
5
- export const createThoughtRequestSchema = z.object({
6
- content: z.string().min(1)
7
- });
8
-
9
- export type CreateThoughtRequest = z.infer<typeof createThoughtRequestSchema>;
10
-
11
- export interface CreateThoughtResponse {
12
- thought: Serialized<ThoughtData>;
13
- }
@@ -1,3 +0,0 @@
1
- export interface DeleteThoughtResponse {
2
- deleted: boolean;
3
- }
@@ -1,6 +0,0 @@
1
- import { Serialized } from "../../../../utils";
2
- import { ThoughtData } from "../../models";
3
-
4
- export interface GetThoughtsResponse {
5
- thoughts: Serialized<ThoughtData>[];
6
- }
@@ -1,4 +0,0 @@
1
- export * from './create-thought-types';
2
- export * from './delete-thought-types';
3
- export * from './get-thoughts-types';
4
- export * from './update-thought-types';
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
- import { Serialized } from "../../../../utils";
3
- import { ThoughtData } from "../../models";
4
-
5
- export const updateThoughtRequestSchema = z.object({
6
- content: z.string().min(1)
7
- });
8
-
9
- export type UpdateThoughtRequest = z.infer<typeof updateThoughtRequestSchema>;
10
-
11
- export interface UpdateThoughtResponse {
12
- thought: Serialized<ThoughtData>;
13
- }
@@ -1,13 +0,0 @@
1
- export interface AuthTokens {
2
- accessToken: string;
3
- refreshToken: string;
4
- }
5
-
6
- export interface TokenPayload {
7
- authId: string;
8
- userId: string;
9
- }
10
-
11
- export interface RefreshTokenPayload extends TokenPayload {
12
- tokenId: string;
13
- }
@@ -1,21 +0,0 @@
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
- }