@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
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.previewNotificationTemplateRequestSchema = exports.syncNotificationTemplateRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.entitySyncStateSchema = exports.createNotificationTemplateSchema = exports.notificationTemplateSchema = exports.notificationContentSchema = exports.notificationTriggerSchema = exports.notificationTriggerTypeSchema = exports.notificationEntityTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const id_types_1 = require("../id-types");
6
+ exports.notificationEntityTypeSchema = zod_1.z.enum([
7
+ 'agenda', 'tasks', 'habits', 'inbox',
8
+ 'agenda_item', 'habit',
9
+ 'agenda_defaults', 'habits_defaults'
10
+ ]);
11
+ exports.notificationTriggerTypeSchema = zod_1.z.enum(['time_based', 'event_based', 'recurring']);
12
+ exports.notificationTriggerSchema = zod_1.z.object({
13
+ type: exports.notificationTriggerTypeSchema,
14
+ conditions: zod_1.z.record(zod_1.z.any()),
15
+ timing: zod_1.z.record(zod_1.z.any())
16
+ });
17
+ exports.notificationContentSchema = zod_1.z.object({
18
+ title: zod_1.z.string(),
19
+ body: zod_1.z.string(),
20
+ variables: zod_1.z.record(zod_1.z.string()).optional()
21
+ });
22
+ exports.notificationTemplateSchema = zod_1.z.object({
23
+ _id: id_types_1.notificationTemplateIdSchema,
24
+ userId: id_types_1.userIdSchema,
25
+ entityType: exports.notificationEntityTypeSchema,
26
+ entityId: zod_1.z.string().optional(),
27
+ name: zod_1.z.string(),
28
+ description: zod_1.z.string().optional(),
29
+ trigger: exports.notificationTriggerSchema,
30
+ content: exports.notificationContentSchema,
31
+ active: zod_1.z.boolean(),
32
+ inheritedFrom: id_types_1.notificationTemplateIdSchema.optional(),
33
+ customized: zod_1.z.boolean(),
34
+ createdAt: zod_1.z.date(),
35
+ updatedAt: zod_1.z.date()
36
+ });
37
+ exports.createNotificationTemplateSchema = exports.notificationTemplateSchema.omit({
38
+ _id: true,
39
+ createdAt: true,
40
+ updatedAt: true
41
+ });
42
+ exports.entitySyncStateSchema = zod_1.z.object({
43
+ userId: id_types_1.userIdSchema,
44
+ entityType: exports.notificationEntityTypeSchema,
45
+ entityId: zod_1.z.string(),
46
+ synced: zod_1.z.boolean(),
47
+ updatedAt: zod_1.z.date()
48
+ });
49
+ exports.createNotificationTemplateRequestSchema = zod_1.z.object({
50
+ entityType: exports.notificationEntityTypeSchema,
51
+ entityId: zod_1.z.string().optional(),
52
+ name: zod_1.z.string().min(1).max(100),
53
+ description: zod_1.z.string().max(500).optional(),
54
+ trigger: zod_1.z.object({
55
+ type: exports.notificationTriggerTypeSchema,
56
+ conditions: zod_1.z.record(zod_1.z.any()),
57
+ timing: zod_1.z.record(zod_1.z.any())
58
+ }),
59
+ content: zod_1.z.object({
60
+ title: zod_1.z.string().min(1).max(200),
61
+ body: zod_1.z.string().min(1).max(1000),
62
+ variables: zod_1.z.record(zod_1.z.string()).optional()
63
+ }),
64
+ active: zod_1.z.boolean().default(true),
65
+ inheritedFrom: zod_1.z.string().optional(),
66
+ customized: zod_1.z.boolean().default(false)
67
+ });
68
+ exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
69
+ name: zod_1.z.string().optional(),
70
+ description: zod_1.z.string().optional(),
71
+ trigger: zod_1.z.object({
72
+ type: exports.notificationTriggerTypeSchema,
73
+ conditions: zod_1.z.record(zod_1.z.any()),
74
+ timing: zod_1.z.record(zod_1.z.any())
75
+ }).optional(),
76
+ content: zod_1.z.object({
77
+ title: zod_1.z.string(),
78
+ body: zod_1.z.string(),
79
+ variables: zod_1.z.record(zod_1.z.string()).optional()
80
+ }).optional(),
81
+ active: zod_1.z.boolean().optional(),
82
+ customized: zod_1.z.boolean().optional()
83
+ });
84
+ exports.syncNotificationTemplateRequestSchema = zod_1.z.object({
85
+ entityType: exports.notificationEntityTypeSchema,
86
+ entityId: zod_1.z.string()
87
+ });
88
+ exports.previewNotificationTemplateRequestSchema = zod_1.z.object({
89
+ templateId: id_types_1.notificationTemplateIdSchema,
90
+ entityData: zod_1.z.record(zod_1.z.any()).optional()
91
+ });
@@ -0,0 +1,285 @@
1
+ import { z } from 'zod';
2
+ import { Serialized } from '../../utils';
3
+ export declare const personPropertySchema: z.ZodObject<{
4
+ key: z.ZodString;
5
+ value: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ key: string;
8
+ value: string;
9
+ }, {
10
+ key: string;
11
+ value: string;
12
+ }>;
13
+ export declare const personNoteSchema: z.ZodObject<{
14
+ _id: z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>;
15
+ personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
16
+ userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
17
+ content: z.ZodString;
18
+ createdAt: z.ZodDate;
19
+ updatedAt: z.ZodDate;
20
+ }, "strip", z.ZodTypeAny, {
21
+ _id: string & {
22
+ readonly __brand: "PersonNoteId";
23
+ };
24
+ createdAt: Date;
25
+ updatedAt: Date;
26
+ userId: string & {
27
+ readonly __brand: "UserId";
28
+ };
29
+ content: string;
30
+ personId: string & {
31
+ readonly __brand: "PersonId";
32
+ };
33
+ }, {
34
+ _id: string;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ userId: string;
38
+ content: string;
39
+ personId: string;
40
+ }>;
41
+ export declare const personDataSchema: z.ZodObject<{
42
+ _id: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
43
+ userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
44
+ createdAt: z.ZodDate;
45
+ updatedAt: z.ZodDate;
46
+ name: z.ZodString;
47
+ properties: z.ZodArray<z.ZodObject<{
48
+ key: z.ZodString;
49
+ value: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ key: string;
52
+ value: string;
53
+ }, {
54
+ key: string;
55
+ value: string;
56
+ }>, "many">;
57
+ noteIds: z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">;
58
+ }, "strip", z.ZodTypeAny, {
59
+ _id: string & {
60
+ readonly __brand: "PersonId";
61
+ };
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ userId: string & {
65
+ readonly __brand: "UserId";
66
+ };
67
+ name: string;
68
+ properties: {
69
+ key: string;
70
+ value: string;
71
+ }[];
72
+ noteIds: import("../id-types").PersonNoteId[];
73
+ }, {
74
+ _id: string;
75
+ createdAt: Date;
76
+ updatedAt: Date;
77
+ userId: string;
78
+ name: string;
79
+ properties: {
80
+ key: string;
81
+ value: string;
82
+ }[];
83
+ noteIds: string[];
84
+ }>;
85
+ export declare const personSchema: z.ZodObject<{
86
+ _id: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
87
+ userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
88
+ createdAt: z.ZodDate;
89
+ updatedAt: z.ZodDate;
90
+ name: z.ZodString;
91
+ properties: z.ZodArray<z.ZodObject<{
92
+ key: z.ZodString;
93
+ value: z.ZodString;
94
+ }, "strip", z.ZodTypeAny, {
95
+ key: string;
96
+ value: string;
97
+ }, {
98
+ key: string;
99
+ value: string;
100
+ }>, "many">;
101
+ notes: z.ZodArray<z.ZodObject<{
102
+ _id: z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>;
103
+ personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
104
+ userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
105
+ content: z.ZodString;
106
+ createdAt: z.ZodDate;
107
+ updatedAt: z.ZodDate;
108
+ }, "strip", z.ZodTypeAny, {
109
+ _id: string & {
110
+ readonly __brand: "PersonNoteId";
111
+ };
112
+ createdAt: Date;
113
+ updatedAt: Date;
114
+ userId: string & {
115
+ readonly __brand: "UserId";
116
+ };
117
+ content: string;
118
+ personId: string & {
119
+ readonly __brand: "PersonId";
120
+ };
121
+ }, {
122
+ _id: string;
123
+ createdAt: Date;
124
+ updatedAt: Date;
125
+ userId: string;
126
+ content: string;
127
+ personId: string;
128
+ }>, "many">;
129
+ }, "strip", z.ZodTypeAny, {
130
+ _id: string & {
131
+ readonly __brand: "PersonId";
132
+ };
133
+ createdAt: Date;
134
+ updatedAt: Date;
135
+ userId: string & {
136
+ readonly __brand: "UserId";
137
+ };
138
+ name: string;
139
+ notes: {
140
+ _id: string & {
141
+ readonly __brand: "PersonNoteId";
142
+ };
143
+ createdAt: Date;
144
+ updatedAt: Date;
145
+ userId: string & {
146
+ readonly __brand: "UserId";
147
+ };
148
+ content: string;
149
+ personId: string & {
150
+ readonly __brand: "PersonId";
151
+ };
152
+ }[];
153
+ properties: {
154
+ key: string;
155
+ value: string;
156
+ }[];
157
+ }, {
158
+ _id: string;
159
+ createdAt: Date;
160
+ updatedAt: Date;
161
+ userId: string;
162
+ name: string;
163
+ notes: {
164
+ _id: string;
165
+ createdAt: Date;
166
+ updatedAt: Date;
167
+ userId: string;
168
+ content: string;
169
+ personId: string;
170
+ }[];
171
+ properties: {
172
+ key: string;
173
+ value: string;
174
+ }[];
175
+ }>;
176
+ export declare const createPersonRequestSchema: z.ZodObject<{
177
+ name: z.ZodString;
178
+ properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
179
+ key: z.ZodString;
180
+ value: z.ZodString;
181
+ }, "strip", z.ZodTypeAny, {
182
+ key: string;
183
+ value: string;
184
+ }, {
185
+ key: string;
186
+ value: string;
187
+ }>, "many">>;
188
+ notes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ name: string;
191
+ notes?: import("../id-types").PersonNoteId[] | undefined;
192
+ properties?: {
193
+ key: string;
194
+ value: string;
195
+ }[] | undefined;
196
+ }, {
197
+ name: string;
198
+ notes?: string[] | undefined;
199
+ properties?: {
200
+ key: string;
201
+ value: string;
202
+ }[] | undefined;
203
+ }>;
204
+ export declare const updatePersonRequestSchema: z.ZodObject<{
205
+ name: z.ZodOptional<z.ZodString>;
206
+ properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
207
+ key: z.ZodString;
208
+ value: z.ZodString;
209
+ }, "strip", z.ZodTypeAny, {
210
+ key: string;
211
+ value: string;
212
+ }, {
213
+ key: string;
214
+ value: string;
215
+ }>, "many">>;
216
+ noteIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ name?: string | undefined;
219
+ properties?: {
220
+ key: string;
221
+ value: string;
222
+ }[] | undefined;
223
+ noteIds?: import("../id-types").PersonNoteId[] | undefined;
224
+ }, {
225
+ name?: string | undefined;
226
+ properties?: {
227
+ key: string;
228
+ value: string;
229
+ }[] | undefined;
230
+ noteIds?: string[] | undefined;
231
+ }>;
232
+ export declare const createPersonNoteRequestSchema: z.ZodObject<{
233
+ personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
234
+ content: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
236
+ content: string;
237
+ personId: string & {
238
+ readonly __brand: "PersonId";
239
+ };
240
+ }, {
241
+ content: string;
242
+ personId: string;
243
+ }>;
244
+ export declare const updatePersonNoteRequestSchema: z.ZodObject<{
245
+ content: z.ZodString;
246
+ }, "strip", z.ZodTypeAny, {
247
+ content: string;
248
+ }, {
249
+ content: string;
250
+ }>;
251
+ export type PersonPropertyData = z.infer<typeof personPropertySchema>;
252
+ export type PersonNoteData = z.infer<typeof personNoteSchema>;
253
+ export type PersonData = z.infer<typeof personDataSchema>;
254
+ export type Person = z.infer<typeof personSchema>;
255
+ export type CreatePersonRequest = z.infer<typeof createPersonRequestSchema>;
256
+ export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;
257
+ export type CreatePersonNoteRequest = z.infer<typeof createPersonNoteRequestSchema>;
258
+ export type UpdatePersonNoteRequest = z.infer<typeof updatePersonNoteRequestSchema>;
259
+ export interface CreatePersonResponse {
260
+ person: Serialized<Person>;
261
+ }
262
+ export interface GetPeopleResponse {
263
+ people: Serialized<Person>[];
264
+ }
265
+ export interface GetPersonResponse {
266
+ person: Serialized<Person>;
267
+ }
268
+ export interface UpdatePersonResponse {
269
+ person: Serialized<Person>;
270
+ }
271
+ export interface DeletePersonResponse {
272
+ deleted: boolean;
273
+ }
274
+ export interface CreatePersonNoteResponse {
275
+ personNote: Serialized<PersonNoteData>;
276
+ }
277
+ export interface GetPersonNotesResponse {
278
+ personNotes: Serialized<PersonNoteData>[];
279
+ }
280
+ export interface UpdatePersonNoteResponse {
281
+ personNote: Serialized<PersonNoteData>;
282
+ }
283
+ export interface DeletePersonNoteResponse {
284
+ deleted: boolean;
285
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updatePersonNoteRequestSchema = exports.createPersonNoteRequestSchema = exports.updatePersonRequestSchema = exports.createPersonRequestSchema = exports.personSchema = exports.personDataSchema = exports.personNoteSchema = exports.personPropertySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const id_types_1 = require("../id-types");
6
+ exports.personPropertySchema = zod_1.z.object({
7
+ key: zod_1.z.string(),
8
+ value: zod_1.z.string()
9
+ });
10
+ exports.personNoteSchema = zod_1.z.object({
11
+ _id: id_types_1.personNoteIdSchema,
12
+ personId: id_types_1.personIdSchema,
13
+ userId: id_types_1.userIdSchema,
14
+ content: zod_1.z.string(),
15
+ createdAt: zod_1.z.date(),
16
+ updatedAt: zod_1.z.date()
17
+ });
18
+ exports.personDataSchema = zod_1.z.object({
19
+ _id: id_types_1.personIdSchema,
20
+ userId: id_types_1.userIdSchema,
21
+ createdAt: zod_1.z.date(),
22
+ updatedAt: zod_1.z.date(),
23
+ name: zod_1.z.string(),
24
+ properties: zod_1.z.array(exports.personPropertySchema),
25
+ noteIds: zod_1.z.array(id_types_1.personNoteIdSchema)
26
+ });
27
+ exports.personSchema = zod_1.z.object({
28
+ _id: id_types_1.personIdSchema,
29
+ userId: id_types_1.userIdSchema,
30
+ createdAt: zod_1.z.date(),
31
+ updatedAt: zod_1.z.date(),
32
+ name: zod_1.z.string(),
33
+ properties: zod_1.z.array(exports.personPropertySchema),
34
+ notes: zod_1.z.array(exports.personNoteSchema)
35
+ });
36
+ exports.createPersonRequestSchema = zod_1.z.object({
37
+ name: zod_1.z.string().min(1),
38
+ properties: zod_1.z.array(zod_1.z.object({
39
+ key: zod_1.z.string().min(1),
40
+ value: zod_1.z.string().min(1)
41
+ })).optional(),
42
+ notes: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
43
+ });
44
+ exports.updatePersonRequestSchema = zod_1.z.object({
45
+ name: zod_1.z.string().min(1).optional(),
46
+ properties: zod_1.z.array(zod_1.z.object({
47
+ key: zod_1.z.string().min(1),
48
+ value: zod_1.z.string().min(1)
49
+ })).optional(),
50
+ noteIds: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
51
+ });
52
+ exports.createPersonNoteRequestSchema = zod_1.z.object({
53
+ personId: id_types_1.personIdSchema,
54
+ content: zod_1.z.string().min(1)
55
+ });
56
+ exports.updatePersonNoteRequestSchema = zod_1.z.object({
57
+ content: zod_1.z.string().min(1)
58
+ });
@@ -0,0 +1,105 @@
1
+ import { z } from 'zod';
2
+ export declare const programConfigSchema: z.ZodObject<{
3
+ _requiredBuildVersions: z.ZodObject<{
4
+ iOS: z.ZodNumber;
5
+ android: z.ZodNumber;
6
+ }, "strip", z.ZodTypeAny, {
7
+ iOS: number;
8
+ android: number;
9
+ }, {
10
+ iOS: number;
11
+ android: number;
12
+ }>;
13
+ dev: z.ZodObject<{
14
+ authorizedEmails: z.ZodArray<z.ZodString, "many">;
15
+ }, "strip", z.ZodTypeAny, {
16
+ authorizedEmails: string[];
17
+ }, {
18
+ authorizedEmails: string[];
19
+ }>;
20
+ discord: z.ZodObject<{
21
+ token: z.ZodString;
22
+ clientId: z.ZodString;
23
+ guildId: z.ZodString;
24
+ logChannelId: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ token: string;
27
+ clientId: string;
28
+ guildId: string;
29
+ logChannelId?: string | undefined;
30
+ }, {
31
+ token: string;
32
+ clientId: string;
33
+ guildId: string;
34
+ logChannelId?: string | undefined;
35
+ }>;
36
+ mailjet: z.ZodObject<{
37
+ apiKey: z.ZodString;
38
+ secretKey: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ apiKey: string;
41
+ secretKey: string;
42
+ }, {
43
+ apiKey: string;
44
+ secretKey: string;
45
+ }>;
46
+ expo: z.ZodObject<{
47
+ token: z.ZodString;
48
+ }, "strip", z.ZodTypeAny, {
49
+ token: string;
50
+ }, {
51
+ token: string;
52
+ }>;
53
+ redisUrl: z.ZodString;
54
+ updatedAt: z.ZodDate;
55
+ createdAt: z.ZodDate;
56
+ }, "strip", z.ZodTypeAny, {
57
+ dev: {
58
+ authorizedEmails: string[];
59
+ };
60
+ createdAt: Date;
61
+ updatedAt: Date;
62
+ _requiredBuildVersions: {
63
+ iOS: number;
64
+ android: number;
65
+ };
66
+ discord: {
67
+ token: string;
68
+ clientId: string;
69
+ guildId: string;
70
+ logChannelId?: string | undefined;
71
+ };
72
+ mailjet: {
73
+ apiKey: string;
74
+ secretKey: string;
75
+ };
76
+ expo: {
77
+ token: string;
78
+ };
79
+ redisUrl: string;
80
+ }, {
81
+ dev: {
82
+ authorizedEmails: string[];
83
+ };
84
+ createdAt: Date;
85
+ updatedAt: Date;
86
+ _requiredBuildVersions: {
87
+ iOS: number;
88
+ android: number;
89
+ };
90
+ discord: {
91
+ token: string;
92
+ clientId: string;
93
+ guildId: string;
94
+ logChannelId?: string | undefined;
95
+ };
96
+ mailjet: {
97
+ apiKey: string;
98
+ secretKey: string;
99
+ };
100
+ expo: {
101
+ token: string;
102
+ };
103
+ redisUrl: string;
104
+ }>;
105
+ export type ProgramConfigData = z.infer<typeof programConfigSchema>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.programConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.programConfigSchema = zod_1.z.object({
6
+ _requiredBuildVersions: zod_1.z.object({
7
+ iOS: zod_1.z.number(),
8
+ android: zod_1.z.number()
9
+ }),
10
+ dev: zod_1.z.object({
11
+ authorizedEmails: zod_1.z.array(zod_1.z.string())
12
+ }),
13
+ discord: zod_1.z.object({
14
+ token: zod_1.z.string(),
15
+ clientId: zod_1.z.string(),
16
+ guildId: zod_1.z.string(),
17
+ logChannelId: zod_1.z.string().optional()
18
+ }),
19
+ mailjet: zod_1.z.object({
20
+ apiKey: zod_1.z.string(),
21
+ secretKey: zod_1.z.string()
22
+ }),
23
+ expo: zod_1.z.object({
24
+ token: zod_1.z.string()
25
+ }),
26
+ redisUrl: zod_1.z.string(),
27
+ updatedAt: zod_1.z.date(),
28
+ createdAt: zod_1.z.date()
29
+ });
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+ import { Serialized } from '../../utils';
3
+ export declare const thoughtSchema: z.ZodObject<{
4
+ _id: z.ZodEffects<z.ZodString, import("../id-types").ThoughtId, string>;
5
+ userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
6
+ createdAt: z.ZodDate;
7
+ updatedAt: z.ZodDate;
8
+ content: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ _id: string & {
11
+ readonly __brand: "ThoughtId";
12
+ };
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ userId: string & {
16
+ readonly __brand: "UserId";
17
+ };
18
+ content: string;
19
+ }, {
20
+ _id: string;
21
+ createdAt: Date;
22
+ updatedAt: Date;
23
+ userId: string;
24
+ content: string;
25
+ }>;
26
+ export declare const createThoughtRequestSchema: z.ZodObject<{
27
+ content: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ content: string;
30
+ }, {
31
+ content: string;
32
+ }>;
33
+ export declare const updateThoughtRequestSchema: z.ZodObject<{
34
+ content: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ content: string;
37
+ }, {
38
+ content: string;
39
+ }>;
40
+ export type ThoughtData = z.infer<typeof thoughtSchema>;
41
+ export type CreateThoughtRequest = z.infer<typeof createThoughtRequestSchema>;
42
+ export type UpdateThoughtRequest = z.infer<typeof updateThoughtRequestSchema>;
43
+ export interface CreateThoughtResponse {
44
+ thought: Serialized<ThoughtData>;
45
+ }
46
+ export interface GetThoughtsResponse {
47
+ thoughts: Serialized<ThoughtData>[];
48
+ }
49
+ export interface GetThoughtResponse {
50
+ thought: Serialized<ThoughtData>;
51
+ }
52
+ export interface UpdateThoughtResponse {
53
+ thought: Serialized<ThoughtData>;
54
+ }
55
+ export interface DeleteThoughtResponse {
56
+ deleted: boolean;
57
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateThoughtRequestSchema = exports.createThoughtRequestSchema = exports.thoughtSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const id_types_1 = require("../id-types");
6
+ exports.thoughtSchema = zod_1.z.object({
7
+ _id: id_types_1.thoughtIdSchema,
8
+ userId: id_types_1.userIdSchema,
9
+ createdAt: zod_1.z.date(),
10
+ updatedAt: zod_1.z.date(),
11
+ content: zod_1.z.string()
12
+ });
13
+ exports.createThoughtRequestSchema = zod_1.z.object({
14
+ content: zod_1.z.string().min(1)
15
+ });
16
+ exports.updateThoughtRequestSchema = zod_1.z.object({
17
+ content: zod_1.z.string().min(1)
18
+ });