@timothyw/pat-common 1.0.112 → 1.0.115

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 (262) hide show
  1. package/dist/types/api/notifications/create-notification-template-types.d.ts +3 -18
  2. package/dist/types/api/notifications/create-notification-template-types.js +1 -7
  3. package/dist/types/api/notifications/delete-notification-template-types.d.ts +2 -11
  4. package/dist/types/api/notifications/delete-notification-template-types.js +1 -6
  5. package/dist/types/api/notifications/get-notification-templates-types.d.ts +3 -18
  6. package/dist/types/api/notifications/get-notification-templates-types.js +1 -7
  7. package/dist/types/api/notifications/preview-notification-template-types.d.ts +5 -34
  8. package/dist/types/api/notifications/preview-notification-template-types.js +1 -12
  9. package/dist/types/api/notifications/sync-notification-template-types.d.ts +3 -18
  10. package/dist/types/api/notifications/sync-notification-template-types.js +1 -7
  11. package/dist/types/api/notifications/update-notification-template-types.d.ts +3 -146
  12. package/dist/types/api/notifications/update-notification-template-types.js +1 -4
  13. package/dist/types/id-types.d.ts +2 -2
  14. package/dist/types/index.d.ts +1 -3
  15. package/dist/types/index.js +4 -3
  16. package/dist/types/new/agenda-types.d.ts +116 -0
  17. package/dist/types/new/agenda-types.js +37 -0
  18. package/dist/types/new/auth-types.d.ts +153 -0
  19. package/dist/types/new/auth-types.js +48 -0
  20. package/dist/types/new/habits-types.d.ts +317 -0
  21. package/dist/types/new/habits-types.js +70 -0
  22. package/dist/types/new/index.d.ts +10 -0
  23. package/dist/types/new/index.js +26 -0
  24. package/dist/types/new/lists-types.d.ts +164 -0
  25. package/dist/types/new/lists-types.js +50 -0
  26. package/dist/types/new/misc/index.d.ts +1 -0
  27. package/dist/types/new/misc/index.js +17 -0
  28. package/dist/types/new/misc/version-types.d.ts +26 -0
  29. package/dist/types/new/misc/version-types.js +13 -0
  30. package/dist/types/new/notifications-types.d.ts +407 -0
  31. package/dist/types/new/notifications-types.js +91 -0
  32. package/dist/types/new/people-types.d.ts +285 -0
  33. package/dist/types/new/people-types.js +58 -0
  34. package/dist/types/new/program-config-types.d.ts +105 -0
  35. package/dist/types/new/program-config-types.js +29 -0
  36. package/dist/types/new/thoughts-types.d.ts +57 -0
  37. package/dist/types/new/thoughts-types.js +18 -0
  38. package/dist/types/new/user-types.d.ts +283 -0
  39. package/dist/types/new/user-types.js +46 -0
  40. package/dist/types/old/api/account/get-user-types.d.ts +5 -0
  41. package/dist/types/old/api/account/get-user-types.js +2 -0
  42. package/dist/types/old/api/account/index.d.ts +2 -0
  43. package/dist/types/old/api/account/index.js +18 -0
  44. package/dist/types/old/api/account/update-user-types.d.ts +128 -0
  45. package/dist/types/old/api/account/update-user-types.js +8 -0
  46. package/dist/types/old/api/auth/create-account-types.d.ts +24 -0
  47. package/dist/types/old/api/auth/create-account-types.js +10 -0
  48. package/dist/types/old/api/auth/index.d.ts +5 -0
  49. package/dist/types/old/api/auth/index.js +21 -0
  50. package/dist/types/old/api/auth/refresh-auth-types.d.ts +15 -0
  51. package/dist/types/old/api/auth/refresh-auth-types.js +7 -0
  52. package/dist/types/old/api/auth/resend-verification-types.d.ts +3 -0
  53. package/dist/types/old/api/auth/resend-verification-types.js +2 -0
  54. package/dist/types/old/api/auth/sign-in-types.d.ts +19 -0
  55. package/dist/types/old/api/auth/sign-in-types.js +8 -0
  56. package/dist/types/old/api/auth/verify-email-types.d.ts +3 -0
  57. package/dist/types/old/api/auth/verify-email-types.js +2 -0
  58. package/dist/types/old/api/habits/create-habit-entry-types.d.ts +19 -0
  59. package/dist/types/old/api/habits/create-habit-entry-types.js +10 -0
  60. package/dist/types/old/api/habits/create-habit-types.d.ts +26 -0
  61. package/dist/types/old/api/habits/create-habit-types.js +12 -0
  62. package/dist/types/old/api/habits/delete-habit-entry-types.d.ts +5 -0
  63. package/dist/types/old/api/habits/delete-habit-entry-types.js +2 -0
  64. package/dist/types/old/api/habits/delete-habit-types.d.ts +3 -0
  65. package/dist/types/old/api/habits/delete-habit-types.js +2 -0
  66. package/dist/types/old/api/habits/get-habits-types.d.ts +5 -0
  67. package/dist/types/old/api/habits/get-habits-types.js +2 -0
  68. package/dist/types/old/api/habits/index.d.ts +6 -0
  69. package/dist/types/old/api/habits/index.js +22 -0
  70. package/dist/types/old/api/habits/update-habit-types.d.ts +26 -0
  71. package/dist/types/old/api/habits/update-habit-types.js +12 -0
  72. package/dist/types/old/api/index.d.ts +9 -0
  73. package/dist/types/old/api/index.js +25 -0
  74. package/dist/types/old/api/items/complete-item-types.d.ts +14 -0
  75. package/dist/types/old/api/items/complete-item-types.js +7 -0
  76. package/dist/types/old/api/items/create-item-types.d.ts +29 -0
  77. package/dist/types/old/api/items/create-item-types.js +12 -0
  78. package/dist/types/old/api/items/delete-item-types.d.ts +3 -0
  79. package/dist/types/old/api/items/delete-item-types.js +2 -0
  80. package/dist/types/old/api/items/get-items-types.d.ts +5 -0
  81. package/dist/types/old/api/items/get-items-types.js +2 -0
  82. package/dist/types/old/api/items/index.d.ts +5 -0
  83. package/dist/types/old/api/items/index.js +21 -0
  84. package/dist/types/old/api/items/update-item-types.d.ts +29 -0
  85. package/dist/types/old/api/items/update-item-types.js +12 -0
  86. package/dist/types/old/api/lists/complete-list-item-types.d.ts +14 -0
  87. package/dist/types/old/api/lists/complete-list-item-types.js +7 -0
  88. package/dist/types/old/api/lists/create-list-item-types.d.ts +22 -0
  89. package/dist/types/old/api/lists/create-list-item-types.js +10 -0
  90. package/dist/types/old/api/lists/create-list-types.d.ts +17 -0
  91. package/dist/types/old/api/lists/create-list-types.js +9 -0
  92. package/dist/types/old/api/lists/get-list-item-types.d.ts +5 -0
  93. package/dist/types/old/api/lists/get-list-item-types.js +2 -0
  94. package/dist/types/old/api/lists/get-lists-types.d.ts +5 -0
  95. package/dist/types/old/api/lists/get-lists-types.js +2 -0
  96. package/dist/types/old/api/lists/index.d.ts +7 -0
  97. package/dist/types/old/api/lists/index.js +23 -0
  98. package/dist/types/old/api/lists/update-list-item-types.d.ts +23 -0
  99. package/dist/types/old/api/lists/update-list-item-types.js +11 -0
  100. package/dist/types/old/api/lists/update-list-types.d.ts +17 -0
  101. package/dist/types/old/api/lists/update-list-types.js +9 -0
  102. package/dist/types/old/api/misc/index.d.ts +1 -0
  103. package/dist/types/old/api/misc/index.js +17 -0
  104. package/dist/types/old/api/misc/version-types.d.ts +9 -0
  105. package/dist/types/old/api/misc/version-types.js +2 -0
  106. package/dist/types/old/api/notifications/create-notification-template-types.d.ts +78 -0
  107. package/dist/types/old/api/notifications/create-notification-template-types.js +25 -0
  108. package/dist/types/old/api/notifications/delete-notification-template-types.d.ts +5 -0
  109. package/dist/types/old/api/notifications/delete-notification-template-types.js +6 -0
  110. package/dist/types/old/api/notifications/get-notification-templates-types.d.ts +8 -0
  111. package/dist/types/old/api/notifications/get-notification-templates-types.js +6 -0
  112. package/dist/types/old/api/notifications/index.d.ts +6 -0
  113. package/dist/types/old/api/notifications/index.js +22 -0
  114. package/dist/types/old/api/notifications/preview-notification-template-types.d.ts +29 -0
  115. package/dist/types/old/api/notifications/preview-notification-template-types.js +12 -0
  116. package/dist/types/old/api/notifications/sync-notification-template-types.d.ts +14 -0
  117. package/dist/types/old/api/notifications/sync-notification-template-types.js +8 -0
  118. package/dist/types/old/api/notifications/update-notification-template-types.d.ts +69 -0
  119. package/dist/types/old/api/notifications/update-notification-template-types.js +22 -0
  120. package/dist/types/old/api/people/create-person-note-types.d.ts +19 -0
  121. package/dist/types/old/api/people/create-person-note-types.js +9 -0
  122. package/dist/types/old/api/people/create-person-types.d.ts +35 -0
  123. package/dist/types/old/api/people/create-person-types.js +13 -0
  124. package/dist/types/old/api/people/delete-person-notes-types.d.ts +3 -0
  125. package/dist/types/old/api/people/delete-person-notes-types.js +2 -0
  126. package/dist/types/old/api/people/delete-person-types.d.ts +3 -0
  127. package/dist/types/old/api/people/delete-person-types.js +2 -0
  128. package/dist/types/old/api/people/get-people-types.d.ts +5 -0
  129. package/dist/types/old/api/people/get-people-types.js +2 -0
  130. package/dist/types/old/api/people/get-person-notes-types.d.ts +5 -0
  131. package/dist/types/old/api/people/get-person-notes-types.js +2 -0
  132. package/dist/types/old/api/people/index.d.ts +8 -0
  133. package/dist/types/old/api/people/index.js +24 -0
  134. package/dist/types/old/api/people/update-person-note-types.d.ts +14 -0
  135. package/dist/types/old/api/people/update-person-note-types.js +7 -0
  136. package/dist/types/old/api/people/update-person-types.d.ts +35 -0
  137. package/dist/types/old/api/people/update-person-types.js +13 -0
  138. package/dist/types/old/api/thoughts/create-thought-types.d.ts +14 -0
  139. package/dist/types/old/api/thoughts/create-thought-types.js +7 -0
  140. package/dist/types/old/api/thoughts/delete-thought-types.d.ts +3 -0
  141. package/dist/types/old/api/thoughts/delete-thought-types.js +2 -0
  142. package/dist/types/old/api/thoughts/get-thoughts-types.d.ts +5 -0
  143. package/dist/types/old/api/thoughts/get-thoughts-types.js +2 -0
  144. package/dist/types/old/api/thoughts/index.d.ts +4 -0
  145. package/dist/types/old/api/thoughts/index.js +20 -0
  146. package/dist/types/old/api/thoughts/update-thought-types.d.ts +14 -0
  147. package/dist/types/old/api/thoughts/update-thought-types.js +7 -0
  148. package/dist/types/old/auth-tokens.d.ts +11 -0
  149. package/dist/types/old/auth-tokens.js +2 -0
  150. package/dist/types/old/models/auth-data.d.ts +14 -0
  151. package/dist/types/old/models/auth-data.js +9 -0
  152. package/dist/types/old/models/habit-data.d.ts +48 -0
  153. package/dist/types/old/models/habit-data.js +25 -0
  154. package/dist/types/old/models/index.d.ts +10 -0
  155. package/dist/types/old/models/index.js +26 -0
  156. package/dist/types/old/models/item-data.d.ts +14 -0
  157. package/dist/types/old/models/item-data.js +2 -0
  158. package/dist/types/old/models/list-data.d.ts +23 -0
  159. package/dist/types/old/models/list-data.js +8 -0
  160. package/dist/types/old/models/notifiable.d.ts +42 -0
  161. package/dist/types/old/models/notifiable.js +2 -0
  162. package/dist/types/old/models/notification-template-data.d.ts +224 -0
  163. package/dist/types/old/models/notification-template-data.js +52 -0
  164. package/dist/types/old/models/person-data.d.ts +31 -0
  165. package/dist/types/old/models/person-data.js +2 -0
  166. package/dist/types/old/models/program-config.d.ts +25 -0
  167. package/dist/types/old/models/program-config.js +2 -0
  168. package/dist/types/old/models/thought-data.d.ts +8 -0
  169. package/dist/types/old/models/thought-data.js +2 -0
  170. package/dist/types/old/models/user-data.d.ts +147 -0
  171. package/dist/types/old/models/user-data.js +42 -0
  172. package/dist/utils/index.d.ts +1 -0
  173. package/dist/utils/index.js +1 -0
  174. package/dist/utils/type-helpers.d.ts +4 -0
  175. package/dist/utils/type-helpers.js +19 -0
  176. package/package.json +1 -1
  177. package/src/types/id-types.ts +2 -2
  178. package/src/types/index.ts +4 -3
  179. package/src/types/new/agenda-types.ts +69 -0
  180. package/src/types/new/auth-types.ts +92 -0
  181. package/src/types/new/habits-types.ts +112 -0
  182. package/src/types/new/index.ts +10 -0
  183. package/src/types/new/lists-types.ts +108 -0
  184. package/src/types/new/misc/index.ts +1 -0
  185. package/src/types/new/misc/version-types.ts +15 -0
  186. package/src/types/new/notifications-types.ts +144 -0
  187. package/src/types/new/people-types.ts +110 -0
  188. package/src/types/new/program-config-types.ts +29 -0
  189. package/src/types/new/thoughts-types.ts +44 -0
  190. package/src/types/new/user-types.ts +61 -0
  191. package/src/types/{api → old/api}/account/get-user-types.ts +1 -1
  192. package/src/types/{api → old/api}/account/update-user-types.ts +1 -1
  193. package/src/types/{api → old/api}/auth/create-account-types.ts +1 -1
  194. package/src/types/{api → old/api}/habits/create-habit-entry-types.ts +2 -2
  195. package/src/types/{api → old/api}/habits/create-habit-types.ts +1 -1
  196. package/src/types/{api → old/api}/habits/delete-habit-entry-types.ts +1 -1
  197. package/src/types/{api → old/api}/habits/get-habits-types.ts +1 -1
  198. package/src/types/{api → old/api}/habits/update-habit-types.ts +1 -1
  199. package/src/types/{api → old/api}/items/complete-item-types.ts +1 -1
  200. package/src/types/{api → old/api}/items/create-item-types.ts +1 -1
  201. package/src/types/{api → old/api}/items/get-items-types.ts +1 -1
  202. package/src/types/{api → old/api}/items/update-item-types.ts +1 -1
  203. package/src/types/{api → old/api}/lists/complete-list-item-types.ts +1 -1
  204. package/src/types/{api → old/api}/lists/create-list-item-types.ts +2 -2
  205. package/src/types/{api → old/api}/lists/create-list-types.ts +1 -1
  206. package/src/types/{api → old/api}/lists/get-list-item-types.ts +1 -1
  207. package/src/types/{api → old/api}/lists/get-lists-types.ts +1 -1
  208. package/src/types/{api → old/api}/lists/update-list-item-types.ts +2 -2
  209. package/src/types/{api → old/api}/lists/update-list-types.ts +1 -1
  210. package/src/types/{api → old/api}/notifications/create-notification-template-types.ts +4 -13
  211. package/src/types/old/api/notifications/delete-notification-template-types.ts +8 -0
  212. package/src/types/old/api/notifications/get-notification-templates-types.ts +12 -0
  213. package/src/types/old/api/notifications/preview-notification-template-types.ts +21 -0
  214. package/src/types/old/api/notifications/sync-notification-template-types.ts +14 -0
  215. package/src/types/{api → old/api}/notifications/update-notification-template-types.ts +5 -12
  216. package/src/types/{api → old/api}/people/create-person-note-types.ts +2 -2
  217. package/src/types/{api → old/api}/people/create-person-types.ts +2 -2
  218. package/src/types/{api → old/api}/people/get-people-types.ts +1 -1
  219. package/src/types/{api → old/api}/people/get-person-notes-types.ts +1 -1
  220. package/src/types/{api → old/api}/people/update-person-note-types.ts +1 -1
  221. package/src/types/{api → old/api}/people/update-person-types.ts +2 -2
  222. package/src/types/{api → old/api}/thoughts/create-thought-types.ts +1 -1
  223. package/src/types/{api → old/api}/thoughts/get-thoughts-types.ts +1 -1
  224. package/src/types/{api → old/api}/thoughts/update-thought-types.ts +1 -1
  225. package/src/types/{models → old/models}/auth-data.ts +1 -1
  226. package/src/types/{models → old/models}/habit-data.ts +2 -2
  227. package/src/types/{models → old/models}/item-data.ts +1 -1
  228. package/src/types/{models → old/models}/list-data.ts +1 -1
  229. package/src/types/{models → old/models}/notification-template-data.ts +1 -1
  230. package/src/types/{models → old/models}/person-data.ts +1 -1
  231. package/src/types/{models → old/models}/thought-data.ts +1 -1
  232. package/src/types/{models → old/models}/user-data.ts +2 -2
  233. package/src/utils/index.ts +2 -1
  234. package/src/utils/type-helpers.ts +19 -0
  235. package/src/types/api/notifications/delete-notification-template-types.ts +0 -14
  236. package/src/types/api/notifications/get-notification-templates-types.ts +0 -21
  237. package/src/types/api/notifications/preview-notification-template-types.ts +0 -26
  238. package/src/types/api/notifications/sync-notification-template-types.ts +0 -23
  239. /package/src/types/{api → old/api}/account/index.ts +0 -0
  240. /package/src/types/{api → old/api}/auth/index.ts +0 -0
  241. /package/src/types/{api → old/api}/auth/refresh-auth-types.ts +0 -0
  242. /package/src/types/{api → old/api}/auth/resend-verification-types.ts +0 -0
  243. /package/src/types/{api → old/api}/auth/sign-in-types.ts +0 -0
  244. /package/src/types/{api → old/api}/auth/verify-email-types.ts +0 -0
  245. /package/src/types/{api → old/api}/habits/delete-habit-types.ts +0 -0
  246. /package/src/types/{api → old/api}/habits/index.ts +0 -0
  247. /package/src/types/{api → old/api}/index.ts +0 -0
  248. /package/src/types/{api → old/api}/items/delete-item-types.ts +0 -0
  249. /package/src/types/{api → old/api}/items/index.ts +0 -0
  250. /package/src/types/{api → old/api}/lists/index.ts +0 -0
  251. /package/src/types/{api → old/api}/misc/index.ts +0 -0
  252. /package/src/types/{api → old/api}/misc/version-types.ts +0 -0
  253. /package/src/types/{api → old/api}/notifications/index.ts +0 -0
  254. /package/src/types/{api → old/api}/people/delete-person-notes-types.ts +0 -0
  255. /package/src/types/{api → old/api}/people/delete-person-types.ts +0 -0
  256. /package/src/types/{api → old/api}/people/index.ts +0 -0
  257. /package/src/types/{api → old/api}/thoughts/delete-thought-types.ts +0 -0
  258. /package/src/types/{api → old/api}/thoughts/index.ts +0 -0
  259. /package/src/types/{auth-tokens.ts → old/auth-tokens.ts} +0 -0
  260. /package/src/types/{models → old/models}/index.ts +0 -0
  261. /package/src/types/{models → old/models}/notifiable.ts +0 -0
  262. /package/src/types/{models → old/models}/program-config.ts +0 -0
@@ -1,9 +1,8 @@
1
1
  import { z } from "zod";
2
- import { Serialized } from "../../../utils";
2
+ import { Serialized } from "../../../../utils";
3
3
  import {
4
4
  NotificationTemplateData,
5
- notificationTriggerTypeSchema,
6
- notificationTemplateDataSchema
5
+ notificationTriggerTypeSchema
7
6
  } from "../../models";
8
7
 
9
8
  // Request schema
@@ -26,12 +25,6 @@ export const updateNotificationTemplateRequestSchema = z.object({
26
25
 
27
26
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
28
27
 
29
- export const updateNotificationTemplateResponseSchema = z.object({
30
- template: notificationTemplateDataSchema,
31
- });
32
-
33
- export type UpdateNotificationTemplateResponse = {
34
- success: boolean;
35
- template?: Serialized<NotificationTemplateData>;
36
- error?: string;
37
- };
28
+ export interface UpdateNotificationTemplateResponse {
29
+ template: Serialized<NotificationTemplateData>;
30
+ }
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { personIdSchema } from "../../id-types";
2
+ import { personIdSchema } from "../../../id-types";
3
3
  import { PersonNoteData } from "../../models";
4
- import { Serialized } from "../../../utils";
4
+ import { Serialized } from "../../../../utils";
5
5
 
6
6
  export const createPersonNoteRequestSchema = z.object({
7
7
  personId: personIdSchema,
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { personNoteIdSchema } from "../../id-types";
2
+ import { personNoteIdSchema } from "../../../id-types";
3
3
  import { Person } from "../../models";
4
- import { Serialized } from "../../../utils";
4
+ import { Serialized } from "../../../../utils";
5
5
 
6
6
  export const createPersonRequestSchema = z.object({
7
7
  name: z.string().min(1),
@@ -1,5 +1,5 @@
1
1
  import { Person } from "../../models";
2
- import { Serialized } from "../../../utils";
2
+ import { Serialized } from "../../../../utils";
3
3
 
4
4
  export interface GetPeopleResponse {
5
5
  people: Serialized<Person>[];
@@ -1,5 +1,5 @@
1
1
  import { PersonNoteData } from "../../models";
2
- import { Serialized } from "../../../utils";
2
+ import { Serialized } from "../../../../utils";
3
3
 
4
4
  export interface GetPersonNotesResponse {
5
5
  personNotes: Serialized<PersonNoteData>[];
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { PersonNoteData } from "../../models";
3
- import { Serialized } from "../../../utils";
3
+ import { Serialized } from "../../../../utils";
4
4
 
5
5
  export const updatePersonNoteRequestSchema = z.object({
6
6
  content: z.string().min(1)
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { personNoteIdSchema } from "../../id-types";
2
+ import { personNoteIdSchema } from "../../../id-types";
3
3
  import { Person } from "../../models";
4
- import { Serialized } from "../../../utils";
4
+ import { Serialized } from "../../../../utils";
5
5
 
6
6
  export const updatePersonRequestSchema = z.object({
7
7
  name: z.string().min(1).optional(),
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Serialized } from "../../../utils";
2
+ import { Serialized } from "../../../../utils";
3
3
  import { ThoughtData } from "../../models";
4
4
 
5
5
  export const createThoughtRequestSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { Serialized } from "../../../utils";
1
+ import { Serialized } from "../../../../utils";
2
2
  import { ThoughtData } from "../../models";
3
3
 
4
4
  export interface GetThoughtsResponse {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Serialized } from "../../../utils";
2
+ import { Serialized } from "../../../../utils";
3
3
  import { ThoughtData } from "../../models";
4
4
 
5
5
  export const updateThoughtRequestSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { AuthId, UserId } from "../id-types";
1
+ import { AuthId, UserId } from "../../id-types";
2
2
 
3
3
  export interface AuthData {
4
4
  _id: AuthId;
@@ -1,5 +1,5 @@
1
- import { DateOnlyString } from "../misc-types";
2
- import { HabitEntryId, HabitId, UserId } from "../id-types";
1
+ import { DateOnlyString } from "../../misc-types";
2
+ import { HabitEntryId, HabitId, UserId } from "../../id-types";
3
3
 
4
4
  export enum HabitFrequency {
5
5
  DAILY = 'daily',
@@ -1,4 +1,4 @@
1
- import { ItemId, UserId } from "../id-types";
1
+ import { ItemId, UserId } from "../../id-types";
2
2
 
3
3
  export interface ItemData {
4
4
  _id: ItemId;
@@ -1,4 +1,4 @@
1
- import { ListItemId, ListId, UserId } from "../id-types";
1
+ import { ListItemId, ListId, UserId } from "../../id-types";
2
2
 
3
3
  export enum ListType {
4
4
  TASKS = 'tasks',
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { NotificationTemplateId, UserId } from "../id-types";
2
+ import { NotificationTemplateId, UserId } from "../../id-types";
3
3
 
4
4
  export const notificationEntityTypeSchema = z.enum([
5
5
  // Individual entity types (notifications FOR the entity itself)
@@ -1,4 +1,4 @@
1
- import { PersonId, PersonNoteId, UserId } from "../id-types";
1
+ import { PersonId, PersonNoteId, UserId } from "../../id-types";
2
2
 
3
3
  export interface PersonProperty {
4
4
  key: string;
@@ -1,4 +1,4 @@
1
- import { ThoughtId, UserId } from "../id-types";
1
+ import { ThoughtId, UserId } from "../../id-types";
2
2
 
3
3
  export interface ThoughtData {
4
4
  _id: ThoughtId;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { userIdSchema } from "../id-types";
3
- import { ModuleType } from "../../enums";
2
+ import { userIdSchema } from "../../id-types";
3
+ import { ModuleType } from "../../../enums";
4
4
 
5
5
  const moduleSchema = z.object({
6
6
  type: z.nativeEnum(ModuleType),
@@ -1,2 +1,3 @@
1
1
  export * from './date-utils'
2
- export * from './serializing-utils'
2
+ export * from './serializing-utils'
3
+ export * from './type-helpers'
@@ -0,0 +1,19 @@
1
+ import { AuthData, PublicAuthData } from '../types';
2
+ import { HabitData, HabitEntryData, HabitStats, Habit } from '../types';
3
+
4
+ // export type PublicAuthData = Pick<AuthData, 'email' | 'emailVerified'> & { readonly __brand: unique symbol };
5
+
6
+ export function toPublicAuthData(data: AuthData): PublicAuthData {
7
+ return {
8
+ email: data.email,
9
+ emailVerified: data.emailVerified
10
+ } as PublicAuthData;
11
+ }
12
+
13
+ export const toHabit = (data: HabitData, entries: HabitEntryData[], stats: HabitStats): Habit => {
14
+ return {
15
+ ...data,
16
+ entries,
17
+ stats
18
+ };
19
+ };
@@ -1,14 +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
- // Response schema
9
- export const deleteNotificationTemplateResponseSchema = z.object({
10
- success: z.boolean(),
11
- error: z.string().optional()
12
- });
13
-
14
- export type DeleteNotificationTemplateResponse = z.infer<typeof deleteNotificationTemplateResponseSchema>;
@@ -1,21 +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
- // Response schema
11
- export const getNotificationTemplatesResponseSchema = z.object({
12
- success: z.boolean(),
13
- templates: z.array(z.any()).optional(), // Will be Serialized<NotificationTemplateData>[]
14
- error: z.string().optional()
15
- });
16
-
17
- export type GetNotificationTemplatesResponse = {
18
- success: boolean;
19
- templates?: Serialized<NotificationTemplateData>[];
20
- error?: string;
21
- };
@@ -1,26 +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
- // Response schema
15
- export const previewNotificationTemplateResponseSchema = z.object({
16
- success: z.boolean(),
17
- preview: z.object({
18
- title: z.string(),
19
- body: z.string(),
20
- variables: z.record(z.any())
21
- }).optional(),
22
- missingVariables: z.array(z.string()).optional(),
23
- error: z.string().optional()
24
- });
25
-
26
- export type PreviewNotificationTemplateResponse = z.infer<typeof previewNotificationTemplateResponseSchema>;
@@ -1,23 +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
- // Response schema
13
- export const syncNotificationTemplateResponseSchema = z.object({
14
- success: z.boolean(),
15
- template: z.any().optional(), // Will be Serialized<NotificationTemplateData>
16
- error: z.string().optional()
17
- });
18
-
19
- export type SyncNotificationTemplateResponse = {
20
- success: boolean;
21
- template?: Serialized<NotificationTemplateData>;
22
- error?: string;
23
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes