@the-inkwell/shared 0.1.163 → 0.2.0

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 (366) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/src/constants.js +276 -0
  3. package/dist/src/schema/admin/actions/index.js +32 -0
  4. package/dist/src/schema/admin/campaigns/index.js +68 -0
  5. package/dist/src/schema/admin/candidacies/index.js +83 -0
  6. package/dist/src/schema/admin/clients/index.js +30 -0
  7. package/dist/src/schema/admin/educations/index.js +23 -0
  8. package/dist/src/schema/admin/experiences/index.js +37 -0
  9. package/dist/src/schema/admin/files/index.js +7 -0
  10. package/dist/src/{types/models → schema}/admin/index.js +18 -1
  11. package/dist/src/schema/admin/jobFunctions/index.js +32 -0
  12. package/dist/src/schema/admin/listViews/index.js +22 -0
  13. package/dist/src/schema/admin/locations/index.js +16 -0
  14. package/dist/src/schema/admin/messages/index.js +51 -0
  15. package/dist/src/schema/admin/notes/index.js +27 -0
  16. package/dist/src/schema/admin/partners/index.js +25 -0
  17. package/dist/src/schema/admin/persons/index.js +194 -0
  18. package/dist/src/schema/admin/personsToBestPersons/index.js +18 -0
  19. package/dist/src/schema/admin/personsToSkills/index.js +18 -0
  20. package/dist/src/schema/admin/personsToTags/index.js +18 -0
  21. package/dist/src/schema/admin/positions/index.js +58 -0
  22. package/dist/src/schema/admin/positionsToSkills/index.js +18 -0
  23. package/dist/src/schema/admin/positionsToTags/index.js +18 -0
  24. package/dist/src/schema/admin/referrals/index.js +64 -0
  25. package/dist/src/schema/admin/referralsToMessages/index.js +55 -0
  26. package/dist/src/schema/admin/senders/index.js +16 -0
  27. package/dist/src/schema/admin/sendgrid/index.js +10 -0
  28. package/dist/src/schema/admin/settings/index.js +21 -0
  29. package/dist/src/schema/admin/skills/index.js +32 -0
  30. package/dist/src/schema/admin/tags/index.js +29 -0
  31. package/dist/src/schema/admin/websiteLandingPages/index.js +16 -0
  32. package/dist/src/schema/admin/websiteStaticPages/index.js +16 -0
  33. package/dist/src/schema/auth/index.js +11 -0
  34. package/dist/src/schema/core.js +1469 -0
  35. package/dist/src/{types/models → schema}/index.js +1 -1
  36. package/dist/src/utils.js +16 -0
  37. package/index.ts +2 -1
  38. package/package.json +9 -2
  39. package/src/constants.ts +299 -0
  40. package/src/schema/admin/actions/index.ts +65 -0
  41. package/src/schema/admin/campaigns/index.ts +111 -0
  42. package/src/schema/admin/candidacies/index.ts +138 -0
  43. package/src/schema/admin/clients/index.ts +65 -0
  44. package/src/schema/admin/dashboard/index.ts +10 -0
  45. package/src/schema/admin/educations/index.ts +71 -0
  46. package/src/schema/admin/experiences/index.ts +87 -0
  47. package/src/schema/admin/files/index.ts +10 -0
  48. package/src/schema/admin/index.ts +29 -0
  49. package/src/schema/admin/jobFunctions/index.ts +79 -0
  50. package/src/schema/admin/listViews/index.ts +58 -0
  51. package/src/schema/admin/locations/index.ts +42 -0
  52. package/src/schema/admin/messages/index.ts +88 -0
  53. package/src/schema/admin/notes/index.ts +56 -0
  54. package/src/schema/admin/partners/index.ts +60 -0
  55. package/src/schema/admin/persons/index.ts +294 -0
  56. package/src/schema/admin/personsToBestPersons/index.ts +67 -0
  57. package/src/schema/admin/personsToSkills/index.ts +61 -0
  58. package/src/schema/admin/personsToTags/index.ts +61 -0
  59. package/src/schema/admin/positions/index.ts +97 -0
  60. package/src/schema/admin/positionsToSkills/index.ts +64 -0
  61. package/src/schema/admin/positionsToTags/index.ts +61 -0
  62. package/src/schema/admin/referrals/index.ts +100 -0
  63. package/src/schema/admin/referralsToMessages/index.ts +121 -0
  64. package/src/schema/admin/senders/index.ts +50 -0
  65. package/src/schema/admin/sendgrid/index.ts +16 -0
  66. package/src/schema/admin/settings/index.ts +34 -0
  67. package/src/schema/admin/skills/index.ts +64 -0
  68. package/src/schema/admin/tags/index.ts +56 -0
  69. package/src/schema/admin/websiteLandingPages/index.ts +69 -0
  70. package/src/schema/admin/websiteStaticPages/index.ts +67 -0
  71. package/src/schema/auth/index.ts +14 -0
  72. package/src/schema/core.ts +1906 -0
  73. package/src/{types/models → schema}/index.ts +1 -1
  74. package/src/utils.ts +41 -0
  75. package/README.md +0 -9
  76. package/dist/src/constants/enums.js +0 -209
  77. package/dist/src/constants/index.js +0 -17
  78. package/dist/src/types/_schema/Action.js +0 -4
  79. package/dist/src/types/_schema/ActionNames.js +0 -4
  80. package/dist/src/types/_schema/Actions.js +0 -4
  81. package/dist/src/types/_schema/Admin.js +0 -4
  82. package/dist/src/types/_schema/Admins.js +0 -4
  83. package/dist/src/types/_schema/Campaign.js +0 -4
  84. package/dist/src/types/_schema/CampaignStatuses.js +0 -4
  85. package/dist/src/types/_schema/CampaignToPosition.js +0 -4
  86. package/dist/src/types/_schema/Campaigns.js +0 -4
  87. package/dist/src/types/_schema/CampaignsToPositions.js +0 -4
  88. package/dist/src/types/_schema/Candidacies.js +0 -4
  89. package/dist/src/types/_schema/Candidacy.js +0 -4
  90. package/dist/src/types/_schema/CandidacyFeedback.js +0 -4
  91. package/dist/src/types/_schema/CandidacyRatingCategories.js +0 -4
  92. package/dist/src/types/_schema/CandidacyRatingReasons.js +0 -4
  93. package/dist/src/types/_schema/CandidacyRatingToTag.js +0 -4
  94. package/dist/src/types/_schema/CandidacyRatings.js +0 -4
  95. package/dist/src/types/_schema/CandidacyRatingsToTags.js +0 -4
  96. package/dist/src/types/_schema/CandidacySources.js +0 -4
  97. package/dist/src/types/_schema/CandidacyStages.js +0 -4
  98. package/dist/src/types/_schema/CandidacyStatuses.js +0 -4
  99. package/dist/src/types/_schema/Certifications.js +0 -4
  100. package/dist/src/types/_schema/Client.js +0 -4
  101. package/dist/src/types/_schema/ClientStages.js +0 -4
  102. package/dist/src/types/_schema/ClientStatuses.js +0 -4
  103. package/dist/src/types/_schema/Clients.js +0 -4
  104. package/dist/src/types/_schema/Clubs.js +0 -4
  105. package/dist/src/types/_schema/Contract.js +0 -4
  106. package/dist/src/types/_schema/Contracts.js +0 -4
  107. package/dist/src/types/_schema/Conversation.js +0 -4
  108. package/dist/src/types/_schema/Conversations.js +0 -4
  109. package/dist/src/types/_schema/EducationDegrees.js +0 -4
  110. package/dist/src/types/_schema/EducationFields.js +0 -4
  111. package/dist/src/types/_schema/Educations.js +0 -4
  112. package/dist/src/types/_schema/EnrichmentSources.js +0 -4
  113. package/dist/src/types/_schema/Enrichments.js +0 -4
  114. package/dist/src/types/_schema/Experiences.js +0 -4
  115. package/dist/src/types/_schema/Genders.js +0 -4
  116. package/dist/src/types/_schema/Industries.js +0 -4
  117. package/dist/src/types/_schema/JobFunctions.js +0 -4
  118. package/dist/src/types/_schema/JobLevels.js +0 -4
  119. package/dist/src/types/_schema/Jwt.js +0 -4
  120. package/dist/src/types/_schema/Jwts.js +0 -4
  121. package/dist/src/types/_schema/ListView.js +0 -4
  122. package/dist/src/types/_schema/ListViewModels.js +0 -4
  123. package/dist/src/types/_schema/ListViews.js +0 -4
  124. package/dist/src/types/_schema/Message.js +0 -4
  125. package/dist/src/types/_schema/MessageChannels.js +0 -4
  126. package/dist/src/types/_schema/MessageTemplate.js +0 -4
  127. package/dist/src/types/_schema/MessageTemplates.js +0 -4
  128. package/dist/src/types/_schema/Messages.js +0 -4
  129. package/dist/src/types/_schema/Networks.js +0 -4
  130. package/dist/src/types/_schema/Note.js +0 -4
  131. package/dist/src/types/_schema/Notes.js +0 -4
  132. package/dist/src/types/_schema/Otp.js +0 -4
  133. package/dist/src/types/_schema/Otps.js +0 -4
  134. package/dist/src/types/_schema/Partners.js +0 -4
  135. package/dist/src/types/_schema/Person.js +0 -4
  136. package/dist/src/types/_schema/PersonCareerLevels.js +0 -4
  137. package/dist/src/types/_schema/PersonClub.js +0 -4
  138. package/dist/src/types/_schema/PersonClubs.js +0 -4
  139. package/dist/src/types/_schema/PersonDegrees.js +0 -4
  140. package/dist/src/types/_schema/PersonEnrichment.js +0 -4
  141. package/dist/src/types/_schema/PersonEnrichments.js +0 -4
  142. package/dist/src/types/_schema/PersonGenders.js +0 -4
  143. package/dist/src/types/_schema/PersonNetwork.js +0 -4
  144. package/dist/src/types/_schema/PersonNetworks.js +0 -4
  145. package/dist/src/types/_schema/PersonSkill.js +0 -4
  146. package/dist/src/types/_schema/PersonSkills.js +0 -4
  147. package/dist/src/types/_schema/PersonSources.js +0 -4
  148. package/dist/src/types/_schema/PersonToBestPerson.js +0 -4
  149. package/dist/src/types/_schema/PersonToPersonClub.js +0 -4
  150. package/dist/src/types/_schema/PersonToPersonNetwork.js +0 -4
  151. package/dist/src/types/_schema/PersonToPersonSkill.js +0 -4
  152. package/dist/src/types/_schema/PersonToTag.js +0 -4
  153. package/dist/src/types/_schema/Persons.js +0 -4
  154. package/dist/src/types/_schema/PersonsToBestPersons.js +0 -4
  155. package/dist/src/types/_schema/PersonsToCertifications.js +0 -4
  156. package/dist/src/types/_schema/PersonsToClubs.js +0 -4
  157. package/dist/src/types/_schema/PersonsToIndustries.js +0 -4
  158. package/dist/src/types/_schema/PersonsToNetworks.js +0 -4
  159. package/dist/src/types/_schema/PersonsToPersonClubs.js +0 -4
  160. package/dist/src/types/_schema/PersonsToPersonNetworks.js +0 -4
  161. package/dist/src/types/_schema/PersonsToPersonSkills.js +0 -4
  162. package/dist/src/types/_schema/PersonsToSkills.js +0 -4
  163. package/dist/src/types/_schema/PersonsToTags.js +0 -4
  164. package/dist/src/types/_schema/Position.js +0 -4
  165. package/dist/src/types/_schema/PositionRatingCategories.js +0 -4
  166. package/dist/src/types/_schema/PositionRatings.js +0 -4
  167. package/dist/src/types/_schema/PositionStages.js +0 -4
  168. package/dist/src/types/_schema/PositionStatuses.js +0 -4
  169. package/dist/src/types/_schema/Positions.js +0 -4
  170. package/dist/src/types/_schema/PositionsToIndustries.js +0 -4
  171. package/dist/src/types/_schema/PositionsToPersonSkills.js +0 -4
  172. package/dist/src/types/_schema/PositionsToSkills.js +0 -4
  173. package/dist/src/types/_schema/PositionsToTags.js +0 -4
  174. package/dist/src/types/_schema/PublicSchema.js +0 -4
  175. package/dist/src/types/_schema/Referral.js +0 -4
  176. package/dist/src/types/_schema/ReferralPayout.js +0 -4
  177. package/dist/src/types/_schema/ReferralPayouts.js +0 -4
  178. package/dist/src/types/_schema/ReferralSources.js +0 -4
  179. package/dist/src/types/_schema/ReferralToIntroMessage.js +0 -4
  180. package/dist/src/types/_schema/Referrals.js +0 -4
  181. package/dist/src/types/_schema/ReferralsToIntroMessages.js +0 -4
  182. package/dist/src/types/_schema/ReferralsToMessages.js +0 -4
  183. package/dist/src/types/_schema/Sender.js +0 -4
  184. package/dist/src/types/_schema/Senders.js +0 -4
  185. package/dist/src/types/_schema/Skills.js +0 -4
  186. package/dist/src/types/_schema/Tag.js +0 -4
  187. package/dist/src/types/_schema/Tags.js +0 -4
  188. package/dist/src/types/_schema/WebsiteBlock.js +0 -4
  189. package/dist/src/types/_schema/WebsiteBlocks.js +0 -4
  190. package/dist/src/types/_schema/WebsiteLandingPage.js +0 -4
  191. package/dist/src/types/_schema/WebsiteLandingPages.js +0 -4
  192. package/dist/src/types/_schema/WebsiteStaticPage.js +0 -4
  193. package/dist/src/types/_schema/WebsiteStaticPages.js +0 -4
  194. package/dist/src/types/admin/index.js +0 -19
  195. package/dist/src/types/admin/persons/index.js +0 -2
  196. package/dist/src/types/admin/website/index.js +0 -2
  197. package/dist/src/types/auth/index.js +0 -2
  198. package/dist/src/types/db.js +0 -6
  199. package/dist/src/types/http/admin/candidacies/index.js +0 -2
  200. package/dist/src/types/http/admin/index.js +0 -19
  201. package/dist/src/types/http/admin/persons/index.js +0 -2
  202. package/dist/src/types/http/admin/website/index.js +0 -2
  203. package/dist/src/types/http/auth/index.js +0 -2
  204. package/dist/src/types/http/index.js +0 -19
  205. package/dist/src/types/http/utils/index.js +0 -2
  206. package/dist/src/types/index.js +0 -18
  207. package/dist/src/types/models/admin/campaigns/index.js +0 -2
  208. package/dist/src/types/models/admin/candidacies/index.js +0 -2
  209. package/dist/src/types/models/admin/clients/index.js +0 -2
  210. package/dist/src/types/models/admin/conversations/index.js +0 -2
  211. package/dist/src/types/models/admin/listViews/index.js +0 -2
  212. package/dist/src/types/models/admin/locations/index.js +0 -2
  213. package/dist/src/types/models/admin/messages/index.js +0 -2
  214. package/dist/src/types/models/admin/partners/index.js +0 -2
  215. package/dist/src/types/models/admin/persons/index.js +0 -2
  216. package/dist/src/types/models/admin/positions/index.js +0 -23
  217. package/dist/src/types/models/admin/referrals/index.js +0 -2
  218. package/dist/src/types/models/admin/settings/index.js +0 -2
  219. package/dist/src/types/models/admin/website/_shared.js +0 -2
  220. package/dist/src/types/models/admin/website/home.js +0 -2
  221. package/dist/src/types/models/admin/website/index.js +0 -18
  222. package/dist/src/types/models/admin/website/shared.js +0 -2
  223. package/dist/src/types/models/auth/index.js +0 -2
  224. package/dist/src/types/schemas/Database.js +0 -4
  225. package/dist/src/types/schemas/index.js +0 -23
  226. package/dist/src/types/schemas/public/Action.js +0 -4
  227. package/dist/src/types/schemas/public/ActionNames.js +0 -4
  228. package/dist/src/types/schemas/public/Admin.js +0 -4
  229. package/dist/src/types/schemas/public/Campaign.js +0 -4
  230. package/dist/src/types/schemas/public/CampaignStatuses.js +0 -4
  231. package/dist/src/types/schemas/public/CampaignToPosition.js +0 -4
  232. package/dist/src/types/schemas/public/Candidacy.js +0 -4
  233. package/dist/src/types/schemas/public/CandidacyFeedback.js +0 -4
  234. package/dist/src/types/schemas/public/CandidacyRatingToTag.js +0 -4
  235. package/dist/src/types/schemas/public/CandidacySources.js +0 -4
  236. package/dist/src/types/schemas/public/CandidacyStatuses.js +0 -4
  237. package/dist/src/types/schemas/public/Client.js +0 -4
  238. package/dist/src/types/schemas/public/ClientStatuses.js +0 -4
  239. package/dist/src/types/schemas/public/Contract.js +0 -4
  240. package/dist/src/types/schemas/public/Conversation.js +0 -4
  241. package/dist/src/types/schemas/public/EnrichmentSources.js +0 -4
  242. package/dist/src/types/schemas/public/Jwt.js +0 -4
  243. package/dist/src/types/schemas/public/ListView.js +0 -4
  244. package/dist/src/types/schemas/public/ListViewModels.js +0 -4
  245. package/dist/src/types/schemas/public/Message.js +0 -4
  246. package/dist/src/types/schemas/public/MessageChannels.js +0 -4
  247. package/dist/src/types/schemas/public/MessageSender.js +0 -4
  248. package/dist/src/types/schemas/public/MessageTemplate.js +0 -4
  249. package/dist/src/types/schemas/public/Note.js +0 -4
  250. package/dist/src/types/schemas/public/Otp.js +0 -4
  251. package/dist/src/types/schemas/public/Person.js +0 -4
  252. package/dist/src/types/schemas/public/PersonCareerLevels.js +0 -4
  253. package/dist/src/types/schemas/public/PersonClub.js +0 -4
  254. package/dist/src/types/schemas/public/PersonDegrees.js +0 -4
  255. package/dist/src/types/schemas/public/PersonEnrichment.js +0 -4
  256. package/dist/src/types/schemas/public/PersonGenders.js +0 -4
  257. package/dist/src/types/schemas/public/PersonNetwork.js +0 -4
  258. package/dist/src/types/schemas/public/PersonSkill.js +0 -4
  259. package/dist/src/types/schemas/public/PersonSources.js +0 -4
  260. package/dist/src/types/schemas/public/PersonToBestPerson.js +0 -4
  261. package/dist/src/types/schemas/public/PersonToPersonClub.js +0 -4
  262. package/dist/src/types/schemas/public/PersonToPersonNetwork.js +0 -4
  263. package/dist/src/types/schemas/public/PersonToPersonSkill.js +0 -4
  264. package/dist/src/types/schemas/public/PersonToTag.js +0 -4
  265. package/dist/src/types/schemas/public/Position.js +0 -4
  266. package/dist/src/types/schemas/public/PositionStatuses.js +0 -4
  267. package/dist/src/types/schemas/public/PrismaMigrations.js +0 -4
  268. package/dist/src/types/schemas/public/PublicSchema.js +0 -4
  269. package/dist/src/types/schemas/public/Referral.js +0 -4
  270. package/dist/src/types/schemas/public/ReferralPayout.js +0 -4
  271. package/dist/src/types/schemas/public/ReferralSources.js +0 -4
  272. package/dist/src/types/schemas/public/ReferralToIntroMessage.js +0 -4
  273. package/dist/src/types/schemas/public/Sender.js +0 -4
  274. package/dist/src/types/schemas/public/Tag.js +0 -4
  275. package/dist/src/types/schemas/public/WebsiteBlock.js +0 -4
  276. package/dist/src/types/schemas/public/WebsiteLandingPage.js +0 -4
  277. package/dist/src/types/schemas/public/WebsiteStaticPage.js +0 -4
  278. package/dist/src/types/shared/index.js +0 -2
  279. package/dist/src/types/utils/index.js +0 -2
  280. package/dist/types/admin/index.js +0 -17
  281. package/dist/types/admin/website/index.js +0 -2
  282. package/dist/types/index.js +0 -17
  283. package/src/constants/enums.ts +0 -251
  284. package/src/constants/index.ts +0 -1
  285. package/src/types/_schema/ActionNames.ts +0 -11
  286. package/src/types/_schema/Actions.ts +0 -91
  287. package/src/types/_schema/Admins.ts +0 -36
  288. package/src/types/_schema/CampaignStatuses.ts +0 -10
  289. package/src/types/_schema/Campaigns.ts +0 -76
  290. package/src/types/_schema/CampaignsToPositions.ts +0 -40
  291. package/src/types/_schema/Candidacies.ts +0 -77
  292. package/src/types/_schema/CandidacyFeedback.ts +0 -55
  293. package/src/types/_schema/CandidacyRatingCategories.ts +0 -12
  294. package/src/types/_schema/CandidacyRatings.ts +0 -42
  295. package/src/types/_schema/CandidacySources.ts +0 -11
  296. package/src/types/_schema/CandidacyStages.ts +0 -14
  297. package/src/types/_schema/CandidacyStatuses.ts +0 -9
  298. package/src/types/_schema/Certifications.ts +0 -59
  299. package/src/types/_schema/ClientStages.ts +0 -12
  300. package/src/types/_schema/ClientStatuses.ts +0 -9
  301. package/src/types/_schema/Clients.ts +0 -63
  302. package/src/types/_schema/Contracts.ts +0 -62
  303. package/src/types/_schema/EducationDegrees.ts +0 -12
  304. package/src/types/_schema/EducationFields.ts +0 -18
  305. package/src/types/_schema/Educations.ts +0 -55
  306. package/src/types/_schema/EnrichmentSources.ts +0 -8
  307. package/src/types/_schema/Enrichments.ts +0 -62
  308. package/src/types/_schema/Experiences.ts +0 -87
  309. package/src/types/_schema/Genders.ts +0 -11
  310. package/src/types/_schema/Industries.ts +0 -53
  311. package/src/types/_schema/JobFunctions.ts +0 -53
  312. package/src/types/_schema/JobLevels.ts +0 -13
  313. package/src/types/_schema/Jwts.ts +0 -55
  314. package/src/types/_schema/ListViewModels.ts +0 -11
  315. package/src/types/_schema/ListViews.ts +0 -74
  316. package/src/types/_schema/MessageChannels.ts +0 -9
  317. package/src/types/_schema/MessageTemplates.ts +0 -53
  318. package/src/types/_schema/Messages.ts +0 -103
  319. package/src/types/_schema/Networks.ts +0 -59
  320. package/src/types/_schema/Notes.ts +0 -76
  321. package/src/types/_schema/Otps.ts +0 -61
  322. package/src/types/_schema/Partners.ts +0 -65
  323. package/src/types/_schema/PersonSources.ts +0 -11
  324. package/src/types/_schema/Persons.ts +0 -237
  325. package/src/types/_schema/PersonsToBestPersons.ts +0 -32
  326. package/src/types/_schema/PersonsToCertifications.ts +0 -26
  327. package/src/types/_schema/PersonsToNetworks.ts +0 -33
  328. package/src/types/_schema/PersonsToSkills.ts +0 -33
  329. package/src/types/_schema/PersonsToTags.ts +0 -33
  330. package/src/types/_schema/PositionRatingCategories.ts +0 -9
  331. package/src/types/_schema/PositionRatings.ts +0 -42
  332. package/src/types/_schema/PositionStages.ts +0 -12
  333. package/src/types/_schema/PositionStatuses.ts +0 -9
  334. package/src/types/_schema/Positions.ts +0 -119
  335. package/src/types/_schema/PositionsToIndustries.ts +0 -33
  336. package/src/types/_schema/PositionsToSkills.ts +0 -33
  337. package/src/types/_schema/PositionsToTags.ts +0 -33
  338. package/src/types/_schema/ReferralPayouts.ts +0 -29
  339. package/src/types/_schema/ReferralSources.ts +0 -11
  340. package/src/types/_schema/Referrals.ts +0 -89
  341. package/src/types/_schema/ReferralsToMessages.ts +0 -47
  342. package/src/types/_schema/Senders.ts +0 -59
  343. package/src/types/_schema/Skills.ts +0 -53
  344. package/src/types/_schema/Tags.ts +0 -53
  345. package/src/types/_schema/WebsiteBlocks.ts +0 -45
  346. package/src/types/_schema/WebsiteLandingPages.ts +0 -47
  347. package/src/types/_schema/WebsiteStaticPages.ts +0 -53
  348. package/src/types/index.ts +0 -2
  349. package/src/types/models/admin/campaigns/index.ts +0 -28
  350. package/src/types/models/admin/candidacies/index.ts +0 -69
  351. package/src/types/models/admin/clients/index.ts +0 -49
  352. package/src/types/models/admin/index.ts +0 -12
  353. package/src/types/models/admin/listViews/index.ts +0 -48
  354. package/src/types/models/admin/locations/index.ts +0 -28
  355. package/src/types/models/admin/messages/index.ts +0 -14
  356. package/src/types/models/admin/partners/index.ts +0 -36
  357. package/src/types/models/admin/persons/index.ts +0 -90
  358. package/src/types/models/admin/positions/index.ts +0 -72
  359. package/src/types/models/admin/referrals/index.ts +0 -77
  360. package/src/types/models/admin/settings/index.ts +0 -24
  361. package/src/types/models/admin/website/home.ts +0 -42
  362. package/src/types/models/admin/website/index.ts +0 -2
  363. package/src/types/models/admin/website/shared.ts +0 -40
  364. package/src/types/models/auth/index.ts +0 -6
  365. package/src/types/utils/index.ts +0 -15
  366. /package/dist/src/{types/admin/candidacies → schema/admin/dashboard}/index.js +0 -0
@@ -16,4 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./admin"), exports);
18
18
  __exportStar(require("./auth"), exports);
19
- __exportStar(require("../utils"), exports);
19
+ __exportStar(require("./core"), exports);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeEnumFromObj = exports.ListQuerySchema = void 0;
4
+ const v4_1 = require("zod/v4");
5
+ exports.ListQuerySchema = v4_1.z.object({
6
+ limit: v4_1.z.number().max(1000).optional(),
7
+ offset: v4_1.z.number().optional(),
8
+ sort: v4_1.z.object({}).optional(),
9
+ filter: v4_1.z.object({}).optional()
10
+ });
11
+ const makeEnumFromObj = (obj) => {
12
+ return Object.keys(obj).sort((a, b) => {
13
+ return (obj[a].position - obj[b].position);
14
+ });
15
+ };
16
+ exports.makeEnumFromObj = makeEnumFromObj;
package/index.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './src/types'
2
1
  export * from './src/constants'
2
+ export * from './src/schema'
3
+ export * from './src/utils'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-inkwell/shared",
3
- "version": "0.1.163",
3
+ "version": "0.2.0",
4
4
  "description": "Shared code for Inkwell",
5
5
  "license": "ISC",
6
6
  "author": "Inkwell (Rob Yedlin & Saimon Alam)",
@@ -13,6 +13,13 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^22.13.1",
16
- "typescript": "^5.7.3"
16
+ "drizzle-orm": "^0.44.0",
17
+ "drizzle-zod": "^0.8.2",
18
+ "typescript": "^5.7.3",
19
+ "zod": "^3.25.41"
20
+ },
21
+ "dependencies": {
22
+ "phone": "^3.1.59",
23
+ "slugify": "^1.6.6"
17
24
  }
18
25
  }
@@ -0,0 +1,299 @@
1
+ export const ACCESS_TOKEN_COOKIE_NAME = 'accesstoken'
2
+ export const REFRESH_TOKEN_COOKIE_NAME = 'refreshtoken'
3
+
4
+ export const DEFAULT_UUID = '00000000-0000-0000-0000-000000000000'
5
+
6
+ export const ACTIONS = {
7
+ CAMPAIGN_SENT: { name: 'CAMPAIGN_SENT', position: 0 },
8
+ CANDIDACY_CREATED: { name: 'CANDIDACY_CREATED', position: 1 },
9
+ CANDIDACY_SUBMITTED: { name: 'CANDIDACY_SUBMITTED', position: 2 },
10
+ CANDIDACY_SCREENING: { name: 'CANDIDACY_SCREENING', position: 3 },
11
+ CANDIDACY_INTERVIEWING: { name: 'CANDIDACY_INTERVIEWING', position: 4 },
12
+ CANDIDACY_OFFERED: { name: 'CANDIDACY_OFFERED', position: 5 },
13
+ CANDIDACY_ON_HOLD: { name: 'CANDIDACY_ON_HOLD', position: 6 },
14
+ CANDIDACY_HIRED: { name: 'CANDIDACY_HIRED', position: 7 },
15
+ CANDIDACY_REJECTED: { name: 'CANDIDACY_REJECTED', position: 8 },
16
+ CANDIDACY_WITHDRAWN: { name: 'CANDIDACY_WITHDRAWN', position: 9 },
17
+ CLIENT_CREATED: { name: 'CLIENT_CREATED', position: 10 },
18
+ MESSAGE_CLICKED: { name: 'MESSAGE_CLICKED', position: 11 },
19
+ MESSAGE_OPENED: { name: 'MESSAGE_OPENED', position: 12 },
20
+ MESSAGE_RECEIVED: { name: 'MESSAGE_RECEIVED', position: 13 },
21
+ MESSAGE_SENT: { name: 'MESSAGE_SENT', position: 14 },
22
+ NOTE_CREATED: { name: 'NOTE_CREATED', position: 15 },
23
+ PERSON_CREATED: { name: 'PERSON_CREATED', position: 16 },
24
+ POSITION_CLOSED: { name: 'POSITION_CLOSED', position: 17 },
25
+ POSITION_OPENED: { name: 'POSITION_OPENED', position: 18 },
26
+ REFERRAL_CREATED: { name: 'REFERRAL_CREATED', position: 19 },
27
+ USER_SIGN_IN: { name: 'USER_SIGN_IN', position: 20 },
28
+ USER_UPDATE: { name: 'USER_UPDATE', position: 21 }
29
+ } as const
30
+
31
+ export const STATES = {
32
+ AL: { name: 'Alabama', position: 0 },
33
+ AK: { name: 'Alaska', position: 1 },
34
+ AS: { name: 'American Samoa', position: 2 },
35
+ AZ: { name: 'Arizona', position: 3 },
36
+ AR: { name: 'Arkansas', position: 4 },
37
+ CA: { name: 'California', position: 5 },
38
+ CO: { name: 'Colorado', position: 6 },
39
+ CT: { name: 'Connecticut', position: 7 },
40
+ DE: { name: 'Delaware', position: 8 },
41
+ DC: { name: 'District Of Columbia', position: 9 },
42
+ FM: { name: 'Federated States Of Micronesia', position: 10 },
43
+ FL: { name: 'Florida', position: 11 },
44
+ GA: { name: 'Georgia', position: 12 },
45
+ GU: { name: 'Guam', position: 13 },
46
+ HI: { name: 'Hawaii', position: 14 },
47
+ ID: { name: 'Idaho', position: 15 },
48
+ IL: { name: 'Illinois', position: 16 },
49
+ IN: { name: 'Indiana', position: 17 },
50
+ IA: { name: 'Iowa', position: 18 },
51
+ KS: { name: 'Kansas', position: 19 },
52
+ KY: { name: 'Kentucky', position: 20 },
53
+ LA: { name: 'Louisiana', position: 21 },
54
+ ME: { name: 'Maine', position: 22 },
55
+ MH: { name: 'Marshall Islands', position: 23 },
56
+ MD: { name: 'Maryland', position: 24 },
57
+ MA: { name: 'Massachusetts', position: 25 },
58
+ MI: { name: 'Michigan', position: 26 },
59
+ MN: { name: 'Minnesota', position: 27 },
60
+ MS: { name: 'Mississippi', position: 28 },
61
+ MO: { name: 'Missouri', position: 29 },
62
+ MT: { name: 'Montana', position: 30 },
63
+ NE: { name: 'Nebraska', position: 31 },
64
+ NV: { name: 'Nevada', position: 32 },
65
+ NH: { name: 'New Hampshire', position: 33 },
66
+ NJ: { name: 'New Jersey', position: 34 },
67
+ NM: { name: 'New Mexico', position: 35 },
68
+ NY: { name: 'New York', position: 36 },
69
+ NC: { name: 'North Carolina', position: 37 },
70
+ ND: { name: 'North Dakota', position: 38 },
71
+ MP: { name: 'Northern Mariana Islands', position: 39 },
72
+ OH: { name: 'Ohio', position: 40 },
73
+ OK: { name: 'Oklahoma', position: 41 },
74
+ OR: { name: 'Oregon', position: 42 },
75
+ PW: { name: 'Palau', position: 43 },
76
+ PA: { name: 'Pennsylvania', position: 44 },
77
+ PR: { name: 'Puerto Rico', position: 45 },
78
+ RI: { name: 'Rhode Island', position: 46 },
79
+ SC: { name: 'South Carolina', position: 47 },
80
+ SD: { name: 'South Dakota', position: 48 },
81
+ TN: { name: 'Tennessee', position: 49 },
82
+ TX: { name: 'Texas', position: 50 },
83
+ UT: { name: 'Utah', position: 51 },
84
+ VT: { name: 'Vermont', position: 52 },
85
+ VI: { name: 'Virgin Islands', position: 53 },
86
+ VA: { name: 'Virginia', position: 54 },
87
+ WA: { name: 'Washington', position: 55 },
88
+ WV: { name: 'West Virginia', position: 56 },
89
+ WI: { name: 'Wisconsin', position: 57 },
90
+ WY: { name: 'Wyoming', position: 58 },
91
+ AB: { name: 'Alberta', position: 59 },
92
+ BC: { name: 'British Columbia', position: 60 },
93
+ MB: { name: 'Manitoba', position: 61 },
94
+ NB: { name: 'New Brunswick', position: 62 },
95
+ NL: { name: 'Newfoundland and Labrador', position: 63 },
96
+ NS: { name: 'Nova Scotia', position: 64 },
97
+ NT: { name: 'Northwest Territories', position: 65 },
98
+ NU: { name: 'Nunavut', position: 66 },
99
+ ON: { name: 'Ontario', position: 67 },
100
+ PE: { name: 'Prince Edward Island', position: 68 },
101
+ QC: { name: 'Quebec', position: 69 },
102
+ SK: { name: 'Saskatchewan', position: 70 },
103
+ YT: { name: 'Yukon', position: 71 }
104
+ } as const
105
+
106
+ export const CANDIDACY_SOURCES = {
107
+ CAMPAIGN: { name: 'Campaign', position: 0 },
108
+ NETWORK: { name: 'Network', position: 1 },
109
+ WEBSITE: { name: 'Website', position: 2 },
110
+ SOCIAL_MEDIA: { name: 'Social Media', position: 3 }
111
+ } as const
112
+
113
+ export const CANDIDACY_STAGES = {
114
+ SUBMITTED: { name: 'Submitted', position: 0 },
115
+ SCREENING: { name: 'Screening', position: 1 },
116
+ INTERVIEWING: { name: 'Interviewing', position: 2 },
117
+ OFFERED: { name: 'Offered', position: 3 },
118
+ HIRED: { name: 'Hired', position: 4 },
119
+ REJECTED: { name: 'Rejected', position: 5 },
120
+ WITHDRAWN: { name: 'Withdrawn', position: 6 },
121
+ ON_HOLD: { name: 'On Hold', position: 7 }
122
+ } as const
123
+
124
+ export const CANDIDACY_REJECTORS = {
125
+ INKWELL: { name: 'Inkwell', position: 0 },
126
+ CLIENT: { name: 'Client', position: 1 }
127
+ } as const
128
+
129
+ export const CLIENT_STATUSES = {
130
+ ACTIVE: { name: 'Active', position: 0 },
131
+ INACTIVE: { name: 'Inactive', position: 1 }
132
+ } as const
133
+
134
+ export const CANDIDACY_ASSESSMENT_CATEGORIES = {
135
+ EXPERIENCE: { name: 'Experience', position: 0 },
136
+ INDUSTRY: { name: 'Industry', position: 1 },
137
+ SKILL: { name: 'Skill', position: 2 },
138
+ CULTURE: { name: 'Culture', position: 3 },
139
+ COMPENSATION: { name: 'Compensation', position: 4 },
140
+ LOCATION: { name: 'Location', position: 5 },
141
+ MOTIVATION: { name: 'Motivation', position: 6 }
142
+ } as const
143
+
144
+ export const EDUCATION_DEGREES = {
145
+ HIGH_SCHOOL: { name: 'High School', position: 0 },
146
+ ASSOCIATES: { name: 'Associates', position: 1 },
147
+ BACHELORS: { name: 'Bachelors', position: 2 },
148
+ MASTERS: { name: 'Masters', position: 3 },
149
+ DOCTORATE: { name: 'Doctorate', position: 4 }
150
+ } as const
151
+
152
+ export const GENDERS = {
153
+ MAN: {
154
+ name: 'Man',
155
+ position: 0
156
+ },
157
+ WOMAN: {
158
+ name: 'Woman',
159
+ position: 1
160
+ },
161
+ NON_BINARY: {
162
+ name: 'Non-Binary',
163
+ position: 2
164
+ },
165
+ UNDISCLOSED: {
166
+ name: 'Undisclosed',
167
+ position: 3
168
+ }
169
+ } as const
170
+
171
+ export const MESSAGE_STATUSES = {
172
+ DELIVERED: { name: 'Delivered', position: 0 },
173
+ FAILED: { name: 'Failed', position: 1 },
174
+ BOUNCED: { name: 'Bounced', position: 2 },
175
+ PENDING: { name: 'Pending', position: 3 },
176
+ UNSUBSCRIBED: { name: 'Unsubscribed', position: 4 },
177
+ REPORTED: { name: 'Reported', position: 5 },
178
+ DROPPED: { name: 'Dropped', position: 6 },
179
+ DEFERRED: { name: 'Deferred', position: 7 }
180
+ } as const
181
+
182
+ export const REFERRAL_SOURCES = {
183
+ CAMPAIGN: { name: 'Campaign', position: 0 },
184
+ NETWORK: { name: 'Network', position: 1 },
185
+ WEBSITE: { name: 'Website', position: 2 },
186
+ SOCIAL_MEDIA: { name: 'Social Media', position: 3 }
187
+ } as const
188
+
189
+ export const COUNTRIES = {
190
+ UNITED_STATES: { name: 'United States', position: 0 },
191
+ CANADA: { name: 'Canada', position: 1 }
192
+ } as const
193
+
194
+ export const LIST_VIEW_MODELS = {
195
+ PERSON: { name: 'Person', position: 0 },
196
+ POSITION: { name: 'Position', position: 1 },
197
+ CANDIDACY: { name: 'Candidacy', position: 2 },
198
+ REFERRAL: { name: 'Referral', position: 3 }
199
+ } as const
200
+
201
+ export const EMPLOYMENT_LOCATION_TYPES = {
202
+ REMOTE: { name: 'Remote', position: 0 },
203
+ ONSITE: { name: 'Onsite', position: 1 },
204
+ HYBRID: { name: 'Hybrid', position: 2 }
205
+ }
206
+
207
+ export const POSITION_CLOSED_REASONS = {
208
+ PLACED: { name: 'Placed', position: 0 },
209
+ CLIENT_FILLED: { name: 'Client Filled', position: 1 },
210
+ CLIENT_CANCELED: { name: 'Client Canceled', position: 2 },
211
+ INKWELL_CANCELED: { name: 'Inkwell Canceled', position: 3 }
212
+ } as const
213
+
214
+ export const PERSON_SOURCES = {
215
+ SOURCED: { name: 'Sourced', position: 0 },
216
+ NETWORK: { name: 'Network', position: 1 },
217
+ WEBSITE: { name: 'Website', position: 2 },
218
+ SOCIAL_MEDIA: { name: 'Social Media', position: 3 }
219
+ } as const
220
+
221
+ export const MESSAGE_CHANNELS = {
222
+ EMAIL: { name: 'Email', position: 0 },
223
+ SMS: { name: 'SMS', position: 1 }
224
+ }
225
+
226
+ export const EMPLOYMENT_TYPES = {
227
+ FULL_TIME: { name: 'Full Time', position: 0 },
228
+ PART_TIME: { name: 'Part Time', position: 1 }
229
+ }
230
+
231
+ export const ENRICHMENT_SOURCES = {
232
+ PDL: { name: 'PDL', position: 0 }
233
+ } as const
234
+
235
+ export const JOB_LEVELS = {
236
+ EXPERIENCED: { name: 'Experienced', position: 0 },
237
+ MANAGER: { name: 'Manager', position: 1 },
238
+ DIRECTOR: { name: 'Director', position: 2 },
239
+ VICE_PRESIDENT: { name: 'Vice President', position: 3 },
240
+ VICE_PRESIDENT_SENIOR: { name: 'Senior Vice President', position: 4 },
241
+ VICE_PRESIDENT_EXECUTIVE: { name: 'Executive Vice President', position: 5 },
242
+ CHIEF_SUITE: { name: 'Chief Suite', position: 6 }
243
+ } as const
244
+
245
+ export const EDUCATION_FIELDS = {
246
+ ACCOUNTING: { name: 'Accounting', position: 0 },
247
+ BUSINESS: { name: 'Business', position: 1 },
248
+ LAW: { name: 'Law', position: 2 },
249
+ ENGINEERING: { name: 'Engineering', position: 3 },
250
+ EDUCATION: { name: 'Education', position: 4 },
251
+ MEDICINE: { name: 'Medicine', position: 5 },
252
+ ARCHITECTURE: { name: 'Architecture', position: 6 },
253
+ SOCIAL_WORK: { name: 'Social Work', position: 7 },
254
+ HUMANITIES: { name: 'Humanities', position: 8 },
255
+ NATURAL_SCIENCES: { name: 'Natural Sciences', position: 9 },
256
+ SOCIAL_SCIENCES: { name: 'Social Sciences', position: 10 },
257
+ COMPUTER_SCIENCE: { name: 'Computer Science', position: 11 }
258
+ } as const
259
+
260
+ export const SETTINGS_OPTION_LISTS = [
261
+ 'certifications',
262
+ 'industries',
263
+ 'position-locations',
264
+ 'job-functions',
265
+ 'networks',
266
+ 'tags',
267
+ 'skills'
268
+ ] as const
269
+
270
+ export const PERSON_LIST_OPERATORS = [
271
+ 'equals',
272
+ 'not',
273
+ 'lt',
274
+ 'lte',
275
+ 'gt',
276
+ 'gte',
277
+ 'contains',
278
+ 'notContains',
279
+ 'in',
280
+ 'notIn',
281
+ 'arrayContains',
282
+ 'arrayNotContains',
283
+ 'arrayOverlaps',
284
+ 'arrayNotOverlaps',
285
+ 'startsWith',
286
+ 'endsWith',
287
+ 'between',
288
+ 'like',
289
+ 'isNull',
290
+ 'isNotNull'
291
+ ] as const
292
+
293
+ export const LIST_REQUEST_LIMITS = [0, 10, 50, 100, 200, 500] as const
294
+ export const LIST_REQUEST_SORT_DIRECTIONS = ['asc', 'desc'] as const
295
+
296
+ export const MESSAGE_TEMPLATES = {
297
+ POSITIONS: 'Positions',
298
+ NEWSLETTER: 'Newsletter'
299
+ } as const
@@ -0,0 +1,65 @@
1
+ import {
2
+ createInsertSchema,
3
+ createSelectSchema,
4
+ createUpdateSchema
5
+ } from 'drizzle-zod'
6
+ import { action, Actions } from '../../core'
7
+ import { ListQuerySchema, type ListResponse } from '../../../utils'
8
+ import { z } from 'zod/v4'
9
+
10
+ //// validators
11
+
12
+ export const AdminActionCreateSchema = createInsertSchema(action)
13
+ export const AdminActionSelectSchema = createSelectSchema(action)
14
+ export const AdminActionUpdateSchema = createUpdateSchema(action)
15
+
16
+ export const AdminActionParamsSchema = AdminActionSelectSchema.pick({
17
+ id: true
18
+ })
19
+ export const AdminActionListQuerySchema = ListQuerySchema.extend({
20
+ filter: z
21
+ .object({
22
+ name: z.enum(Actions.enumValues),
23
+ campaignId: z.string(),
24
+ candidacyId: z.string(),
25
+ clientId: z.string(),
26
+ messageId: z.string(),
27
+ noteId: z.string(),
28
+ positionId: z.string(),
29
+ personId: z.string(),
30
+ referralId: z.string()
31
+ })
32
+ .partial()
33
+ .optional()
34
+ })
35
+ export const AdminActionUpdateParamsSchema = AdminActionParamsSchema
36
+ export const AdminActionDeleteParamsSchema = AdminActionParamsSchema
37
+
38
+ //// types
39
+
40
+ type AdminAction = z.infer<typeof AdminActionSelectSchema>
41
+
42
+ // detail
43
+ export type AdminActionParams = z.infer<typeof AdminActionParamsSchema>
44
+ export type AdminActionResult = AdminAction
45
+
46
+ // list
47
+ export type AdminActionListQuery = z.infer<typeof AdminActionListQuerySchema>
48
+ export type AdminActionListResult = ListResponse<
49
+ z.infer<typeof AdminActionSelectSchema>
50
+ >
51
+
52
+ // create
53
+ export type AdminActionCreateInput = z.infer<typeof AdminActionCreateSchema>
54
+ export type AdminActionCreateResult = Pick<AdminAction, 'id'>
55
+
56
+ // update
57
+ export type AdminActionUpdateParams = z.infer<
58
+ typeof AdminActionUpdateParamsSchema
59
+ >
60
+ export type AdminActionUpdateInput = z.infer<typeof AdminActionUpdateSchema>
61
+
62
+ // delete
63
+ export type AdminActionDeleteParams = z.infer<
64
+ typeof AdminActionDeleteParamsSchema
65
+ >
@@ -0,0 +1,111 @@
1
+ import {
2
+ createInsertSchema,
3
+ createSelectSchema,
4
+ createUpdateSchema
5
+ } from 'drizzle-zod'
6
+ import { campaign, listView } from '../../core'
7
+ import { ListQuerySchema, type ListResponse } from '../../../utils'
8
+ import { z } from 'zod/v4'
9
+
10
+ //// validators
11
+
12
+ const PositionsEmailSchema = z.object({
13
+ subject: z.string(),
14
+ body: z.object({
15
+ intro: z.string().nullable().optional(),
16
+ excludedPositionIds: z
17
+ .record(z.string(), z.boolean())
18
+ .nullable()
19
+ .optional(),
20
+ outro: z.string().nullable().optional()
21
+ }),
22
+ ctaText: z.string(),
23
+ landingPageId: z.string()
24
+ })
25
+
26
+ const PositionsSMSSchema = z.object({
27
+ body: z.object({
28
+ text: z.string()
29
+ }),
30
+ landingPageId: z.string()
31
+ })
32
+
33
+ const NewsletterEmailSchema = z.object({})
34
+
35
+ const ContentSchema = z
36
+ .object({
37
+ newsletterEmail: NewsletterEmailSchema.optional(),
38
+ positionsEmail: PositionsEmailSchema.optional(),
39
+ positionsSMS: PositionsSMSSchema.optional()
40
+ })
41
+ .nullable()
42
+ .optional()
43
+
44
+ export const AdminCampaignCreateSchema = createInsertSchema(campaign)
45
+ export const AdminCampaignSelectSchema = createSelectSchema(campaign, {
46
+ content: ContentSchema
47
+ }).extend({
48
+ listView: createSelectSchema(listView)
49
+ .pick({
50
+ id: true,
51
+ name: true
52
+ })
53
+ .nullable(),
54
+ _messagesCount: z.number(),
55
+ _referralsCount: z.number()
56
+ })
57
+
58
+ export const AdminCampaignUpdateSchema = createUpdateSchema(campaign, {
59
+ content: ContentSchema
60
+ })
61
+
62
+ export const AdminCampaignParamsSchema = AdminCampaignSelectSchema.pick({
63
+ id: true,
64
+ externalId: true
65
+ })
66
+ .partial()
67
+ .refine(
68
+ (data) => data.id || data.externalId,
69
+ 'Either id or externalId should be present'
70
+ )
71
+ export const AdminCampaignListQuerySchema = ListQuerySchema.extend({
72
+ filter: z
73
+ .object({
74
+ isSent: z.boolean().optional()
75
+ })
76
+ .partial()
77
+ .optional()
78
+ })
79
+ export const AdminCampaignUpdateParamsSchema = AdminCampaignParamsSchema
80
+ export const AdminCampaignDeleteParamsSchema = AdminCampaignParamsSchema
81
+
82
+ //// types
83
+
84
+ type AdminCampaign = z.infer<typeof AdminCampaignSelectSchema>
85
+
86
+ // detail
87
+ export type AdminCampaignParams = z.infer<typeof AdminCampaignParamsSchema>
88
+ export type AdminCampaignResult = AdminCampaign
89
+
90
+ // list
91
+ export type AdminCampaignListQuery = z.infer<
92
+ typeof AdminCampaignListQuerySchema
93
+ >
94
+ export type AdminCampaignListResult = ListResponse<
95
+ z.infer<typeof AdminCampaignSelectSchema>
96
+ >
97
+
98
+ // create
99
+ export type AdminCampaignCreateInput = z.infer<typeof AdminCampaignCreateSchema>
100
+ export type AdminCampaignCreateResult = Pick<AdminCampaign, 'id'>
101
+
102
+ // update
103
+ export type AdminCampaignUpdateParams = z.infer<
104
+ typeof AdminCampaignUpdateParamsSchema
105
+ >
106
+ export type AdminCampaignUpdateInput = z.infer<typeof AdminCampaignUpdateSchema>
107
+
108
+ // delete
109
+ export type AdminCampaignDeleteParams = z.infer<
110
+ typeof AdminCampaignDeleteParamsSchema
111
+ >
@@ -0,0 +1,138 @@
1
+ import {
2
+ createInsertSchema,
3
+ createSelectSchema,
4
+ createUpdateSchema
5
+ } from 'drizzle-zod'
6
+ import {
7
+ action,
8
+ candidacy,
9
+ candidacyFeedback,
10
+ client,
11
+ note,
12
+ person,
13
+ position,
14
+ tag
15
+ } from '../../core'
16
+ import { ListQuerySchema, type ListResponse } from '../../../utils'
17
+ import { z } from 'zod/v4'
18
+
19
+ //// validators
20
+
21
+ export const AdminCandidacyCreateSchema = createInsertSchema(candidacy)
22
+
23
+ const AdminCandidacySelectPersonSchema = createSelectSchema(person).pick({
24
+ id: true,
25
+ firstName: true,
26
+ lastName: true,
27
+ fullName: true,
28
+ photoUri: true,
29
+ email: true
30
+ })
31
+ export const AdminCandidacySelectSchema = createSelectSchema(candidacy).extend({
32
+ referral: z
33
+ .object({
34
+ id: z.string(),
35
+ referrer: AdminCandidacySelectPersonSchema
36
+ })
37
+ .nullable()
38
+ .optional(),
39
+ person: AdminCandidacySelectPersonSchema.optional(),
40
+ position: createSelectSchema(position)
41
+ .pick({
42
+ id: true,
43
+ name: true
44
+ })
45
+ .extend({
46
+ client: createSelectSchema(client).pick({
47
+ id: true,
48
+ name: true
49
+ })
50
+ })
51
+ .optional(),
52
+ ratingTags: z
53
+ .array(
54
+ z.object({
55
+ tag: createSelectSchema(tag).pick({
56
+ id: true,
57
+ slug: true,
58
+ name: true
59
+ })
60
+ })
61
+ )
62
+ .optional(),
63
+ actions: z
64
+ .array(
65
+ createSelectSchema(action).pick({
66
+ id: true,
67
+ name: true
68
+ })
69
+ )
70
+ .optional(),
71
+ candidacyFeedbacks: z
72
+ .array(
73
+ createSelectSchema(candidacyFeedback).pick({
74
+ id: true,
75
+ content: true
76
+ })
77
+ )
78
+ .optional(),
79
+ notes: z
80
+ .array(
81
+ createSelectSchema(note).pick({
82
+ id: true,
83
+ content: true
84
+ })
85
+ )
86
+ .optional()
87
+ })
88
+ export const AdminCandidacyUpdateSchema = createUpdateSchema(candidacy)
89
+
90
+ export const AdminCandidacyParamsSchema = AdminCandidacySelectSchema.pick({
91
+ id: true
92
+ })
93
+ export const AdminCandidacyUpdateParamsSchema = AdminCandidacyParamsSchema
94
+ export const AdminCandidacyDeleteParamsSchema = AdminCandidacyParamsSchema
95
+ export const AdminCandidacyListQuerySchema = ListQuerySchema.extend({
96
+ filter: AdminCandidacySelectSchema.pick({
97
+ personId: true,
98
+ positionId: true
99
+ })
100
+ .extend({
101
+ isClosed: z.boolean().optional()
102
+ })
103
+ .partial()
104
+ .optional()
105
+ })
106
+
107
+ //// types
108
+
109
+ type AdminCandidacy = z.infer<typeof AdminCandidacySelectSchema>
110
+
111
+ // detail
112
+ export type AdminCandidacyParams = z.infer<typeof AdminCandidacyParamsSchema>
113
+ export type AdminCandidacyResult = AdminCandidacy
114
+
115
+ // list
116
+ export type AdminCandidacyListQuery = z.infer<
117
+ typeof AdminCandidacyListQuerySchema
118
+ >
119
+ export type AdminCandidacyListResult = ListResponse<
120
+ z.infer<typeof AdminCandidacySelectSchema>
121
+ >
122
+
123
+ // create
124
+ export type AdminCandidacyCreateInput = z.infer<
125
+ typeof AdminCandidacyCreateSchema
126
+ >
127
+ export type AdminCandidacyCreateResult = Pick<AdminCandidacy, 'id'>
128
+
129
+ // update
130
+ export type AdminCandidacyUpdateParams = z.infer<
131
+ typeof AdminCandidacyUpdateParamsSchema
132
+ >
133
+ export type AdminCandidacyUpdateInput = Partial<AdminCandidacy>
134
+
135
+ // delete
136
+ export type AdminCandidacyDeleteParams = z.infer<
137
+ typeof AdminCandidacyDeleteParamsSchema
138
+ >