@thera-hr/api-sdk 0.0.1452 → 0.0.1520

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 (584) hide show
  1. package/Client.d.ts +4 -4
  2. package/Client.js +4 -5
  3. package/api/resources/api/client/Client.d.ts +4 -4
  4. package/api/resources/api/client/Client.js +8 -9
  5. package/api/resources/api/resources/services/client/Client.d.ts +4 -4
  6. package/api/resources/api/resources/services/client/Client.js +4 -5
  7. package/api/resources/api/resources/services/resources/file/client/Client.d.ts +4 -4
  8. package/api/resources/api/resources/services/resources/file/client/Client.js +167 -149
  9. package/api/resources/api/resources/test/client/Client.d.ts +4 -4
  10. package/api/resources/api/resources/test/client/Client.js +4 -5
  11. package/api/resources/api/resources/test/resources/invoices/client/Client.d.ts +4 -4
  12. package/api/resources/api/resources/test/resources/invoices/client/Client.js +60 -48
  13. package/api/resources/api/resources/thera/client/Client.d.ts +7 -4
  14. package/api/resources/api/resources/thera/client/Client.js +14 -10
  15. package/api/resources/api/resources/thera/resources/bank/client/Client.d.ts +4 -4
  16. package/api/resources/api/resources/thera/resources/bank/client/Client.js +4 -5
  17. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +4 -4
  18. package/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +168 -150
  19. package/api/resources/api/resources/thera/resources/company/client/Client.d.ts +7 -4
  20. package/api/resources/api/resources/thera/resources/company/client/Client.js +10 -6
  21. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.d.ts +20 -0
  22. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +116 -0
  23. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/index.d.ts +1 -0
  24. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/index.js +17 -0
  25. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/InviteContractorReq.d.ts +8 -0
  26. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/index.d.ts +1 -0
  27. package/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/index.js +2 -0
  28. package/api/resources/api/resources/thera/resources/company/resources/companyApi/index.d.ts +1 -0
  29. package/api/resources/api/resources/thera/resources/company/resources/companyApi/index.js +1 -0
  30. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.d.ts +10 -0
  31. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.d.ts +6 -0
  32. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.d.ts +20 -0
  33. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.d.ts +9 -0
  34. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.d.ts +7 -0
  35. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.d.ts +8 -0
  36. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.d.ts +8 -0
  37. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/index.d.ts +7 -0
  38. package/api/resources/api/resources/thera/resources/company/resources/companyApi/types/index.js +7 -0
  39. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.d.ts +4 -4
  40. package/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +55 -43
  41. package/api/resources/api/resources/thera/resources/company/resources/index.d.ts +1 -0
  42. package/api/resources/api/resources/thera/resources/company/resources/index.js +1 -0
  43. package/api/resources/api/resources/thera/resources/disbursement/client/Client.d.ts +17 -0
  44. package/api/resources/api/resources/thera/resources/disbursement/client/Client.js +17 -0
  45. package/api/resources/api/resources/thera/resources/disbursement/client/index.d.ts +1 -0
  46. package/api/resources/api/resources/thera/resources/disbursement/client/index.js +2 -0
  47. package/api/resources/api/resources/thera/resources/disbursement/index.d.ts +2 -0
  48. package/api/resources/api/resources/thera/resources/disbursement/index.js +18 -0
  49. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.d.ts +20 -0
  50. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +106 -0
  51. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/index.d.ts +1 -0
  52. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/index.js +17 -0
  53. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/InvoiceWebhookRequest.d.ts +8 -0
  54. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/index.d.ts +1 -0
  55. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/index.js +2 -0
  56. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.d.ts +2 -0
  57. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.js +18 -0
  58. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.d.ts +5 -0
  59. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.d.ts +10 -0
  60. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.d.ts +2 -0
  61. package/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.js +18 -0
  62. package/api/resources/api/resources/thera/resources/disbursement/resources/index.d.ts +3 -0
  63. package/api/resources/api/resources/thera/resources/disbursement/resources/index.js +32 -0
  64. package/api/resources/api/resources/thera/resources/index.d.ts +1 -0
  65. package/api/resources/api/resources/thera/resources/index.js +2 -1
  66. package/api/resources/api/resources/thera/resources/payroll/client/Client.d.ts +4 -4
  67. package/api/resources/api/resources/thera/resources/payroll/client/Client.js +4 -5
  68. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.d.ts +4 -4
  69. package/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +57 -45
  70. package/api/resources/db/resources/employment/types/Employment.d.ts +5 -4
  71. package/api/resources/db/resources/employment/types/index.d.ts +0 -12
  72. package/api/resources/db/resources/employment/types/index.js +0 -12
  73. package/api/resources/db/resources/user/types/ComplianceDocumentType.d.ts +3 -1
  74. package/api/resources/db/resources/user/types/ComplianceDocumentType.js +2 -0
  75. package/api/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -2
  76. package/{dist/api/resources/db/resources/user/types/FernUser.d.ts → api/resources/db/resources/user/types/User.d.ts} +1 -1
  77. package/api/resources/db/resources/user/types/index.d.ts +1 -2
  78. package/api/resources/db/resources/user/types/index.js +1 -2
  79. package/api/resources/index.d.ts +1 -0
  80. package/api/resources/index.js +2 -1
  81. package/api/resources/model/index.d.ts +1 -0
  82. package/api/resources/model/index.js +17 -0
  83. package/api/resources/model/resources/index.d.ts +1 -0
  84. package/api/resources/model/resources/index.js +27 -0
  85. package/api/resources/model/resources/thera/index.d.ts +1 -0
  86. package/api/resources/model/resources/thera/index.js +17 -0
  87. package/api/resources/model/resources/thera/resources/employment/index.d.ts +1 -0
  88. package/api/resources/model/resources/thera/resources/employment/index.js +17 -0
  89. package/api/resources/{db → model/resources/thera}/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +2 -2
  90. package/{dist/api/resources/db → api/resources/model/resources/thera}/resources/employment/types/ContractDocumentType.d.ts +3 -0
  91. package/api/resources/model/resources/thera/resources/employment/types/ContractType.d.ts +9 -0
  92. package/api/resources/model/resources/thera/resources/employment/types/ContractType.js +11 -0
  93. package/api/resources/model/resources/thera/resources/employment/types/MonthlyPayCycleEnd.d.ts +18 -0
  94. package/api/resources/{db → model/resources/thera}/resources/employment/types/PayCycle.d.ts +3 -2
  95. package/api/resources/model/resources/thera/resources/employment/types/PayCycleEnd.d.ts +21 -0
  96. package/api/resources/model/resources/thera/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +17 -0
  97. package/api/resources/model/resources/thera/resources/employment/types/WageType.d.ts +13 -0
  98. package/{dist/api/resources/db → api/resources/model/resources/thera}/resources/employment/types/WageType.js +4 -0
  99. package/{dist/api/resources/db → api/resources/model/resources/thera}/resources/employment/types/WeeklyPayCycleEnd.d.ts +2 -2
  100. package/api/resources/model/resources/thera/resources/employment/types/index.d.ts +13 -0
  101. package/api/resources/model/resources/thera/resources/employment/types/index.js +29 -0
  102. package/api/resources/model/resources/thera/resources/index.d.ts +2 -0
  103. package/api/resources/model/resources/thera/resources/index.js +31 -0
  104. package/core/fetcher/Fetcher.d.ts +5 -4
  105. package/core/fetcher/Fetcher.js +82 -66
  106. package/core/fetcher/Supplier.js +11 -2
  107. package/core/fetcher/index.d.ts +3 -2
  108. package/core/index.d.ts +1 -1
  109. package/core/index.js +1 -1
  110. package/core/schemas/builders/date/date.js +1 -4
  111. package/core/schemas/builders/lazy/index.d.ts +2 -1
  112. package/core/schemas/builders/lazy/lazy.js +21 -13
  113. package/core/schemas/builders/lazy/lazyObject.js +11 -11
  114. package/core/schemas/builders/list/list.js +51 -41
  115. package/core/schemas/builders/object/index.d.ts +3 -2
  116. package/core/schemas/builders/object/object.js +148 -140
  117. package/core/schemas/builders/object-like/getObjectLikeUtils.js +17 -17
  118. package/core/schemas/builders/object-like/index.d.ts +1 -1
  119. package/core/schemas/builders/record/index.d.ts +1 -1
  120. package/core/schemas/builders/record/record.js +80 -75
  121. package/core/schemas/builders/schema-utils/JsonError.js +0 -1
  122. package/core/schemas/builders/schema-utils/ParseError.js +0 -1
  123. package/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
  124. package/core/schemas/builders/schema-utils/index.d.ts +2 -1
  125. package/core/schemas/builders/set/set.js +18 -11
  126. package/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
  127. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +34 -26
  128. package/core/schemas/builders/union/index.d.ts +3 -2
  129. package/core/schemas/builders/union/union.js +93 -75
  130. package/core/schemas/index.d.ts +1 -1
  131. package/core/schemas/utils/createIdentitySchemaCreator.js +1 -4
  132. package/core/schemas/utils/maybeSkipValidation.js +14 -9
  133. package/dist/Client.d.ts +4 -4
  134. package/dist/Client.js +4 -5
  135. package/dist/api/resources/api/client/Client.d.ts +4 -4
  136. package/dist/api/resources/api/client/Client.js +8 -9
  137. package/dist/api/resources/api/resources/services/client/Client.d.ts +4 -4
  138. package/dist/api/resources/api/resources/services/client/Client.js +4 -5
  139. package/dist/api/resources/api/resources/services/resources/file/client/Client.d.ts +4 -4
  140. package/dist/api/resources/api/resources/services/resources/file/client/Client.js +167 -149
  141. package/dist/api/resources/api/resources/test/client/Client.d.ts +4 -4
  142. package/dist/api/resources/api/resources/test/client/Client.js +4 -5
  143. package/dist/api/resources/api/resources/test/resources/invoices/client/Client.d.ts +4 -4
  144. package/dist/api/resources/api/resources/test/resources/invoices/client/Client.js +60 -48
  145. package/dist/api/resources/api/resources/thera/client/Client.d.ts +7 -4
  146. package/dist/api/resources/api/resources/thera/client/Client.js +14 -10
  147. package/dist/api/resources/api/resources/thera/resources/bank/client/Client.d.ts +4 -4
  148. package/dist/api/resources/api/resources/thera/resources/bank/client/Client.js +4 -5
  149. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.d.ts +4 -4
  150. package/dist/api/resources/api/resources/thera/resources/bank/resources/bankApi/client/Client.js +168 -150
  151. package/dist/api/resources/api/resources/thera/resources/company/client/Client.d.ts +7 -4
  152. package/dist/api/resources/api/resources/thera/resources/company/client/Client.js +10 -6
  153. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.d.ts +20 -0
  154. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/Client.js +116 -0
  155. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/index.d.ts +1 -0
  156. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/index.js +17 -0
  157. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/InviteContractorReq.d.ts +8 -0
  158. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/InviteContractorReq.js +5 -0
  159. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/index.d.ts +1 -0
  160. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/client/requests/index.js +2 -0
  161. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/index.d.ts +1 -0
  162. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/index.js +1 -0
  163. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.d.ts +10 -0
  164. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.js +5 -0
  165. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.d.ts +6 -0
  166. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.js +5 -0
  167. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.d.ts +20 -0
  168. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.js +5 -0
  169. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.d.ts +9 -0
  170. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.js +5 -0
  171. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.d.ts +7 -0
  172. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.js +5 -0
  173. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.d.ts +8 -0
  174. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.js +5 -0
  175. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.d.ts +8 -0
  176. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.js +5 -0
  177. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/index.d.ts +7 -0
  178. package/dist/api/resources/api/resources/thera/resources/company/resources/companyApi/types/index.js +7 -0
  179. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.d.ts +4 -4
  180. package/dist/api/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/client/Client.js +55 -43
  181. package/dist/api/resources/api/resources/thera/resources/company/resources/index.d.ts +1 -0
  182. package/dist/api/resources/api/resources/thera/resources/company/resources/index.js +1 -0
  183. package/dist/api/resources/api/resources/thera/resources/disbursement/client/Client.d.ts +17 -0
  184. package/dist/api/resources/api/resources/thera/resources/disbursement/client/Client.js +17 -0
  185. package/dist/api/resources/api/resources/thera/resources/disbursement/client/index.d.ts +1 -0
  186. package/dist/api/resources/api/resources/thera/resources/disbursement/client/index.js +2 -0
  187. package/dist/api/resources/api/resources/thera/resources/disbursement/index.d.ts +2 -0
  188. package/dist/api/resources/api/resources/thera/resources/disbursement/index.js +18 -0
  189. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.d.ts +20 -0
  190. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/Client.js +106 -0
  191. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/index.d.ts +1 -0
  192. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/index.js +17 -0
  193. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/InvoiceWebhookRequest.d.ts +8 -0
  194. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/InvoiceWebhookRequest.js +5 -0
  195. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/index.d.ts +1 -0
  196. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/index.js +2 -0
  197. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.d.ts +2 -0
  198. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.js +18 -0
  199. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.d.ts +5 -0
  200. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.js +5 -0
  201. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.d.ts +10 -0
  202. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.js +5 -0
  203. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.d.ts +2 -0
  204. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.js +18 -0
  205. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/index.d.ts +3 -0
  206. package/dist/api/resources/api/resources/thera/resources/disbursement/resources/index.js +32 -0
  207. package/dist/api/resources/api/resources/thera/resources/index.d.ts +1 -0
  208. package/dist/api/resources/api/resources/thera/resources/index.js +2 -1
  209. package/dist/api/resources/api/resources/thera/resources/payroll/client/Client.d.ts +4 -4
  210. package/dist/api/resources/api/resources/thera/resources/payroll/client/Client.js +4 -5
  211. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.d.ts +4 -4
  212. package/dist/api/resources/api/resources/thera/resources/payroll/resources/oncycleApi/client/Client.js +57 -45
  213. package/dist/api/resources/db/resources/employment/types/Employment.d.ts +5 -4
  214. package/dist/api/resources/db/resources/employment/types/index.d.ts +0 -12
  215. package/dist/api/resources/db/resources/employment/types/index.js +0 -12
  216. package/dist/api/resources/db/resources/user/types/ComplianceDocumentType.d.ts +3 -1
  217. package/dist/api/resources/db/resources/user/types/ComplianceDocumentType.js +2 -0
  218. package/dist/api/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -2
  219. package/{api/resources/db/resources/user/types/FernUser.d.ts → dist/api/resources/db/resources/user/types/User.d.ts} +1 -1
  220. package/dist/api/resources/db/resources/user/types/User.js +5 -0
  221. package/dist/api/resources/db/resources/user/types/index.d.ts +1 -2
  222. package/dist/api/resources/db/resources/user/types/index.js +1 -2
  223. package/dist/api/resources/index.d.ts +1 -0
  224. package/dist/api/resources/index.js +2 -1
  225. package/dist/api/resources/model/index.d.ts +1 -0
  226. package/dist/api/resources/model/index.js +17 -0
  227. package/dist/api/resources/model/resources/index.d.ts +1 -0
  228. package/dist/api/resources/model/resources/index.js +27 -0
  229. package/dist/api/resources/model/resources/thera/index.d.ts +1 -0
  230. package/dist/api/resources/model/resources/thera/index.js +17 -0
  231. package/dist/api/resources/model/resources/thera/resources/employment/index.d.ts +1 -0
  232. package/dist/api/resources/model/resources/thera/resources/employment/index.js +17 -0
  233. package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +2 -2
  234. package/dist/api/resources/model/resources/thera/resources/employment/types/BiWeeklyPayCycleEnd.js +5 -0
  235. package/{api/resources/db → dist/api/resources/model/resources/thera}/resources/employment/types/ContractDocumentType.d.ts +3 -0
  236. package/dist/api/resources/model/resources/thera/resources/employment/types/ContractType.d.ts +9 -0
  237. package/dist/api/resources/model/resources/thera/resources/employment/types/ContractType.js +11 -0
  238. package/dist/api/resources/model/resources/thera/resources/employment/types/FifteenthAndEndOfMonth.js +5 -0
  239. package/dist/api/resources/model/resources/thera/resources/employment/types/LastDayOfMonth.js +5 -0
  240. package/dist/api/resources/model/resources/thera/resources/employment/types/MonthlyPayCycleEnd.d.ts +18 -0
  241. package/dist/api/resources/model/resources/thera/resources/employment/types/MonthlyPayCycleEnd.js +5 -0
  242. package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/PayCycle.d.ts +3 -2
  243. package/dist/api/resources/model/resources/thera/resources/employment/types/PayCycle.js +5 -0
  244. package/dist/api/resources/model/resources/thera/resources/employment/types/PayCycleEnd.d.ts +21 -0
  245. package/dist/api/resources/model/resources/thera/resources/employment/types/PayCycleEnd.js +5 -0
  246. package/dist/api/resources/model/resources/thera/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +17 -0
  247. package/dist/api/resources/model/resources/thera/resources/employment/types/SemiMonthlyPayCycleEnd.js +5 -0
  248. package/dist/api/resources/model/resources/thera/resources/employment/types/WageType.d.ts +13 -0
  249. package/{api/resources/db → dist/api/resources/model/resources/thera}/resources/employment/types/WageType.js +4 -0
  250. package/{api/resources/db → dist/api/resources/model/resources/thera}/resources/employment/types/WeeklyPayCycleEnd.d.ts +2 -2
  251. package/dist/api/resources/model/resources/thera/resources/employment/types/WeeklyPayCycleEnd.js +5 -0
  252. package/dist/api/resources/model/resources/thera/resources/employment/types/index.d.ts +13 -0
  253. package/dist/api/resources/model/resources/thera/resources/employment/types/index.js +29 -0
  254. package/dist/api/resources/model/resources/thera/resources/index.d.ts +2 -0
  255. package/dist/api/resources/model/resources/thera/resources/index.js +31 -0
  256. package/dist/core/fetcher/Fetcher.d.ts +5 -4
  257. package/dist/core/fetcher/Fetcher.js +82 -66
  258. package/dist/core/fetcher/Supplier.js +11 -2
  259. package/dist/core/fetcher/index.d.ts +3 -2
  260. package/dist/core/index.d.ts +1 -1
  261. package/dist/core/index.js +1 -1
  262. package/dist/core/schemas/builders/date/date.js +1 -4
  263. package/dist/core/schemas/builders/lazy/index.d.ts +2 -1
  264. package/dist/core/schemas/builders/lazy/lazy.js +21 -13
  265. package/dist/core/schemas/builders/lazy/lazyObject.js +11 -11
  266. package/dist/core/schemas/builders/list/list.js +51 -41
  267. package/dist/core/schemas/builders/object/index.d.ts +3 -2
  268. package/dist/core/schemas/builders/object/object.js +148 -140
  269. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +17 -17
  270. package/dist/core/schemas/builders/object-like/index.d.ts +1 -1
  271. package/dist/core/schemas/builders/record/index.d.ts +1 -1
  272. package/dist/core/schemas/builders/record/record.js +80 -75
  273. package/dist/core/schemas/builders/schema-utils/JsonError.js +0 -1
  274. package/dist/core/schemas/builders/schema-utils/ParseError.js +0 -1
  275. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
  276. package/dist/core/schemas/builders/schema-utils/index.d.ts +2 -1
  277. package/dist/core/schemas/builders/set/set.js +18 -11
  278. package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
  279. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +34 -26
  280. package/dist/core/schemas/builders/union/index.d.ts +3 -2
  281. package/dist/core/schemas/builders/union/union.js +93 -75
  282. package/dist/core/schemas/index.d.ts +1 -1
  283. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -4
  284. package/dist/core/schemas/utils/maybeSkipValidation.js +14 -9
  285. package/dist/errors/TheraApiError.js +14 -3
  286. package/dist/serialization/resources/api/resources/request/resources/thera/resources/disbursement/types/CreateDisbursementDetail.js +11 -2
  287. package/dist/serialization/resources/api/resources/request/resources/thera/resources/disbursement/types/CreateDisbursementRequest.js +10 -1
  288. package/dist/serialization/resources/api/resources/request/resources/thera/resources/document/types/CreateDocumentDetail.js +10 -1
  289. package/dist/serialization/resources/api/resources/request/resources/thera/resources/document/types/CreateDocumentRequest.js +10 -1
  290. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/AdditionalFields.js +10 -1
  291. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/Deduction.js +13 -4
  292. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/EmployeeContribution.js +10 -1
  293. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/EmployerContribution.js +10 -1
  294. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/employee/types/Disbursement.js +10 -1
  295. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/employee/types/EmployeeCheck.js +14 -5
  296. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/reportingPeriod/types/ReportingPeriod.js +10 -1
  297. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/shift/types/Shift.js +12 -3
  298. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/deduction/resources/create/types/CreateDeduction.js +10 -1
  299. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/deduction/resources/create/types/CreateDeductionDetails.js +11 -2
  300. package/dist/serialization/resources/api/resources/request/resources/zeal/resources/employee/resources/employee/types/ZealEmployee.js +10 -1
  301. package/dist/serialization/resources/api/resources/test/resources/invoices/types/DemoFernInvoice.js +11 -2
  302. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.d.ts +15 -0
  303. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.js +45 -0
  304. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.d.ts +12 -0
  305. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.js +33 -0
  306. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.d.ts +25 -0
  307. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.js +55 -0
  308. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.d.ts +15 -0
  309. package/dist/serialization/resources/{db/resources/employment/types/BiWeeklyPayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.js} +7 -4
  310. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.d.ts +12 -0
  311. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.js +42 -0
  312. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.d.ts +13 -0
  313. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.js +43 -0
  314. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.d.ts +13 -0
  315. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.js +43 -0
  316. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/index.d.ts +7 -0
  317. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/index.js +7 -0
  318. package/dist/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollRequest.js +11 -2
  319. package/dist/serialization/resources/api/resources/thera/resources/disbursement/index.d.ts +1 -0
  320. package/dist/serialization/resources/api/resources/thera/resources/disbursement/index.js +17 -0
  321. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.d.ts +1 -0
  322. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.js +17 -0
  323. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.d.ts +11 -0
  324. package/dist/serialization/resources/{db/resources/employment/types/WageType.js → api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.js} +3 -3
  325. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.d.ts +13 -0
  326. package/dist/serialization/resources/{db/resources/employment/types/PayCycleEnd.js → api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.js} +13 -11
  327. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.d.ts +2 -0
  328. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.js +18 -0
  329. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/index.d.ts +2 -0
  330. package/dist/serialization/resources/api/resources/thera/resources/disbursement/resources/index.js +31 -0
  331. package/dist/serialization/resources/api/resources/thera/resources/index.d.ts +1 -0
  332. package/dist/serialization/resources/api/resources/thera/resources/index.js +2 -1
  333. package/dist/serialization/resources/api/resources/zeal/resources/company/resources/create/types/ZealCreateCompanyResponse.js +10 -1
  334. package/dist/serialization/resources/db/resources/document/types/FernDocument.js +11 -2
  335. package/dist/serialization/resources/db/resources/document/types/FernRecipient.js +10 -1
  336. package/dist/serialization/resources/db/resources/employment/types/Earning.js +10 -1
  337. package/dist/serialization/resources/db/resources/employment/types/Employment.d.ts +5 -4
  338. package/dist/serialization/resources/db/resources/employment/types/Employment.js +19 -9
  339. package/dist/serialization/resources/db/resources/employment/types/EmploymentDocuments.js +10 -1
  340. package/dist/serialization/resources/db/resources/employment/types/EmploymentW2PayrollDetails.js +10 -1
  341. package/dist/serialization/resources/db/resources/employment/types/EorDetails.js +10 -1
  342. package/dist/serialization/resources/db/resources/employment/types/Frequency.js +10 -1
  343. package/dist/serialization/resources/db/resources/employment/types/Milestone.js +10 -1
  344. package/dist/serialization/resources/db/resources/employment/types/MilestoneDetails.js +10 -1
  345. package/dist/serialization/resources/db/resources/employment/types/ModifyRecurrencesRequest.js +10 -1
  346. package/dist/serialization/resources/db/resources/employment/types/Recurrence.js +11 -2
  347. package/dist/serialization/resources/db/resources/employment/types/RecurrenceDetails.js +11 -2
  348. package/dist/serialization/resources/db/resources/employment/types/RecurrenceModifications.js +11 -2
  349. package/dist/serialization/resources/db/resources/employment/types/index.d.ts +0 -12
  350. package/dist/serialization/resources/db/resources/employment/types/index.js +0 -12
  351. package/dist/serialization/resources/db/resources/payment/resources/invoice/types/FernInvoice.js +11 -2
  352. package/dist/serialization/resources/db/resources/user/types/ComplianceDocument.js +10 -1
  353. package/dist/serialization/resources/db/resources/user/types/ComplianceDocumentType.d.ts +1 -1
  354. package/dist/serialization/resources/db/resources/user/types/ComplianceDocumentType.js +10 -1
  355. package/dist/serialization/resources/db/resources/user/types/ComplianceInformation.js +10 -1
  356. package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -2
  357. package/dist/serialization/resources/db/resources/user/types/EmployeeInformation.js +13 -3
  358. package/dist/serialization/resources/db/resources/user/types/{FernUser.d.ts → User.d.ts} +2 -2
  359. package/dist/serialization/resources/db/resources/user/types/{FernUser.js → User.js} +12 -3
  360. package/dist/serialization/resources/db/resources/user/types/index.d.ts +1 -2
  361. package/dist/serialization/resources/db/resources/user/types/index.js +1 -2
  362. package/dist/serialization/resources/index.d.ts +1 -0
  363. package/dist/serialization/resources/index.js +2 -1
  364. package/dist/serialization/resources/model/index.d.ts +1 -0
  365. package/dist/serialization/resources/model/index.js +17 -0
  366. package/dist/serialization/resources/model/resources/index.d.ts +1 -0
  367. package/dist/serialization/resources/model/resources/index.js +27 -0
  368. package/dist/serialization/resources/model/resources/thera/index.d.ts +1 -0
  369. package/dist/serialization/resources/model/resources/thera/index.js +17 -0
  370. package/dist/serialization/resources/model/resources/thera/resources/employment/index.d.ts +1 -0
  371. package/dist/serialization/resources/model/resources/thera/resources/employment/index.js +17 -0
  372. package/dist/serialization/resources/model/resources/thera/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +12 -0
  373. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/BiWeeklyPayCycleEnd.js +11 -2
  374. package/dist/serialization/resources/model/resources/thera/resources/employment/types/ContractDocumentType.d.ts +10 -0
  375. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/ContractDocumentType.js +1 -1
  376. package/dist/serialization/resources/model/resources/thera/resources/employment/types/ContractType.d.ts +10 -0
  377. package/dist/serialization/resources/model/resources/thera/resources/employment/types/ContractType.js +31 -0
  378. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.d.ts +4 -4
  379. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/DayOfWeek.js +1 -1
  380. package/dist/serialization/resources/model/resources/thera/resources/employment/types/EmploymentType.d.ts +10 -0
  381. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/EmploymentType.js +1 -1
  382. package/dist/serialization/resources/model/resources/thera/resources/employment/types/FifteenthAndEndOfMonth.d.ts +11 -0
  383. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/FifteenthAndEndOfMonth.js +1 -1
  384. package/dist/serialization/resources/model/resources/thera/resources/employment/types/LastDayOfMonth.d.ts +11 -0
  385. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/LastDayOfMonth.js +1 -1
  386. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/MonthlyPayCycleEnd.d.ts +6 -6
  387. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/MonthlyPayCycleEnd.js +12 -3
  388. package/dist/serialization/resources/model/resources/thera/resources/employment/types/PayCycle.d.ts +16 -0
  389. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/PayCycle.js +12 -2
  390. package/dist/serialization/resources/model/resources/thera/resources/employment/types/PayCycleEnd.d.ts +24 -0
  391. package/dist/serialization/resources/model/resources/thera/resources/employment/types/PayCycleEnd.js +54 -0
  392. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +5 -5
  393. package/dist/serialization/resources/{db → model/resources/thera}/resources/employment/types/SemiMonthlyPayCycleEnd.js +11 -2
  394. package/dist/serialization/resources/model/resources/thera/resources/employment/types/WageType.d.ts +10 -0
  395. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/WageType.js +2 -2
  396. package/dist/serialization/resources/model/resources/thera/resources/employment/types/WeeklyPayCycleEnd.d.ts +12 -0
  397. package/{serialization/resources/db → dist/serialization/resources/model/resources/thera}/resources/employment/types/WeeklyPayCycleEnd.js +11 -2
  398. package/dist/serialization/resources/model/resources/thera/resources/employment/types/index.d.ts +13 -0
  399. package/dist/serialization/resources/model/resources/thera/resources/employment/types/index.js +29 -0
  400. package/dist/serialization/resources/model/resources/thera/resources/index.d.ts +2 -0
  401. package/dist/serialization/resources/model/resources/thera/resources/index.js +31 -0
  402. package/errors/TheraApiError.js +14 -3
  403. package/package.json +3 -3
  404. package/serialization/resources/api/resources/request/resources/thera/resources/disbursement/types/CreateDisbursementDetail.js +11 -2
  405. package/serialization/resources/api/resources/request/resources/thera/resources/disbursement/types/CreateDisbursementRequest.js +10 -1
  406. package/serialization/resources/api/resources/request/resources/thera/resources/document/types/CreateDocumentDetail.js +10 -1
  407. package/serialization/resources/api/resources/request/resources/thera/resources/document/types/CreateDocumentRequest.js +10 -1
  408. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/AdditionalFields.js +10 -1
  409. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/Deduction.js +13 -4
  410. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/EmployeeContribution.js +10 -1
  411. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/deduction/types/EmployerContribution.js +10 -1
  412. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/employee/types/Disbursement.js +10 -1
  413. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/employee/types/EmployeeCheck.js +14 -5
  414. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/reportingPeriod/types/ReportingPeriod.js +10 -1
  415. package/serialization/resources/api/resources/request/resources/zeal/resources/check/resources/shift/types/Shift.js +12 -3
  416. package/serialization/resources/api/resources/request/resources/zeal/resources/deduction/resources/create/types/CreateDeduction.js +10 -1
  417. package/serialization/resources/api/resources/request/resources/zeal/resources/deduction/resources/create/types/CreateDeductionDetails.js +11 -2
  418. package/serialization/resources/api/resources/request/resources/zeal/resources/employee/resources/employee/types/ZealEmployee.js +10 -1
  419. package/serialization/resources/api/resources/test/resources/invoices/types/DemoFernInvoice.js +11 -2
  420. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.d.ts +15 -0
  421. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.js +45 -0
  422. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.d.ts +12 -0
  423. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.js +33 -0
  424. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.d.ts +25 -0
  425. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.js +55 -0
  426. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.d.ts +15 -0
  427. package/{dist/serialization/resources/db/resources/employment/types/WeeklyPayCycleEnd.js → serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.js} +7 -4
  428. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.d.ts +12 -0
  429. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.js +42 -0
  430. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.d.ts +13 -0
  431. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.js +43 -0
  432. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.d.ts +13 -0
  433. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.js +43 -0
  434. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/index.d.ts +7 -0
  435. package/serialization/resources/api/resources/thera/resources/company/resources/companyApi/types/index.js +7 -0
  436. package/serialization/resources/api/resources/thera/resources/company/resources/companyW2PayrollApi/types/OnboardW2PayrollRequest.js +11 -2
  437. package/serialization/resources/api/resources/thera/resources/disbursement/index.d.ts +1 -0
  438. package/serialization/resources/api/resources/thera/resources/disbursement/index.js +17 -0
  439. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.d.ts +1 -0
  440. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/index.js +17 -0
  441. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.d.ts +11 -0
  442. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.js +31 -0
  443. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.d.ts +13 -0
  444. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.js +47 -0
  445. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.d.ts +2 -0
  446. package/serialization/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/index.js +18 -0
  447. package/serialization/resources/api/resources/thera/resources/disbursement/resources/index.d.ts +2 -0
  448. package/serialization/resources/api/resources/thera/resources/disbursement/resources/index.js +31 -0
  449. package/serialization/resources/api/resources/thera/resources/index.d.ts +1 -0
  450. package/serialization/resources/api/resources/thera/resources/index.js +2 -1
  451. package/serialization/resources/api/resources/zeal/resources/company/resources/create/types/ZealCreateCompanyResponse.js +10 -1
  452. package/serialization/resources/db/resources/document/types/FernDocument.js +11 -2
  453. package/serialization/resources/db/resources/document/types/FernRecipient.js +10 -1
  454. package/serialization/resources/db/resources/employment/types/Earning.js +10 -1
  455. package/serialization/resources/db/resources/employment/types/Employment.d.ts +5 -4
  456. package/serialization/resources/db/resources/employment/types/Employment.js +19 -9
  457. package/serialization/resources/db/resources/employment/types/EmploymentDocuments.js +10 -1
  458. package/serialization/resources/db/resources/employment/types/EmploymentW2PayrollDetails.js +10 -1
  459. package/serialization/resources/db/resources/employment/types/EorDetails.js +10 -1
  460. package/serialization/resources/db/resources/employment/types/Frequency.js +10 -1
  461. package/serialization/resources/db/resources/employment/types/Milestone.js +10 -1
  462. package/serialization/resources/db/resources/employment/types/MilestoneDetails.js +10 -1
  463. package/serialization/resources/db/resources/employment/types/ModifyRecurrencesRequest.js +10 -1
  464. package/serialization/resources/db/resources/employment/types/Recurrence.js +11 -2
  465. package/serialization/resources/db/resources/employment/types/RecurrenceDetails.js +11 -2
  466. package/serialization/resources/db/resources/employment/types/RecurrenceModifications.js +11 -2
  467. package/serialization/resources/db/resources/employment/types/index.d.ts +0 -12
  468. package/serialization/resources/db/resources/employment/types/index.js +0 -12
  469. package/serialization/resources/db/resources/payment/resources/invoice/types/FernInvoice.js +11 -2
  470. package/serialization/resources/db/resources/user/types/ComplianceDocument.js +10 -1
  471. package/serialization/resources/db/resources/user/types/ComplianceDocumentType.d.ts +1 -1
  472. package/serialization/resources/db/resources/user/types/ComplianceDocumentType.js +10 -1
  473. package/serialization/resources/db/resources/user/types/ComplianceInformation.js +10 -1
  474. package/serialization/resources/db/resources/user/types/EmployeeInformation.d.ts +3 -2
  475. package/serialization/resources/db/resources/user/types/EmployeeInformation.js +13 -3
  476. package/serialization/resources/db/resources/user/types/{FernUser.d.ts → User.d.ts} +2 -2
  477. package/serialization/resources/db/resources/user/types/{FernUser.js → User.js} +12 -3
  478. package/serialization/resources/db/resources/user/types/index.d.ts +1 -2
  479. package/serialization/resources/db/resources/user/types/index.js +1 -2
  480. package/serialization/resources/index.d.ts +1 -0
  481. package/serialization/resources/index.js +2 -1
  482. package/serialization/resources/model/index.d.ts +1 -0
  483. package/serialization/resources/model/index.js +17 -0
  484. package/serialization/resources/model/resources/index.d.ts +1 -0
  485. package/serialization/resources/model/resources/index.js +27 -0
  486. package/serialization/resources/model/resources/thera/index.d.ts +1 -0
  487. package/serialization/resources/model/resources/thera/index.js +17 -0
  488. package/serialization/resources/model/resources/thera/resources/employment/index.d.ts +1 -0
  489. package/serialization/resources/model/resources/thera/resources/employment/index.js +17 -0
  490. package/serialization/resources/model/resources/thera/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +12 -0
  491. package/serialization/resources/{db/resources/user/types/EmployeeInformationAddress.js → model/resources/thera/resources/employment/types/BiWeeklyPayCycleEnd.js} +13 -9
  492. package/serialization/resources/model/resources/thera/resources/employment/types/ContractDocumentType.d.ts +10 -0
  493. package/{dist/serialization/resources/db → serialization/resources/model/resources/thera}/resources/employment/types/ContractDocumentType.js +1 -1
  494. package/serialization/resources/model/resources/thera/resources/employment/types/ContractType.d.ts +10 -0
  495. package/serialization/resources/model/resources/thera/resources/employment/types/ContractType.js +31 -0
  496. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.d.ts +4 -4
  497. package/{dist/serialization/resources/db → serialization/resources/model/resources/thera}/resources/employment/types/DayOfWeek.js +1 -1
  498. package/serialization/resources/model/resources/thera/resources/employment/types/EmploymentType.d.ts +10 -0
  499. package/{dist/serialization/resources/db → serialization/resources/model/resources/thera}/resources/employment/types/EmploymentType.js +1 -1
  500. package/serialization/resources/model/resources/thera/resources/employment/types/FifteenthAndEndOfMonth.d.ts +11 -0
  501. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/FifteenthAndEndOfMonth.js +1 -1
  502. package/serialization/resources/model/resources/thera/resources/employment/types/LastDayOfMonth.d.ts +11 -0
  503. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/LastDayOfMonth.js +1 -1
  504. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/MonthlyPayCycleEnd.d.ts +6 -6
  505. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/MonthlyPayCycleEnd.js +12 -3
  506. package/serialization/resources/model/resources/thera/resources/employment/types/PayCycle.d.ts +16 -0
  507. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/PayCycle.js +12 -2
  508. package/serialization/resources/model/resources/thera/resources/employment/types/PayCycleEnd.d.ts +24 -0
  509. package/serialization/resources/model/resources/thera/resources/employment/types/PayCycleEnd.js +54 -0
  510. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +5 -5
  511. package/serialization/resources/{db → model/resources/thera}/resources/employment/types/SemiMonthlyPayCycleEnd.js +11 -2
  512. package/serialization/resources/model/resources/thera/resources/employment/types/WageType.d.ts +10 -0
  513. package/serialization/resources/model/resources/thera/resources/employment/types/WageType.js +31 -0
  514. package/serialization/resources/model/resources/thera/resources/employment/types/WeeklyPayCycleEnd.d.ts +12 -0
  515. package/{dist/serialization/resources/db/resources/user/types/EmployeeInformationAddress.js → serialization/resources/model/resources/thera/resources/employment/types/WeeklyPayCycleEnd.js} +13 -9
  516. package/serialization/resources/model/resources/thera/resources/employment/types/index.d.ts +13 -0
  517. package/serialization/resources/model/resources/thera/resources/employment/types/index.js +29 -0
  518. package/serialization/resources/model/resources/thera/resources/index.d.ts +2 -0
  519. package/serialization/resources/model/resources/thera/resources/index.js +31 -0
  520. package/api/resources/db/resources/employment/types/MonthlyPayCycleEnd.d.ts +0 -18
  521. package/api/resources/db/resources/employment/types/PayCycleEnd.d.ts +0 -21
  522. package/api/resources/db/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +0 -14
  523. package/api/resources/db/resources/employment/types/WageType.d.ts +0 -9
  524. package/api/resources/db/resources/user/types/EmployeeInformationAddress.d.ts +0 -11
  525. package/dist/api/resources/db/resources/employment/types/MonthlyPayCycleEnd.d.ts +0 -18
  526. package/dist/api/resources/db/resources/employment/types/PayCycleEnd.d.ts +0 -21
  527. package/dist/api/resources/db/resources/employment/types/SemiMonthlyPayCycleEnd.d.ts +0 -14
  528. package/dist/api/resources/db/resources/employment/types/WageType.d.ts +0 -9
  529. package/dist/api/resources/db/resources/user/types/EmployeeInformationAddress.d.ts +0 -11
  530. package/dist/serialization/resources/db/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +0 -12
  531. package/dist/serialization/resources/db/resources/employment/types/ContractDocumentType.d.ts +0 -10
  532. package/dist/serialization/resources/db/resources/employment/types/EmploymentType.d.ts +0 -10
  533. package/dist/serialization/resources/db/resources/employment/types/FifteenthAndEndOfMonth.d.ts +0 -11
  534. package/dist/serialization/resources/db/resources/employment/types/LastDayOfMonth.d.ts +0 -11
  535. package/dist/serialization/resources/db/resources/employment/types/PayCycle.d.ts +0 -15
  536. package/dist/serialization/resources/db/resources/employment/types/PayCycleEnd.d.ts +0 -24
  537. package/dist/serialization/resources/db/resources/employment/types/WageType.d.ts +0 -10
  538. package/dist/serialization/resources/db/resources/employment/types/WeeklyPayCycleEnd.d.ts +0 -12
  539. package/dist/serialization/resources/db/resources/user/types/EmployeeInformationAddress.d.ts +0 -17
  540. package/serialization/resources/db/resources/employment/types/BiWeeklyPayCycleEnd.d.ts +0 -12
  541. package/serialization/resources/db/resources/employment/types/ContractDocumentType.d.ts +0 -10
  542. package/serialization/resources/db/resources/employment/types/EmploymentType.d.ts +0 -10
  543. package/serialization/resources/db/resources/employment/types/FifteenthAndEndOfMonth.d.ts +0 -11
  544. package/serialization/resources/db/resources/employment/types/LastDayOfMonth.d.ts +0 -11
  545. package/serialization/resources/db/resources/employment/types/PayCycle.d.ts +0 -15
  546. package/serialization/resources/db/resources/employment/types/PayCycleEnd.d.ts +0 -24
  547. package/serialization/resources/db/resources/employment/types/PayCycleEnd.js +0 -45
  548. package/serialization/resources/db/resources/employment/types/WageType.d.ts +0 -10
  549. package/serialization/resources/db/resources/employment/types/WeeklyPayCycleEnd.d.ts +0 -12
  550. package/serialization/resources/db/resources/user/types/EmployeeInformationAddress.d.ts +0 -17
  551. /package/api/resources/{db/resources/employment/types/BiWeeklyPayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/client/requests/InviteContractorReq.js} +0 -0
  552. /package/api/resources/{db/resources/employment/types/FifteenthAndEndOfMonth.js → api/resources/thera/resources/company/resources/companyApi/types/CreateContractor.js} +0 -0
  553. /package/api/resources/{db/resources/employment/types/LastDayOfMonth.js → api/resources/thera/resources/company/resources/companyApi/types/CreateEmployeeInformation.js} +0 -0
  554. /package/api/resources/{db/resources/employment/types/MonthlyPayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/types/CreateEmployment.js} +0 -0
  555. /package/api/resources/{db/resources/employment/types/PayCycle.js → api/resources/thera/resources/company/resources/companyApi/types/CreateMilestone.js} +0 -0
  556. /package/api/resources/{db/resources/employment/types/PayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/types/CreateMilestoneDetails.js} +0 -0
  557. /package/api/resources/{db/resources/employment/types/SemiMonthlyPayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/types/InviteContractorRequest.js} +0 -0
  558. /package/api/resources/{db/resources/employment/types/WeeklyPayCycleEnd.js → api/resources/thera/resources/company/resources/companyApi/types/InviteContractorResponse.js} +0 -0
  559. /package/api/resources/{db/resources/user/types/EmployeeInformationAddress.js → api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/client/requests/InvoiceWebhookRequest.js} +0 -0
  560. /package/api/resources/{db/resources/user/types/FernUser.js → api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/CreateScheduledInvoiceEvent.js} +0 -0
  561. /package/{dist/api/resources/db/resources/employment/types/BiWeeklyPayCycleEnd.js → api/resources/api/resources/thera/resources/disbursement/resources/disbursementWebhookApi/types/InvoiceWebhookEvent.js} +0 -0
  562. /package/{dist/api/resources/db/resources/employment/types/FifteenthAndEndOfMonth.js → api/resources/db/resources/user/types/User.js} +0 -0
  563. /package/{dist/api/resources/db/resources/employment/types/LastDayOfMonth.js → api/resources/model/resources/thera/resources/employment/types/BiWeeklyPayCycleEnd.js} +0 -0
  564. /package/api/resources/{db → model/resources/thera}/resources/employment/types/ContractDocumentType.js +0 -0
  565. /package/api/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.d.ts +0 -0
  566. /package/api/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.js +0 -0
  567. /package/api/resources/{db → model/resources/thera}/resources/employment/types/EmploymentType.d.ts +0 -0
  568. /package/api/resources/{db → model/resources/thera}/resources/employment/types/EmploymentType.js +0 -0
  569. /package/api/resources/{db → model/resources/thera}/resources/employment/types/FifteenthAndEndOfMonth.d.ts +0 -0
  570. /package/{dist/api/resources/db/resources/employment/types/MonthlyPayCycleEnd.js → api/resources/model/resources/thera/resources/employment/types/FifteenthAndEndOfMonth.js} +0 -0
  571. /package/api/resources/{db → model/resources/thera}/resources/employment/types/LastDayOfMonth.d.ts +0 -0
  572. /package/{dist/api/resources/db/resources/employment/types/PayCycle.js → api/resources/model/resources/thera/resources/employment/types/LastDayOfMonth.js} +0 -0
  573. /package/{dist/api/resources/db/resources/employment/types/PayCycleEnd.js → api/resources/model/resources/thera/resources/employment/types/MonthlyPayCycleEnd.js} +0 -0
  574. /package/{dist/api/resources/db/resources/employment/types/SemiMonthlyPayCycleEnd.js → api/resources/model/resources/thera/resources/employment/types/PayCycle.js} +0 -0
  575. /package/{dist/api/resources/db/resources/employment/types/WeeklyPayCycleEnd.js → api/resources/model/resources/thera/resources/employment/types/PayCycleEnd.js} +0 -0
  576. /package/{dist/api/resources/db/resources/user/types/EmployeeInformationAddress.js → api/resources/model/resources/thera/resources/employment/types/SemiMonthlyPayCycleEnd.js} +0 -0
  577. /package/{dist/api/resources/db/resources/user/types/FernUser.js → api/resources/model/resources/thera/resources/employment/types/WeeklyPayCycleEnd.js} +0 -0
  578. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/ContractDocumentType.js +0 -0
  579. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.d.ts +0 -0
  580. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/DayOfWeek.js +0 -0
  581. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/EmploymentType.d.ts +0 -0
  582. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/EmploymentType.js +0 -0
  583. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/FifteenthAndEndOfMonth.d.ts +0 -0
  584. /package/dist/api/resources/{db → model/resources/thera}/resources/employment/types/LastDayOfMonth.d.ts +0 -0
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.record = void 0;
4
13
  const Schema_1 = require("../../Schema");
@@ -9,93 +18,89 @@ const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
9
18
  const schema_utils_1 = require("../schema-utils");
10
19
  function record(keySchema, valueSchema) {
11
20
  const baseSchema = {
12
- parse: async (raw, opts) => {
21
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
13
22
  return validateAndTransformRecord({
14
23
  value: raw,
15
- isKeyNumeric: (await keySchema.getType()) === Schema_1.SchemaType.NUMBER,
16
- transformKey: (key) => keySchema.parse(key, {
17
- ...opts,
18
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`],
19
- }),
20
- transformValue: (value, key) => valueSchema.parse(value, {
21
- ...opts,
22
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`],
23
- }),
24
- breadcrumbsPrefix: opts?.breadcrumbsPrefix,
24
+ isKeyNumeric: (yield keySchema.getType()) === Schema_1.SchemaType.NUMBER,
25
+ transformKey: (key) => {
26
+ var _a;
27
+ return keySchema.parse(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
28
+ },
29
+ transformValue: (value, key) => {
30
+ var _a;
31
+ return valueSchema.parse(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
32
+ },
33
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
25
34
  });
26
- },
27
- json: async (parsed, opts) => {
35
+ }),
36
+ json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
28
37
  return validateAndTransformRecord({
29
38
  value: parsed,
30
- isKeyNumeric: (await keySchema.getType()) === Schema_1.SchemaType.NUMBER,
31
- transformKey: (key) => keySchema.json(key, {
32
- ...opts,
33
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`],
34
- }),
35
- transformValue: (value, key) => valueSchema.json(value, {
36
- ...opts,
37
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`],
38
- }),
39
- breadcrumbsPrefix: opts?.breadcrumbsPrefix,
39
+ isKeyNumeric: (yield keySchema.getType()) === Schema_1.SchemaType.NUMBER,
40
+ transformKey: (key) => {
41
+ var _a;
42
+ return keySchema.json(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
43
+ },
44
+ transformValue: (value, key) => {
45
+ var _a;
46
+ return valueSchema.json(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
47
+ },
48
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
40
49
  });
41
- },
50
+ }),
42
51
  getType: () => Schema_1.SchemaType.RECORD,
43
52
  };
44
- return {
45
- ...(0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema),
46
- ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
47
- };
53
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
48
54
  }
49
55
  exports.record = record;
50
- async function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
51
- if (!(0, isPlainObject_1.isPlainObject)(value)) {
52
- return {
53
- ok: false,
54
- errors: [
55
- {
56
- path: breadcrumbsPrefix,
57
- message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
58
- },
59
- ],
60
- };
61
- }
62
- return (0, entries_1.entries)(value).reduce(async (accPromise, [stringKey, value]) => {
63
- // skip nullish keys
64
- if (value == null) {
65
- return accPromise;
56
+ function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ if (!(0, isPlainObject_1.isPlainObject)(value)) {
59
+ return {
60
+ ok: false,
61
+ errors: [
62
+ {
63
+ path: breadcrumbsPrefix,
64
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
65
+ },
66
+ ],
67
+ };
66
68
  }
67
- const acc = await accPromise;
68
- let key = stringKey;
69
- if (isKeyNumeric) {
70
- const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
71
- if (!isNaN(numberKey)) {
72
- key = numberKey;
69
+ return (0, entries_1.entries)(value).reduce((accPromise, [stringKey, value]) => __awaiter(this, void 0, void 0, function* () {
70
+ // skip nullish keys
71
+ if (value == null) {
72
+ return accPromise;
73
+ }
74
+ const acc = yield accPromise;
75
+ let key = stringKey;
76
+ if (isKeyNumeric) {
77
+ const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
78
+ if (!isNaN(numberKey)) {
79
+ key = numberKey;
80
+ }
81
+ }
82
+ const transformedKey = yield transformKey(key);
83
+ const transformedValue = yield transformValue(value, key);
84
+ if (acc.ok && transformedKey.ok && transformedValue.ok) {
85
+ return {
86
+ ok: true,
87
+ value: Object.assign(Object.assign({}, acc.value), { [transformedKey.value]: transformedValue.value }),
88
+ };
89
+ }
90
+ const errors = [];
91
+ if (!acc.ok) {
92
+ errors.push(...acc.errors);
93
+ }
94
+ if (!transformedKey.ok) {
95
+ errors.push(...transformedKey.errors);
96
+ }
97
+ if (!transformedValue.ok) {
98
+ errors.push(...transformedValue.errors);
73
99
  }
74
- }
75
- const transformedKey = await transformKey(key);
76
- const transformedValue = await transformValue(value, key);
77
- if (acc.ok && transformedKey.ok && transformedValue.ok) {
78
100
  return {
79
- ok: true,
80
- value: {
81
- ...acc.value,
82
- [transformedKey.value]: transformedValue.value,
83
- },
101
+ ok: false,
102
+ errors,
84
103
  };
85
- }
86
- const errors = [];
87
- if (!acc.ok) {
88
- errors.push(...acc.errors);
89
- }
90
- if (!transformedKey.ok) {
91
- errors.push(...transformedKey.errors);
92
- }
93
- if (!transformedValue.ok) {
94
- errors.push(...transformedValue.errors);
95
- }
96
- return {
97
- ok: false,
98
- errors,
99
- };
100
- }, Promise.resolve({ ok: true, value: {} }));
104
+ }), Promise.resolve({ ok: true, value: {} }));
105
+ });
101
106
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.JsonError = void 0;
4
4
  const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
5
5
  class JsonError extends Error {
6
- errors;
7
6
  constructor(errors) {
8
7
  super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
9
8
  this.errors = errors;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParseError = void 0;
4
4
  const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
5
5
  class ParseError extends Error {
6
- errors;
7
6
  constructor(errors) {
8
7
  super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
9
8
  this.errors = errors;
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.transform = exports.optional = exports.getSchemaUtils = void 0;
4
13
  const Schema_1 = require("../../Schema");
@@ -8,20 +17,20 @@ function getSchemaUtils(schema) {
8
17
  return {
9
18
  optional: () => optional(schema),
10
19
  transform: (transformer) => transform(schema, transformer),
11
- parseOrThrow: async (raw, opts) => {
12
- const parsed = await schema.parse(raw, opts);
20
+ parseOrThrow: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
21
+ const parsed = yield schema.parse(raw, opts);
13
22
  if (parsed.ok) {
14
23
  return parsed.value;
15
24
  }
16
25
  throw new ParseError_1.ParseError(parsed.errors);
17
- },
18
- jsonOrThrow: async (parsed, opts) => {
19
- const raw = await schema.json(parsed, opts);
26
+ }),
27
+ jsonOrThrow: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
28
+ const raw = yield schema.json(parsed, opts);
20
29
  if (raw.ok) {
21
30
  return raw.value;
22
31
  }
23
32
  throw new JsonError_1.JsonError(raw.errors);
24
- },
33
+ }),
25
34
  };
26
35
  }
27
36
  exports.getSchemaUtils = getSchemaUtils;
@@ -50,16 +59,13 @@ function optional(schema) {
50
59
  },
51
60
  getType: () => Schema_1.SchemaType.OPTIONAL,
52
61
  };
53
- return {
54
- ...baseSchema,
55
- ...getSchemaUtils(baseSchema),
56
- };
62
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
57
63
  }
58
64
  exports.optional = optional;
59
65
  function transform(schema, transformer) {
60
66
  const baseSchema = {
61
- parse: async (raw, opts) => {
62
- const parsed = await schema.parse(raw, opts);
67
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
68
+ const parsed = yield schema.parse(raw, opts);
63
69
  if (!parsed.ok) {
64
70
  return parsed;
65
71
  }
@@ -67,16 +73,13 @@ function transform(schema, transformer) {
67
73
  ok: true,
68
74
  value: transformer.transform(parsed.value),
69
75
  };
70
- },
71
- json: async (transformed, opts) => {
72
- const parsed = await transformer.untransform(transformed);
76
+ }),
77
+ json: (transformed, opts) => __awaiter(this, void 0, void 0, function* () {
78
+ const parsed = yield transformer.untransform(transformed);
73
79
  return schema.json(parsed, opts);
74
- },
80
+ }),
75
81
  getType: () => schema.getType(),
76
82
  };
77
- return {
78
- ...baseSchema,
79
- ...getSchemaUtils(baseSchema),
80
- };
83
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
81
84
  }
82
85
  exports.transform = transform;
@@ -1,3 +1,4 @@
1
- export { getSchemaUtils, optional, transform, type SchemaUtils } from "./getSchemaUtils";
1
+ export { getSchemaUtils, optional, transform } from "./getSchemaUtils";
2
+ export type { SchemaUtils } from "./getSchemaUtils";
2
3
  export { JsonError } from "./JsonError";
3
4
  export { ParseError } from "./ParseError";
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.set = void 0;
4
13
  const Schema_1 = require("../../Schema");
@@ -9,8 +18,8 @@ const schema_utils_1 = require("../schema-utils");
9
18
  function set(schema) {
10
19
  const listSchema = (0, list_1.list)(schema);
11
20
  const baseSchema = {
12
- parse: async (raw, opts) => {
13
- const parsedList = await listSchema.parse(raw, opts);
21
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
22
+ const parsedList = yield listSchema.parse(raw, opts);
14
23
  if (parsedList.ok) {
15
24
  return {
16
25
  ok: true,
@@ -20,27 +29,25 @@ function set(schema) {
20
29
  else {
21
30
  return parsedList;
22
31
  }
23
- },
24
- json: async (parsed, opts) => {
32
+ }),
33
+ json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
34
+ var _a;
25
35
  if (!(parsed instanceof Set)) {
26
36
  return {
27
37
  ok: false,
28
38
  errors: [
29
39
  {
30
- path: opts?.breadcrumbsPrefix ?? [],
40
+ path: (_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : [],
31
41
  message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(parsed, "Set"),
32
42
  },
33
43
  ],
34
44
  };
35
45
  }
36
- const jsonList = await listSchema.json([...parsed], opts);
46
+ const jsonList = yield listSchema.json([...parsed], opts);
37
47
  return jsonList;
38
- },
48
+ }),
39
49
  getType: () => Schema_1.SchemaType.SET,
40
50
  };
41
- return {
42
- ...(0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema),
43
- ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
44
- };
51
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
45
52
  }
46
53
  exports.set = set;
@@ -1,2 +1,2 @@
1
- export { type inferParsedUnidiscriminatedUnionSchema, type inferRawUnidiscriminatedUnionSchema, type UndiscriminatedUnionSchema, } from "./types";
1
+ export type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema, UndiscriminatedUnionSchema, } from "./types";
2
2
  export { undiscriminatedUnion } from "./undiscriminatedUnion";
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.undiscriminatedUnion = void 0;
4
13
  const Schema_1 = require("../../Schema");
@@ -6,38 +15,37 @@ const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
6
15
  const schema_utils_1 = require("../schema-utils");
7
16
  function undiscriminatedUnion(schemas) {
8
17
  const baseSchema = {
9
- parse: async (raw, opts) => {
18
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
10
19
  return validateAndTransformUndiscriminatedUnion((schema) => schema.parse(raw, opts), schemas);
11
- },
12
- json: async (parsed, opts) => {
20
+ }),
21
+ json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
13
22
  return validateAndTransformUndiscriminatedUnion((schema) => schema.json(parsed, opts), schemas);
14
- },
23
+ }),
15
24
  getType: () => Schema_1.SchemaType.UNDISCRIMINATED_UNION,
16
25
  };
17
- return {
18
- ...(0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema),
19
- ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
20
- };
26
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
21
27
  }
22
28
  exports.undiscriminatedUnion = undiscriminatedUnion;
23
- async function validateAndTransformUndiscriminatedUnion(transform, schemas) {
24
- const errors = [];
25
- for (const [index, schema] of schemas.entries()) {
26
- const transformed = await transform(schema);
27
- if (transformed.ok) {
28
- return transformed;
29
- }
30
- else {
31
- for (const error of errors) {
32
- errors.push({
33
- path: error.path,
34
- message: `[Variant ${index}] ${error.message}`,
35
- });
29
+ function validateAndTransformUndiscriminatedUnion(transform, schemas) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const errors = [];
32
+ for (const [index, schema] of schemas.entries()) {
33
+ const transformed = yield transform(schema);
34
+ if (transformed.ok) {
35
+ return transformed;
36
+ }
37
+ else {
38
+ for (const error of errors) {
39
+ errors.push({
40
+ path: error.path,
41
+ message: `[Variant ${index}] ${error.message}`,
42
+ });
43
+ }
36
44
  }
37
45
  }
38
- }
39
- return {
40
- ok: false,
41
- errors,
42
- };
46
+ return {
47
+ ok: false,
48
+ errors,
49
+ };
50
+ });
43
51
  }
@@ -1,3 +1,4 @@
1
- export { discriminant, type Discriminant } from "./discriminant";
2
- export { type inferParsedDiscriminant, type inferParsedUnion, type inferRawDiscriminant, type inferRawUnion, type UnionSubtypes, } from "./types";
1
+ export { discriminant } from "./discriminant";
2
+ export type { Discriminant } from "./discriminant";
3
+ export type { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes, } from "./types";
3
4
  export { union } from "./union";
@@ -1,4 +1,24 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
2
22
  Object.defineProperty(exports, "__esModule", { value: true });
3
23
  exports.union = void 0;
4
24
  const Schema_1 = require("../../Schema");
@@ -16,108 +36,106 @@ function union(discriminant, union) {
16
36
  : discriminant.parsedDiscriminant;
17
37
  const discriminantValueSchema = (0, enum_1.enum_)((0, keys_1.keys)(union));
18
38
  const baseSchema = {
19
- parse: async (raw, opts) => {
39
+ parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
20
40
  return transformAndValidateUnion({
21
41
  value: raw,
22
42
  discriminant: rawDiscriminant,
23
43
  transformedDiscriminant: parsedDiscriminant,
24
- transformDiscriminantValue: (discriminantValue) => discriminantValueSchema.parse(discriminantValue, {
25
- allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers,
26
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant],
27
- }),
44
+ transformDiscriminantValue: (discriminantValue) => {
45
+ var _a;
46
+ return discriminantValueSchema.parse(discriminantValue, {
47
+ allowUnrecognizedEnumValues: opts === null || opts === void 0 ? void 0 : opts.allowUnrecognizedUnionMembers,
48
+ breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), rawDiscriminant],
49
+ });
50
+ },
28
51
  getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue],
29
- allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers,
52
+ allowUnrecognizedUnionMembers: opts === null || opts === void 0 ? void 0 : opts.allowUnrecognizedUnionMembers,
30
53
  transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts),
31
- breadcrumbsPrefix: opts?.breadcrumbsPrefix,
54
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
32
55
  });
33
- },
34
- json: async (parsed, opts) => {
56
+ }),
57
+ json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
35
58
  return transformAndValidateUnion({
36
59
  value: parsed,
37
60
  discriminant: parsedDiscriminant,
38
61
  transformedDiscriminant: rawDiscriminant,
39
- transformDiscriminantValue: (discriminantValue) => discriminantValueSchema.json(discriminantValue, {
40
- allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers,
41
- breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant],
42
- }),
62
+ transformDiscriminantValue: (discriminantValue) => {
63
+ var _a;
64
+ return discriminantValueSchema.json(discriminantValue, {
65
+ allowUnrecognizedEnumValues: opts === null || opts === void 0 ? void 0 : opts.allowUnrecognizedUnionMembers,
66
+ breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), parsedDiscriminant],
67
+ });
68
+ },
43
69
  getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue],
44
- allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers,
70
+ allowUnrecognizedUnionMembers: opts === null || opts === void 0 ? void 0 : opts.allowUnrecognizedUnionMembers,
45
71
  transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts),
46
- breadcrumbsPrefix: opts?.breadcrumbsPrefix,
72
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
47
73
  });
48
- },
74
+ }),
49
75
  getType: () => Schema_1.SchemaType.UNION,
50
76
  };
51
- return {
52
- ...(0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema),
53
- ...(0, schema_utils_1.getSchemaUtils)(baseSchema),
54
- ...(0, object_like_1.getObjectLikeUtils)(baseSchema),
55
- };
77
+ return Object.assign(Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema));
56
78
  }
57
79
  exports.union = union;
58
- async function transformAndValidateUnion({ value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnrecognizedUnionMembers = false, transformAdditionalProperties, breadcrumbsPrefix = [], }) {
59
- if (!(0, isPlainObject_1.isPlainObject)(value)) {
60
- return {
61
- ok: false,
62
- errors: [
63
- {
64
- path: breadcrumbsPrefix,
65
- message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
66
- },
67
- ],
68
- };
69
- }
70
- const { [discriminant]: discriminantValue, ...additionalProperties } = value;
71
- if (discriminantValue == null) {
72
- return {
73
- ok: false,
74
- errors: [
75
- {
76
- path: breadcrumbsPrefix,
77
- message: `Missing discriminant ("${discriminant}")`,
78
- },
79
- ],
80
- };
81
- }
82
- const transformedDiscriminantValue = await transformDiscriminantValue(discriminantValue);
83
- if (!transformedDiscriminantValue.ok) {
84
- return {
85
- ok: false,
86
- errors: transformedDiscriminantValue.errors,
87
- };
88
- }
89
- const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
90
- if (additionalPropertiesSchema == null) {
91
- if (allowUnrecognizedUnionMembers) {
80
+ function transformAndValidateUnion({ value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnrecognizedUnionMembers = false, transformAdditionalProperties, breadcrumbsPrefix = [], }) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (!(0, isPlainObject_1.isPlainObject)(value)) {
92
83
  return {
93
- ok: true,
94
- value: {
95
- [transformedDiscriminant]: transformedDiscriminantValue.value,
96
- ...additionalProperties,
97
- },
84
+ ok: false,
85
+ errors: [
86
+ {
87
+ path: breadcrumbsPrefix,
88
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
89
+ },
90
+ ],
98
91
  };
99
92
  }
100
- else {
93
+ const _a = value, _b = discriminant, discriminantValue = _a[_b], additionalProperties = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
94
+ if (discriminantValue == null) {
101
95
  return {
102
96
  ok: false,
103
97
  errors: [
104
98
  {
105
- path: [...breadcrumbsPrefix, discriminant],
106
- message: "Unexpected discriminant value",
99
+ path: breadcrumbsPrefix,
100
+ message: `Missing discriminant ("${discriminant}")`,
107
101
  },
108
102
  ],
109
103
  };
110
104
  }
111
- }
112
- const transformedAdditionalProperties = await transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
113
- if (!transformedAdditionalProperties.ok) {
114
- return transformedAdditionalProperties;
115
- }
116
- return {
117
- ok: true,
118
- value: {
119
- [transformedDiscriminant]: discriminantValue,
120
- ...transformedAdditionalProperties.value,
121
- },
122
- };
105
+ const transformedDiscriminantValue = yield transformDiscriminantValue(discriminantValue);
106
+ if (!transformedDiscriminantValue.ok) {
107
+ return {
108
+ ok: false,
109
+ errors: transformedDiscriminantValue.errors,
110
+ };
111
+ }
112
+ const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
113
+ if (additionalPropertiesSchema == null) {
114
+ if (allowUnrecognizedUnionMembers) {
115
+ return {
116
+ ok: true,
117
+ value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
118
+ };
119
+ }
120
+ else {
121
+ return {
122
+ ok: false,
123
+ errors: [
124
+ {
125
+ path: [...breadcrumbsPrefix, discriminant],
126
+ message: "Unexpected discriminant value",
127
+ },
128
+ ],
129
+ };
130
+ }
131
+ }
132
+ const transformedAdditionalProperties = yield transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
133
+ if (!transformedAdditionalProperties.ok) {
134
+ return transformedAdditionalProperties;
135
+ }
136
+ return {
137
+ ok: true,
138
+ value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
139
+ };
140
+ });
123
141
  }
@@ -1,2 +1,2 @@
1
1
  export * from "./builders";
2
- export { type inferParsed, type inferRaw, type Schema, type SchemaOptions } from "./Schema";
2
+ export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema";