@clientcasa/sdk 0.3.0 → 0.4.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 (368) hide show
  1. package/README.md +19 -24
  2. package/esm/funcs/catalog-items-list.js +1 -0
  3. package/esm/funcs/catalog-items-list.js.map +1 -1
  4. package/esm/funcs/{inquiries-get.d.ts → form-submissions-get.d.ts} +3 -3
  5. package/esm/funcs/form-submissions-get.d.ts.map +1 -0
  6. package/esm/funcs/{inquiries-delete.js → form-submissions-get.js} +9 -8
  7. package/esm/funcs/form-submissions-get.js.map +1 -0
  8. package/esm/funcs/form-submissions-list.d.ts +21 -0
  9. package/esm/funcs/form-submissions-list.d.ts.map +1 -0
  10. package/esm/funcs/{inquiries-list.js → form-submissions-list.js} +14 -9
  11. package/esm/funcs/form-submissions-list.js.map +1 -0
  12. package/esm/funcs/{proposals-get.d.ts → forms-and-agreements-get.d.ts} +2 -2
  13. package/esm/funcs/forms-and-agreements-get.d.ts.map +1 -0
  14. package/esm/funcs/{proposals-get.js → forms-and-agreements-get.js} +6 -6
  15. package/esm/funcs/forms-and-agreements-get.js.map +1 -0
  16. package/esm/funcs/{inquiries-delete.d.ts → forms-and-agreements-list.d.ts} +6 -3
  17. package/esm/funcs/forms-and-agreements-list.d.ts.map +1 -0
  18. package/esm/funcs/{proposals-list.js → forms-and-agreements-list.js} +8 -8
  19. package/esm/funcs/forms-and-agreements-list.js.map +1 -0
  20. package/esm/funcs/{proposals-list.d.ts → forms-get.d.ts} +4 -6
  21. package/esm/funcs/forms-get.d.ts.map +1 -0
  22. package/esm/funcs/{inquiries-get.js → forms-get.js} +7 -7
  23. package/esm/funcs/forms-get.js.map +1 -0
  24. package/esm/funcs/{inquiries-list.d.ts → forms-list.d.ts} +3 -3
  25. package/esm/funcs/forms-list.d.ts.map +1 -0
  26. package/esm/funcs/forms-list.js +138 -0
  27. package/esm/funcs/forms-list.js.map +1 -0
  28. package/esm/funcs/milestones-create.d.ts +1 -1
  29. package/esm/funcs/milestones-create.js +1 -1
  30. package/esm/hooks/types.d.ts +1 -0
  31. package/esm/hooks/types.d.ts.map +1 -1
  32. package/esm/lib/config.d.ts +3 -3
  33. package/esm/lib/config.js +3 -3
  34. package/esm/lib/sdks.d.ts.map +1 -1
  35. package/esm/lib/sdks.js +13 -4
  36. package/esm/lib/sdks.js.map +1 -1
  37. package/esm/models/api-error.d.ts +1 -0
  38. package/esm/models/api-error.d.ts.map +1 -1
  39. package/esm/models/api-error.js +1 -0
  40. package/esm/models/api-error.js.map +1 -1
  41. package/esm/models/catalog-item.d.ts +17 -0
  42. package/esm/models/catalog-item.d.ts.map +1 -1
  43. package/esm/models/catalog-item.js +15 -0
  44. package/esm/models/catalog-item.js.map +1 -1
  45. package/esm/models/client-create.d.ts +5 -1
  46. package/esm/models/client-create.d.ts.map +1 -1
  47. package/esm/models/client-create.js +5 -1
  48. package/esm/models/client-create.js.map +1 -1
  49. package/esm/models/client-document-list.d.ts +13 -0
  50. package/esm/models/client-document-list.d.ts.map +1 -0
  51. package/esm/models/client-document-list.js +16 -0
  52. package/esm/models/client-document-list.js.map +1 -0
  53. package/esm/models/client-document.d.ts +70 -0
  54. package/esm/models/client-document.d.ts.map +1 -0
  55. package/esm/models/client-document.js +45 -0
  56. package/esm/models/client-document.js.map +1 -0
  57. package/esm/models/client-update.d.ts +5 -1
  58. package/esm/models/client-update.d.ts.map +1 -1
  59. package/esm/models/client-update.js +5 -1
  60. package/esm/models/client-update.js.map +1 -1
  61. package/esm/models/client.d.ts +5 -1
  62. package/esm/models/client.d.ts.map +1 -1
  63. package/esm/models/client.js +5 -1
  64. package/esm/models/client.js.map +1 -1
  65. package/esm/models/contact.d.ts +1 -1
  66. package/esm/models/contact.d.ts.map +1 -1
  67. package/esm/models/contact.js +1 -1
  68. package/esm/models/contact.js.map +1 -1
  69. package/esm/models/contract-create.d.ts +0 -5
  70. package/esm/models/contract-create.d.ts.map +1 -1
  71. package/esm/models/contract-create.js +0 -1
  72. package/esm/models/contract-create.js.map +1 -1
  73. package/esm/models/contract.d.ts +0 -4
  74. package/esm/models/contract.d.ts.map +1 -1
  75. package/esm/models/contract.js +0 -1
  76. package/esm/models/contract.js.map +1 -1
  77. package/esm/models/form-list.d.ts +13 -0
  78. package/esm/models/form-list.d.ts.map +1 -0
  79. package/esm/models/form-list.js +17 -0
  80. package/esm/models/form-list.js.map +1 -0
  81. package/esm/models/form-submission-answer.d.ts +12 -0
  82. package/esm/models/form-submission-answer.d.ts.map +1 -0
  83. package/esm/models/form-submission-answer.js +16 -0
  84. package/esm/models/form-submission-answer.js.map +1 -0
  85. package/esm/models/form-submission-list.d.ts +13 -0
  86. package/esm/models/form-submission-list.d.ts.map +1 -0
  87. package/esm/models/form-submission-list.js +16 -0
  88. package/esm/models/form-submission-list.js.map +1 -0
  89. package/esm/models/form-submission.d.ts +54 -0
  90. package/esm/models/form-submission.d.ts.map +1 -0
  91. package/esm/models/form-submission.js +38 -0
  92. package/esm/models/form-submission.js.map +1 -0
  93. package/esm/models/form.d.ts +36 -0
  94. package/esm/models/form.d.ts.map +1 -0
  95. package/esm/models/form.js +30 -0
  96. package/esm/models/form.js.map +1 -0
  97. package/esm/models/index.d.ts +7 -8
  98. package/esm/models/index.d.ts.map +1 -1
  99. package/esm/models/index.js +7 -8
  100. package/esm/models/index.js.map +1 -1
  101. package/esm/models/milestone-create.d.ts +1 -1
  102. package/esm/models/milestone-create.js +1 -1
  103. package/esm/models/milestone-create.js.map +1 -1
  104. package/esm/models/milestone.d.ts +1 -1
  105. package/esm/models/milestone.js +1 -1
  106. package/esm/models/milestone.js.map +1 -1
  107. package/esm/models/operations/get-client-document.d.ts +27 -0
  108. package/esm/models/operations/get-client-document.d.ts.map +1 -0
  109. package/esm/models/operations/get-client-document.js +20 -0
  110. package/esm/models/operations/get-client-document.js.map +1 -0
  111. package/esm/models/operations/get-form-submission.d.ts +27 -0
  112. package/esm/models/operations/get-form-submission.d.ts.map +1 -0
  113. package/esm/models/operations/get-form-submission.js +20 -0
  114. package/esm/models/operations/get-form-submission.js.map +1 -0
  115. package/esm/models/operations/get-form.d.ts +27 -0
  116. package/esm/models/operations/get-form.d.ts.map +1 -0
  117. package/esm/models/operations/get-form.js +20 -0
  118. package/esm/models/operations/get-form.js.map +1 -0
  119. package/esm/models/operations/index.d.ts +6 -10
  120. package/esm/models/operations/index.d.ts.map +1 -1
  121. package/esm/models/operations/index.js +6 -10
  122. package/esm/models/operations/index.js.map +1 -1
  123. package/esm/models/operations/list-catalog-items.d.ts +9 -0
  124. package/esm/models/operations/list-catalog-items.d.ts.map +1 -1
  125. package/esm/models/operations/list-catalog-items.js +8 -0
  126. package/esm/models/operations/list-catalog-items.js.map +1 -1
  127. package/esm/models/operations/list-client-documents.d.ts +61 -0
  128. package/esm/models/operations/list-client-documents.d.ts.map +1 -0
  129. package/esm/models/operations/list-client-documents.js +50 -0
  130. package/esm/models/operations/list-client-documents.js.map +1 -0
  131. package/esm/models/operations/list-clients.d.ts +5 -1
  132. package/esm/models/operations/list-clients.d.ts.map +1 -1
  133. package/esm/models/operations/list-clients.js +5 -1
  134. package/esm/models/operations/list-clients.js.map +1 -1
  135. package/esm/models/operations/list-form-submissions.d.ts +64 -0
  136. package/esm/models/operations/list-form-submissions.d.ts.map +1 -0
  137. package/esm/models/operations/list-form-submissions.js +51 -0
  138. package/esm/models/operations/list-form-submissions.js.map +1 -0
  139. package/esm/models/operations/list-forms.d.ts +47 -0
  140. package/esm/models/operations/list-forms.d.ts.map +1 -0
  141. package/esm/models/operations/list-forms.js +43 -0
  142. package/esm/models/operations/list-forms.js.map +1 -0
  143. package/esm/models/operations/list-milestones.d.ts +1 -1
  144. package/esm/models/operations/list-milestones.js +1 -1
  145. package/esm/models/operations/list-milestones.js.map +1 -1
  146. package/esm/models/operations/list-payments.d.ts +4 -4
  147. package/esm/models/operations/list-payments.d.ts.map +1 -1
  148. package/esm/models/operations/list-payments.js +3 -3
  149. package/esm/models/operations/list-payments.js.map +1 -1
  150. package/esm/models/operations/list-webhooks.d.ts +10 -11
  151. package/esm/models/operations/list-webhooks.d.ts.map +1 -1
  152. package/esm/models/operations/list-webhooks.js +10 -11
  153. package/esm/models/operations/list-webhooks.js.map +1 -1
  154. package/esm/models/webhook-create.d.ts +10 -11
  155. package/esm/models/webhook-create.d.ts.map +1 -1
  156. package/esm/models/webhook-create.js +10 -11
  157. package/esm/models/webhook-create.js.map +1 -1
  158. package/esm/models/webhook-update.d.ts +10 -11
  159. package/esm/models/webhook-update.d.ts.map +1 -1
  160. package/esm/models/webhook-update.js +10 -11
  161. package/esm/models/webhook-update.js.map +1 -1
  162. package/esm/models/webhook.d.ts +10 -11
  163. package/esm/models/webhook.d.ts.map +1 -1
  164. package/esm/models/webhook.js +10 -11
  165. package/esm/models/webhook.js.map +1 -1
  166. package/esm/sdk/form-submissions.d.ts +20 -0
  167. package/esm/sdk/form-submissions.d.ts.map +1 -0
  168. package/esm/sdk/form-submissions.js +26 -0
  169. package/esm/sdk/form-submissions.js.map +1 -0
  170. package/esm/sdk/forms-and-agreements.d.ts +17 -0
  171. package/esm/sdk/forms-and-agreements.d.ts.map +1 -0
  172. package/esm/sdk/forms-and-agreements.js +23 -0
  173. package/esm/sdk/forms-and-agreements.js.map +1 -0
  174. package/esm/sdk/forms.d.ts +17 -0
  175. package/esm/sdk/forms.d.ts.map +1 -0
  176. package/esm/sdk/forms.js +23 -0
  177. package/esm/sdk/forms.js.map +1 -0
  178. package/esm/sdk/milestones.d.ts +1 -1
  179. package/esm/sdk/milestones.js +1 -1
  180. package/esm/sdk/sdk.d.ts +9 -6
  181. package/esm/sdk/sdk.d.ts.map +1 -1
  182. package/esm/sdk/sdk.js +15 -10
  183. package/esm/sdk/sdk.js.map +1 -1
  184. package/jsr.json +1 -1
  185. package/package.json +1 -1
  186. package/src/funcs/catalog-items-list.ts +1 -0
  187. package/src/funcs/{proposals-delete.ts → form-submissions-get.ts} +16 -14
  188. package/src/funcs/form-submissions-list.ts +284 -0
  189. package/src/funcs/{proposals-get.ts → forms-and-agreements-get.ts} +13 -12
  190. package/src/funcs/{proposals-list.ts → forms-and-agreements-list.ts} +15 -15
  191. package/src/funcs/{inquiries-get.ts → forms-get.ts} +13 -13
  192. package/src/funcs/{inquiries-list.ts → forms-list.ts} +17 -22
  193. package/src/funcs/milestones-create.ts +1 -1
  194. package/src/hooks/types.ts +1 -0
  195. package/src/lib/config.ts +3 -3
  196. package/src/lib/sdks.ts +13 -4
  197. package/src/models/api-error.ts +1 -0
  198. package/src/models/catalog-item.ts +28 -0
  199. package/src/models/client-create.ts +5 -1
  200. package/src/models/client-document-list.ts +40 -0
  201. package/src/models/client-document.ts +114 -0
  202. package/src/models/client-update.ts +5 -1
  203. package/src/models/client.ts +5 -1
  204. package/src/models/contact.ts +2 -2
  205. package/src/models/contract-create.ts +0 -6
  206. package/src/models/contract.ts +0 -5
  207. package/src/models/{inquiry-list.ts → form-list.ts} +9 -9
  208. package/src/models/form-submission-answer.ts +35 -0
  209. package/src/models/form-submission-list.ts +40 -0
  210. package/src/models/form-submission.ts +99 -0
  211. package/src/models/form.ts +67 -0
  212. package/src/models/index.ts +7 -8
  213. package/src/models/milestone-create.ts +1 -1
  214. package/src/models/milestone.ts +1 -1
  215. package/src/models/operations/get-client-document.ts +61 -0
  216. package/src/models/operations/get-form-submission.ts +61 -0
  217. package/src/models/operations/get-form.ts +55 -0
  218. package/src/models/operations/index.ts +6 -10
  219. package/src/models/operations/list-catalog-items.ts +13 -0
  220. package/src/models/operations/list-client-documents.ts +132 -0
  221. package/src/models/operations/list-clients.ts +5 -1
  222. package/src/models/operations/list-form-submissions.ts +142 -0
  223. package/src/models/operations/list-forms.ts +112 -0
  224. package/src/models/operations/list-milestones.ts +1 -1
  225. package/src/models/operations/list-payments.ts +7 -5
  226. package/src/models/operations/list-webhooks.ts +10 -11
  227. package/src/models/webhook-create.ts +10 -11
  228. package/src/models/webhook-update.ts +10 -11
  229. package/src/models/webhook.ts +10 -11
  230. package/src/sdk/form-submissions.ts +50 -0
  231. package/src/sdk/forms-and-agreements.ts +47 -0
  232. package/src/sdk/forms.ts +45 -0
  233. package/src/sdk/milestones.ts +1 -1
  234. package/src/sdk/sdk.ts +18 -12
  235. package/esm/funcs/inquiries-create.d.ts +0 -19
  236. package/esm/funcs/inquiries-create.d.ts.map +0 -1
  237. package/esm/funcs/inquiries-create.js +0 -96
  238. package/esm/funcs/inquiries-create.js.map +0 -1
  239. package/esm/funcs/inquiries-delete.d.ts.map +0 -1
  240. package/esm/funcs/inquiries-delete.js.map +0 -1
  241. package/esm/funcs/inquiries-get.d.ts.map +0 -1
  242. package/esm/funcs/inquiries-get.js.map +0 -1
  243. package/esm/funcs/inquiries-list.d.ts.map +0 -1
  244. package/esm/funcs/inquiries-list.js.map +0 -1
  245. package/esm/funcs/inquiries-update.d.ts +0 -19
  246. package/esm/funcs/inquiries-update.d.ts.map +0 -1
  247. package/esm/funcs/inquiries-update.js +0 -111
  248. package/esm/funcs/inquiries-update.js.map +0 -1
  249. package/esm/funcs/proposals-create.d.ts +0 -19
  250. package/esm/funcs/proposals-create.d.ts.map +0 -1
  251. package/esm/funcs/proposals-create.js +0 -96
  252. package/esm/funcs/proposals-create.js.map +0 -1
  253. package/esm/funcs/proposals-delete.d.ts +0 -15
  254. package/esm/funcs/proposals-delete.d.ts.map +0 -1
  255. package/esm/funcs/proposals-delete.js +0 -106
  256. package/esm/funcs/proposals-delete.js.map +0 -1
  257. package/esm/funcs/proposals-get.d.ts.map +0 -1
  258. package/esm/funcs/proposals-get.js.map +0 -1
  259. package/esm/funcs/proposals-list.d.ts.map +0 -1
  260. package/esm/funcs/proposals-list.js.map +0 -1
  261. package/esm/funcs/proposals-update.d.ts +0 -19
  262. package/esm/funcs/proposals-update.d.ts.map +0 -1
  263. package/esm/funcs/proposals-update.js +0 -111
  264. package/esm/funcs/proposals-update.js.map +0 -1
  265. package/esm/models/inquiry-create.d.ts +0 -45
  266. package/esm/models/inquiry-create.d.ts.map +0 -1
  267. package/esm/models/inquiry-create.js +0 -28
  268. package/esm/models/inquiry-create.js.map +0 -1
  269. package/esm/models/inquiry-list.d.ts +0 -13
  270. package/esm/models/inquiry-list.d.ts.map +0 -1
  271. package/esm/models/inquiry-list.js +0 -17
  272. package/esm/models/inquiry-list.js.map +0 -1
  273. package/esm/models/inquiry-update.d.ts +0 -45
  274. package/esm/models/inquiry-update.d.ts.map +0 -1
  275. package/esm/models/inquiry-update.js +0 -29
  276. package/esm/models/inquiry-update.js.map +0 -1
  277. package/esm/models/inquiry.d.ts +0 -78
  278. package/esm/models/inquiry.d.ts.map +0 -1
  279. package/esm/models/inquiry.js +0 -51
  280. package/esm/models/inquiry.js.map +0 -1
  281. package/esm/models/operations/create-inquiry.d.ts +0 -30
  282. package/esm/models/operations/create-inquiry.d.ts.map +0 -1
  283. package/esm/models/operations/create-inquiry.js +0 -27
  284. package/esm/models/operations/create-inquiry.js.map +0 -1
  285. package/esm/models/operations/create-proposal.d.ts +0 -30
  286. package/esm/models/operations/create-proposal.d.ts.map +0 -1
  287. package/esm/models/operations/create-proposal.js +0 -27
  288. package/esm/models/operations/create-proposal.js.map +0 -1
  289. package/esm/models/operations/delete-inquiry.d.ts +0 -27
  290. package/esm/models/operations/delete-inquiry.d.ts.map +0 -1
  291. package/esm/models/operations/delete-inquiry.js +0 -20
  292. package/esm/models/operations/delete-inquiry.js.map +0 -1
  293. package/esm/models/operations/delete-proposal.d.ts +0 -27
  294. package/esm/models/operations/delete-proposal.d.ts.map +0 -1
  295. package/esm/models/operations/delete-proposal.js +0 -20
  296. package/esm/models/operations/delete-proposal.js.map +0 -1
  297. package/esm/models/operations/get-inquiry.d.ts +0 -27
  298. package/esm/models/operations/get-inquiry.d.ts.map +0 -1
  299. package/esm/models/operations/get-inquiry.js +0 -20
  300. package/esm/models/operations/get-inquiry.js.map +0 -1
  301. package/esm/models/operations/get-proposal.d.ts +0 -27
  302. package/esm/models/operations/get-proposal.d.ts.map +0 -1
  303. package/esm/models/operations/get-proposal.js +0 -20
  304. package/esm/models/operations/get-proposal.js.map +0 -1
  305. package/esm/models/operations/list-inquiries.d.ts +0 -60
  306. package/esm/models/operations/list-inquiries.d.ts.map +0 -1
  307. package/esm/models/operations/list-inquiries.js +0 -55
  308. package/esm/models/operations/list-inquiries.js.map +0 -1
  309. package/esm/models/operations/list-proposals.d.ts +0 -56
  310. package/esm/models/operations/list-proposals.d.ts.map +0 -1
  311. package/esm/models/operations/list-proposals.js +0 -48
  312. package/esm/models/operations/list-proposals.js.map +0 -1
  313. package/esm/models/operations/update-inquiry.d.ts +0 -30
  314. package/esm/models/operations/update-inquiry.d.ts.map +0 -1
  315. package/esm/models/operations/update-inquiry.js +0 -22
  316. package/esm/models/operations/update-inquiry.js.map +0 -1
  317. package/esm/models/operations/update-proposal.d.ts +0 -30
  318. package/esm/models/operations/update-proposal.d.ts.map +0 -1
  319. package/esm/models/operations/update-proposal.js +0 -22
  320. package/esm/models/operations/update-proposal.js.map +0 -1
  321. package/esm/models/proposal-create.d.ts +0 -45
  322. package/esm/models/proposal-create.d.ts.map +0 -1
  323. package/esm/models/proposal-create.js +0 -26
  324. package/esm/models/proposal-create.js.map +0 -1
  325. package/esm/models/proposal-list.d.ts +0 -13
  326. package/esm/models/proposal-list.d.ts.map +0 -1
  327. package/esm/models/proposal-list.js +0 -16
  328. package/esm/models/proposal-list.js.map +0 -1
  329. package/esm/models/proposal-update.d.ts +0 -43
  330. package/esm/models/proposal-update.d.ts.map +0 -1
  331. package/esm/models/proposal-update.js +0 -27
  332. package/esm/models/proposal-update.js.map +0 -1
  333. package/esm/models/proposal.d.ts +0 -70
  334. package/esm/models/proposal.d.ts.map +0 -1
  335. package/esm/models/proposal.js +0 -52
  336. package/esm/models/proposal.js.map +0 -1
  337. package/esm/sdk/inquiries.d.ts +0 -35
  338. package/esm/sdk/inquiries.d.ts.map +0 -1
  339. package/esm/sdk/inquiries.js +0 -50
  340. package/esm/sdk/inquiries.js.map +0 -1
  341. package/esm/sdk/proposals.d.ts +0 -35
  342. package/esm/sdk/proposals.d.ts.map +0 -1
  343. package/esm/sdk/proposals.js +0 -50
  344. package/esm/sdk/proposals.js.map +0 -1
  345. package/src/funcs/inquiries-create.ts +0 -195
  346. package/src/funcs/inquiries-delete.ts +0 -201
  347. package/src/funcs/inquiries-update.ts +0 -206
  348. package/src/funcs/proposals-create.ts +0 -195
  349. package/src/funcs/proposals-update.ts +0 -206
  350. package/src/models/inquiry-create.ts +0 -72
  351. package/src/models/inquiry-update.ts +0 -80
  352. package/src/models/inquiry.ts +0 -123
  353. package/src/models/operations/create-inquiry.ts +0 -73
  354. package/src/models/operations/create-proposal.ts +0 -73
  355. package/src/models/operations/delete-inquiry.ts +0 -61
  356. package/src/models/operations/delete-proposal.ts +0 -61
  357. package/src/models/operations/get-inquiry.ts +0 -61
  358. package/src/models/operations/get-proposal.ts +0 -61
  359. package/src/models/operations/list-inquiries.ts +0 -130
  360. package/src/models/operations/list-proposals.ts +0 -123
  361. package/src/models/operations/update-inquiry.ts +0 -65
  362. package/src/models/operations/update-proposal.ts +0 -65
  363. package/src/models/proposal-create.ts +0 -86
  364. package/src/models/proposal-list.ts +0 -35
  365. package/src/models/proposal-update.ts +0 -84
  366. package/src/models/proposal.ts +0 -120
  367. package/src/sdk/inquiries.ts +0 -102
  368. package/src/sdk/proposals.ts +0 -102
@@ -1,195 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { ClientCasaCore } from "../core.js";
7
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
8
- import { matchStatusCode } from "../lib/http.js";
9
- import * as M from "../lib/matchers.js";
10
- import { compactMap } from "../lib/primitives.js";
11
- import { safeParse } from "../lib/schemas.js";
12
- import { RequestOptions } from "../lib/sdks.js";
13
- import { resolveSecurity } from "../lib/security.js";
14
- import { pathToFunc } from "../lib/url.js";
15
- import { ClientCasaError } from "../models/errors/client-casa-error.js";
16
- import {
17
- ConnectionError,
18
- InvalidRequestError,
19
- RequestAbortedError,
20
- RequestTimeoutError,
21
- UnexpectedClientError,
22
- } from "../models/errors/http-client-errors.js";
23
- import * as errors from "../models/errors/index.js";
24
- import { ResponseValidationError } from "../models/errors/response-validation-error.js";
25
- import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
- import * as models from "../models/index.js";
27
- import * as operations from "../models/operations/index.js";
28
- import { APICall, APIPromise } from "../types/async.js";
29
- import { Result } from "../types/fp.js";
30
-
31
- /**
32
- * Create a proposal (metadata only — rich-text content is dashboard-managed)
33
- *
34
- * @remarks
35
- * Creates a draft proposal. The narrative content (Tiptap document) and line items are not editable via the v1 API; use the dashboard.
36
- */
37
- export function proposalsCreate(
38
- client: ClientCasaCore,
39
- security: operations.CreateProposalSecurity,
40
- request: operations.CreateProposalRequest,
41
- options?: RequestOptions,
42
- ): APIPromise<
43
- Result<
44
- models.Proposal,
45
- | errors.ApiError
46
- | ClientCasaError
47
- | ResponseValidationError
48
- | ConnectionError
49
- | RequestAbortedError
50
- | RequestTimeoutError
51
- | InvalidRequestError
52
- | UnexpectedClientError
53
- | SDKValidationError
54
- >
55
- > {
56
- return new APIPromise($do(
57
- client,
58
- security,
59
- request,
60
- options,
61
- ));
62
- }
63
-
64
- async function $do(
65
- client: ClientCasaCore,
66
- security: operations.CreateProposalSecurity,
67
- request: operations.CreateProposalRequest,
68
- options?: RequestOptions,
69
- ): Promise<
70
- [
71
- Result<
72
- models.Proposal,
73
- | errors.ApiError
74
- | ClientCasaError
75
- | ResponseValidationError
76
- | ConnectionError
77
- | RequestAbortedError
78
- | RequestTimeoutError
79
- | InvalidRequestError
80
- | UnexpectedClientError
81
- | SDKValidationError
82
- >,
83
- APICall,
84
- ]
85
- > {
86
- const parsed = safeParse(
87
- request,
88
- (value) => z.parse(operations.CreateProposalRequest$outboundSchema, value),
89
- "Input validation failed",
90
- );
91
- if (!parsed.ok) {
92
- return [parsed, { status: "invalid" }];
93
- }
94
- const payload = parsed.value;
95
- const body = encodeJSON("body", payload.body, { explode: true });
96
-
97
- const path = pathToFunc("/api/v1/proposals")();
98
-
99
- const headers = new Headers(compactMap({
100
- "Content-Type": "application/json",
101
- Accept: "application/json",
102
- "Idempotency-Key": encodeSimple(
103
- "Idempotency-Key",
104
- payload["Idempotency-Key"],
105
- { explode: false, charEncoding: "none" },
106
- ),
107
- }));
108
-
109
- const requestSecurity = resolveSecurity(
110
- [
111
- {
112
- fieldName: "x-api-key",
113
- type: "apiKey:header",
114
- value: security?.apiKey,
115
- },
116
- ],
117
- [
118
- {
119
- fieldName: "Authorization",
120
- type: "http:bearer",
121
- value: security?.bearer,
122
- },
123
- ],
124
- );
125
-
126
- const context = {
127
- options: client._options,
128
- baseURL: options?.serverURL ?? client._baseURL ?? "",
129
- operationID: "createProposal",
130
- oAuth2Scopes: null,
131
-
132
- resolvedSecurity: requestSecurity,
133
-
134
- securitySource: security,
135
- retryConfig: options?.retries
136
- || client._options.retryConfig
137
- || { strategy: "none" },
138
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
139
- };
140
-
141
- const requestRes = client._createRequest(context, {
142
- security: requestSecurity,
143
- method: "POST",
144
- baseURL: options?.serverURL,
145
- path: path,
146
- headers: headers,
147
- body: body,
148
- userAgent: client._options.userAgent,
149
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
150
- }, options);
151
- if (!requestRes.ok) {
152
- return [requestRes, { status: "invalid" }];
153
- }
154
- const req = requestRes.value;
155
-
156
- const doResult = await client._do(req, {
157
- context,
158
- isErrorStatusCode: (statusCode: number) =>
159
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
160
- retryConfig: context.retryConfig,
161
- retryCodes: context.retryCodes,
162
- });
163
- if (!doResult.ok) {
164
- return [doResult, { status: "request-error", request: req }];
165
- }
166
- const response = doResult.value;
167
-
168
- const responseFields = {
169
- HttpMeta: { Response: response, Request: req },
170
- };
171
-
172
- const [result] = await M.match<
173
- models.Proposal,
174
- | errors.ApiError
175
- | ClientCasaError
176
- | ResponseValidationError
177
- | ConnectionError
178
- | RequestAbortedError
179
- | RequestTimeoutError
180
- | InvalidRequestError
181
- | UnexpectedClientError
182
- | SDKValidationError
183
- >(
184
- M.json(201, models.Proposal$inboundSchema),
185
- M.jsonErr([400, 401, 403, 409, 429], errors.ApiError$inboundSchema),
186
- M.jsonErr(500, errors.ApiError$inboundSchema),
187
- M.fail("4XX"),
188
- M.fail("5XX"),
189
- )(response, req, { extraFields: responseFields });
190
- if (!result.ok) {
191
- return [result, { status: "complete", request: req, response }];
192
- }
193
-
194
- return [result, { status: "complete", request: req, response }];
195
- }
@@ -1,206 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { ClientCasaCore } from "../core.js";
7
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
8
- import { matchStatusCode } from "../lib/http.js";
9
- import * as M from "../lib/matchers.js";
10
- import { compactMap } from "../lib/primitives.js";
11
- import { safeParse } from "../lib/schemas.js";
12
- import { RequestOptions } from "../lib/sdks.js";
13
- import { resolveSecurity } from "../lib/security.js";
14
- import { pathToFunc } from "../lib/url.js";
15
- import { ClientCasaError } from "../models/errors/client-casa-error.js";
16
- import {
17
- ConnectionError,
18
- InvalidRequestError,
19
- RequestAbortedError,
20
- RequestTimeoutError,
21
- UnexpectedClientError,
22
- } from "../models/errors/http-client-errors.js";
23
- import * as errors from "../models/errors/index.js";
24
- import { ResponseValidationError } from "../models/errors/response-validation-error.js";
25
- import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
- import * as models from "../models/index.js";
27
- import * as operations from "../models/operations/index.js";
28
- import { APICall, APIPromise } from "../types/async.js";
29
- import { Result } from "../types/fp.js";
30
-
31
- /**
32
- * Update a proposal
33
- *
34
- * @remarks
35
- * Status transitions to `accepted`/`rejected`/`expired` are system-driven; do not set them directly.
36
- */
37
- export function proposalsUpdate(
38
- client: ClientCasaCore,
39
- security: operations.UpdateProposalSecurity,
40
- request: operations.UpdateProposalRequest,
41
- options?: RequestOptions,
42
- ): APIPromise<
43
- Result<
44
- models.Proposal,
45
- | errors.ApiError
46
- | ClientCasaError
47
- | ResponseValidationError
48
- | ConnectionError
49
- | RequestAbortedError
50
- | RequestTimeoutError
51
- | InvalidRequestError
52
- | UnexpectedClientError
53
- | SDKValidationError
54
- >
55
- > {
56
- return new APIPromise($do(
57
- client,
58
- security,
59
- request,
60
- options,
61
- ));
62
- }
63
-
64
- async function $do(
65
- client: ClientCasaCore,
66
- security: operations.UpdateProposalSecurity,
67
- request: operations.UpdateProposalRequest,
68
- options?: RequestOptions,
69
- ): Promise<
70
- [
71
- Result<
72
- models.Proposal,
73
- | errors.ApiError
74
- | ClientCasaError
75
- | ResponseValidationError
76
- | ConnectionError
77
- | RequestAbortedError
78
- | RequestTimeoutError
79
- | InvalidRequestError
80
- | UnexpectedClientError
81
- | SDKValidationError
82
- >,
83
- APICall,
84
- ]
85
- > {
86
- const parsed = safeParse(
87
- request,
88
- (value) => z.parse(operations.UpdateProposalRequest$outboundSchema, value),
89
- "Input validation failed",
90
- );
91
- if (!parsed.ok) {
92
- return [parsed, { status: "invalid" }];
93
- }
94
- const payload = parsed.value;
95
- const body = encodeJSON("body", payload.body, { explode: true });
96
-
97
- const pathParams = {
98
- id: encodeSimple("id", payload.id, {
99
- explode: false,
100
- charEncoding: "percent",
101
- }),
102
- };
103
- const path = pathToFunc("/api/v1/proposals/{id}")(pathParams);
104
-
105
- const headers = new Headers(compactMap({
106
- "Content-Type": "application/json",
107
- Accept: "application/json",
108
- }));
109
-
110
- const requestSecurity = resolveSecurity(
111
- [
112
- {
113
- fieldName: "x-api-key",
114
- type: "apiKey:header",
115
- value: security?.apiKey,
116
- },
117
- ],
118
- [
119
- {
120
- fieldName: "Authorization",
121
- type: "http:bearer",
122
- value: security?.bearer,
123
- },
124
- ],
125
- );
126
-
127
- const context = {
128
- options: client._options,
129
- baseURL: options?.serverURL ?? client._baseURL ?? "",
130
- operationID: "updateProposal",
131
- oAuth2Scopes: null,
132
-
133
- resolvedSecurity: requestSecurity,
134
-
135
- securitySource: security,
136
- retryConfig: options?.retries
137
- || client._options.retryConfig
138
- || {
139
- strategy: "backoff",
140
- backoff: {
141
- initialInterval: 500,
142
- maxInterval: 30000,
143
- exponent: 1.5,
144
- maxElapsedTime: 30000,
145
- },
146
- retryConnectionErrors: true,
147
- }
148
- || { strategy: "none" },
149
- retryCodes: options?.retryCodes || ["429", "5XX"],
150
- };
151
-
152
- const requestRes = client._createRequest(context, {
153
- security: requestSecurity,
154
- method: "PATCH",
155
- baseURL: options?.serverURL,
156
- path: path,
157
- headers: headers,
158
- body: body,
159
- userAgent: client._options.userAgent,
160
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
161
- }, options);
162
- if (!requestRes.ok) {
163
- return [requestRes, { status: "invalid" }];
164
- }
165
- const req = requestRes.value;
166
-
167
- const doResult = await client._do(req, {
168
- context,
169
- isErrorStatusCode: (statusCode: number) =>
170
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
171
- retryConfig: context.retryConfig,
172
- retryCodes: context.retryCodes,
173
- });
174
- if (!doResult.ok) {
175
- return [doResult, { status: "request-error", request: req }];
176
- }
177
- const response = doResult.value;
178
-
179
- const responseFields = {
180
- HttpMeta: { Response: response, Request: req },
181
- };
182
-
183
- const [result] = await M.match<
184
- models.Proposal,
185
- | errors.ApiError
186
- | ClientCasaError
187
- | ResponseValidationError
188
- | ConnectionError
189
- | RequestAbortedError
190
- | RequestTimeoutError
191
- | InvalidRequestError
192
- | UnexpectedClientError
193
- | SDKValidationError
194
- >(
195
- M.json(200, models.Proposal$inboundSchema),
196
- M.jsonErr([400, 401, 403, 404, 429], errors.ApiError$inboundSchema),
197
- M.jsonErr(500, errors.ApiError$inboundSchema),
198
- M.fail("4XX"),
199
- M.fail("5XX"),
200
- )(response, req, { extraFields: responseFields });
201
- if (!result.ok) {
202
- return [result, { status: "complete", request: req, response }];
203
- }
204
-
205
- return [result, { status: "complete", request: req, response }];
206
- }
@@ -1,72 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { ClosedEnum } from "../types/enums.js";
7
-
8
- export const InquiryCreateSource = {
9
- InquiryForm: "inquiry_form",
10
- Manual: "manual",
11
- Referral: "referral",
12
- Other: "other",
13
- } as const;
14
- export type InquiryCreateSource = ClosedEnum<typeof InquiryCreateSource>;
15
-
16
- export type InquiryCreate = {
17
- name: string;
18
- email: string;
19
- phone?: string | undefined;
20
- preferredDate?: Date | undefined;
21
- message?: string | undefined;
22
- source?: InquiryCreateSource | undefined;
23
- customAnswers?: { [k: string]: any } | undefined;
24
- /**
25
- * UUID v4
26
- */
27
- contactId?: string | undefined;
28
- notes?: string | undefined;
29
- };
30
-
31
- /** @internal */
32
- export const InquiryCreateSource$outboundSchema: z.ZodMiniEnum<
33
- typeof InquiryCreateSource
34
- > = z.enum(InquiryCreateSource);
35
-
36
- /** @internal */
37
- export type InquiryCreate$Outbound = {
38
- name: string;
39
- email: string;
40
- phone?: string | undefined;
41
- preferredDate?: string | undefined;
42
- message?: string | undefined;
43
- source: string;
44
- customAnswers?: { [k: string]: any } | undefined;
45
- contactId?: string | undefined;
46
- notes?: string | undefined;
47
- };
48
-
49
- /** @internal */
50
- export const InquiryCreate$outboundSchema: z.ZodMiniType<
51
- InquiryCreate$Outbound,
52
- InquiryCreate
53
- > = z.object({
54
- name: z.string(),
55
- email: z.string(),
56
- phone: z.optional(z.string()),
57
- preferredDate: z.optional(
58
- z.pipe(
59
- z.date(),
60
- z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
61
- ),
62
- ),
63
- message: z.optional(z.string()),
64
- source: z._default(InquiryCreateSource$outboundSchema, "manual"),
65
- customAnswers: z.optional(z.record(z.string(), z.any())),
66
- contactId: z.optional(z.string()),
67
- notes: z.optional(z.string()),
68
- });
69
-
70
- export function inquiryCreateToJSON(inquiryCreate: InquiryCreate): string {
71
- return JSON.stringify(InquiryCreate$outboundSchema.parse(inquiryCreate));
72
- }
@@ -1,80 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { ClosedEnum } from "../types/enums.js";
7
-
8
- export const InquiryUpdateStatus = {
9
- New: "new",
10
- Contacted: "contacted",
11
- Qualified: "qualified",
12
- Declined: "declined",
13
- Spam: "spam",
14
- } as const;
15
- export type InquiryUpdateStatus = ClosedEnum<typeof InquiryUpdateStatus>;
16
-
17
- export type InquiryUpdate = {
18
- status?: InquiryUpdateStatus | undefined;
19
- name?: string | undefined;
20
- email?: string | null | undefined;
21
- phone?: string | null | undefined;
22
- preferredDate?: Date | null | undefined;
23
- message?: string | null | undefined;
24
- /**
25
- * ISO 8601 timestamp (UTC)
26
- */
27
- lastContactedAt?: Date | null | undefined;
28
- /**
29
- * ISO 8601 timestamp (UTC)
30
- */
31
- nextFollowUpAt?: Date | null | undefined;
32
- notes?: string | null | undefined;
33
- };
34
-
35
- /** @internal */
36
- export const InquiryUpdateStatus$outboundSchema: z.ZodMiniEnum<
37
- typeof InquiryUpdateStatus
38
- > = z.enum(InquiryUpdateStatus);
39
-
40
- /** @internal */
41
- export type InquiryUpdate$Outbound = {
42
- status?: string | undefined;
43
- name?: string | undefined;
44
- email?: string | null | undefined;
45
- phone?: string | null | undefined;
46
- preferredDate?: string | null | undefined;
47
- message?: string | null | undefined;
48
- lastContactedAt?: string | null | undefined;
49
- nextFollowUpAt?: string | null | undefined;
50
- notes?: string | null | undefined;
51
- };
52
-
53
- /** @internal */
54
- export const InquiryUpdate$outboundSchema: z.ZodMiniType<
55
- InquiryUpdate$Outbound,
56
- InquiryUpdate
57
- > = z.object({
58
- status: z.optional(InquiryUpdateStatus$outboundSchema),
59
- name: z.optional(z.string()),
60
- email: z.optional(z.nullable(z.string())),
61
- phone: z.optional(z.nullable(z.string())),
62
- preferredDate: z.optional(
63
- z.nullable(z.pipe(
64
- z.date(),
65
- z.transform(v => v.toISOString().slice(0, "YYYY-MM-DD".length)),
66
- )),
67
- ),
68
- message: z.optional(z.nullable(z.string())),
69
- lastContactedAt: z.optional(
70
- z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
71
- ),
72
- nextFollowUpAt: z.optional(
73
- z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
74
- ),
75
- notes: z.optional(z.nullable(z.string())),
76
- });
77
-
78
- export function inquiryUpdateToJSON(inquiryUpdate: InquiryUpdate): string {
79
- return JSON.stringify(InquiryUpdate$outboundSchema.parse(inquiryUpdate));
80
- }
@@ -1,123 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v4-mini";
6
- import { safeParse } from "../lib/schemas.js";
7
- import * as openEnums from "../types/enums.js";
8
- import { OpenEnum } from "../types/enums.js";
9
- import { Result as SafeParseResult } from "../types/fp.js";
10
- import * as types from "../types/primitives.js";
11
- import { SDKValidationError } from "./errors/sdk-validation-error.js";
12
-
13
- export const InquiryStatus = {
14
- New: "new",
15
- Contacted: "contacted",
16
- Qualified: "qualified",
17
- Converted: "converted",
18
- Declined: "declined",
19
- Spam: "spam",
20
- } as const;
21
- export type InquiryStatus = OpenEnum<typeof InquiryStatus>;
22
-
23
- export const InquirySource = {
24
- InquiryForm: "inquiry_form",
25
- Manual: "manual",
26
- Referral: "referral",
27
- Other: "other",
28
- } as const;
29
- export type InquirySource = OpenEnum<typeof InquirySource>;
30
-
31
- export type Inquiry = {
32
- /**
33
- * UUID v4
34
- */
35
- id: string;
36
- name: string;
37
- email: string | null;
38
- phone: string | null;
39
- /**
40
- * UUID v4
41
- */
42
- contactId: string | null;
43
- inquirySlug: string | null;
44
- preferredDate: Date | null;
45
- message: string | null;
46
- status: InquiryStatus;
47
- source: InquirySource;
48
- customAnswers: { [k: string]: any } | null;
49
- /**
50
- * UUID v4
51
- */
52
- convertedClientId: string | null;
53
- /**
54
- * UUID v4
55
- */
56
- convertedProjectId: string | null;
57
- /**
58
- * ISO 8601 timestamp (UTC)
59
- */
60
- convertedAt: Date | null;
61
- /**
62
- * ISO 8601 timestamp (UTC)
63
- */
64
- lastContactedAt: Date | null;
65
- /**
66
- * ISO 8601 timestamp (UTC)
67
- */
68
- nextFollowUpAt: Date | null;
69
- notes: string | null;
70
- /**
71
- * ISO 8601 timestamp (UTC)
72
- */
73
- createdAt: Date;
74
- /**
75
- * ISO 8601 timestamp (UTC)
76
- */
77
- updatedAt: Date;
78
- };
79
-
80
- /** @internal */
81
- export const InquiryStatus$inboundSchema: z.ZodMiniType<
82
- InquiryStatus,
83
- unknown
84
- > = openEnums.inboundSchema(InquiryStatus);
85
-
86
- /** @internal */
87
- export const InquirySource$inboundSchema: z.ZodMiniType<
88
- InquirySource,
89
- unknown
90
- > = openEnums.inboundSchema(InquirySource);
91
-
92
- /** @internal */
93
- export const Inquiry$inboundSchema: z.ZodMiniType<Inquiry, unknown> = z.object({
94
- id: types.string(),
95
- name: types.string(),
96
- email: types.nullable(types.string()),
97
- phone: types.nullable(types.string()),
98
- contactId: types.nullable(types.string()),
99
- inquirySlug: types.nullable(types.string()),
100
- preferredDate: types.nullable(types.date()),
101
- message: types.nullable(types.string()),
102
- status: InquiryStatus$inboundSchema,
103
- source: InquirySource$inboundSchema,
104
- customAnswers: types.nullable(z.record(z.string(), z.any())),
105
- convertedClientId: types.nullable(types.string()),
106
- convertedProjectId: types.nullable(types.string()),
107
- convertedAt: types.nullable(types.date()),
108
- lastContactedAt: types.nullable(types.date()),
109
- nextFollowUpAt: types.nullable(types.date()),
110
- notes: types.nullable(types.string()),
111
- createdAt: types.date(),
112
- updatedAt: types.date(),
113
- });
114
-
115
- export function inquiryFromJSON(
116
- jsonString: string,
117
- ): SafeParseResult<Inquiry, SDKValidationError> {
118
- return safeParse(
119
- jsonString,
120
- (x) => Inquiry$inboundSchema.parse(JSON.parse(x)),
121
- `Failed to parse 'Inquiry' from JSON`,
122
- );
123
- }