rcs-js 2.0.19 → 2.0.21

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 (304) hide show
  1. package/dist/cjs/Client.d.ts +3 -0
  2. package/dist/cjs/Client.js +19 -14
  3. package/dist/cjs/api/resources/forms/client/Client.d.ts +171 -0
  4. package/dist/cjs/api/resources/forms/client/Client.js +500 -0
  5. package/dist/cjs/api/resources/forms/client/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/forms/client/index.js +17 -0
  7. package/dist/cjs/api/resources/forms/client/requests/ListFormsParams.d.ts +13 -0
  8. package/dist/cjs/api/resources/forms/client/requests/ListFormsParams.js +3 -0
  9. package/dist/cjs/api/resources/forms/client/requests/UpdateFormParams.d.ts +25 -0
  10. package/dist/cjs/api/resources/forms/client/requests/UpdateFormParams.js +3 -0
  11. package/dist/cjs/api/resources/forms/client/requests/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/forms/client/requests/index.js +2 -0
  13. package/dist/cjs/api/resources/forms/index.d.ts +3 -0
  14. package/dist/cjs/api/resources/forms/index.js +19 -0
  15. package/dist/cjs/api/resources/forms/resources/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/forms/resources/index.js +41 -0
  17. package/dist/cjs/api/resources/forms/resources/submissions/client/Client.d.ts +35 -0
  18. package/dist/cjs/api/resources/forms/resources/submissions/client/Client.js +141 -0
  19. package/dist/cjs/api/resources/forms/resources/submissions/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/forms/resources/submissions/client/index.js +17 -0
  21. package/dist/cjs/api/resources/forms/resources/submissions/client/requests/ListFormSubmissionsParams.d.ts +13 -0
  22. package/dist/cjs/api/resources/forms/resources/submissions/client/requests/ListFormSubmissionsParams.js +3 -0
  23. package/dist/cjs/api/resources/forms/resources/submissions/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/forms/resources/submissions/client/requests/index.js +2 -0
  25. package/dist/cjs/api/resources/forms/resources/submissions/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/forms/resources/submissions/index.js +17 -0
  27. package/dist/cjs/api/resources/forms/types/FormsSendResponse.d.ts +2 -0
  28. package/dist/cjs/api/resources/forms/types/FormsSendResponse.js +3 -0
  29. package/dist/cjs/api/resources/forms/types/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/forms/types/index.js +17 -0
  31. package/dist/cjs/api/resources/index.d.ts +3 -0
  32. package/dist/cjs/api/resources/index.js +4 -1
  33. package/dist/cjs/api/resources/webhooks/client/requests/AttachWebhookParams.d.ts +1 -1
  34. package/dist/cjs/api/types/AddressField.d.ts +14 -0
  35. package/dist/cjs/api/types/AddressField.js +3 -0
  36. package/dist/cjs/api/types/AgentSummary.d.ts +16 -2
  37. package/dist/cjs/api/types/CampaignStatusEvent.d.ts +19 -0
  38. package/dist/cjs/api/types/CampaignStatusEvent.js +3 -0
  39. package/dist/cjs/api/types/CampaignStatusEventAgent.d.ts +9 -0
  40. package/dist/cjs/api/types/CampaignStatusEventAgent.js +3 -0
  41. package/dist/cjs/api/types/CampaignStatusEventBrand.d.ts +9 -0
  42. package/dist/cjs/api/types/CampaignStatusEventBrand.js +3 -0
  43. package/dist/cjs/api/types/CampaignStatusEventCampaign.d.ts +18 -0
  44. package/dist/cjs/api/types/CampaignStatusEventCampaign.js +13 -0
  45. package/dist/cjs/api/types/CampaignStatusEventCarrierLaunches.d.ts +48 -0
  46. package/dist/cjs/api/types/CampaignStatusEventCarrierLaunches.js +3 -0
  47. package/dist/cjs/api/types/CarrierLaunchStatus.d.ts +4 -4
  48. package/dist/cjs/api/types/CarrierLaunchStatus.js +4 -4
  49. package/dist/cjs/api/types/CarrierLaunches.d.ts +49 -9
  50. package/dist/cjs/api/types/CheckboxField.d.ts +12 -0
  51. package/dist/cjs/api/types/CheckboxField.js +3 -0
  52. package/dist/cjs/api/types/ColorField.d.ts +6 -0
  53. package/dist/cjs/api/types/ColorField.js +3 -0
  54. package/dist/cjs/api/types/CreateFormRequest.d.ts +5 -0
  55. package/dist/cjs/api/types/CreateFormRequest.js +3 -0
  56. package/dist/cjs/api/types/DateField.d.ts +12 -0
  57. package/dist/cjs/api/types/DateField.js +3 -0
  58. package/dist/cjs/api/types/DatetimeField.d.ts +12 -0
  59. package/dist/cjs/api/types/DatetimeField.js +3 -0
  60. package/dist/cjs/api/types/EmailField.d.ts +8 -0
  61. package/dist/cjs/api/types/EmailField.js +3 -0
  62. package/dist/cjs/api/types/FieldBase.d.ts +13 -0
  63. package/dist/cjs/api/types/FieldBase.js +3 -0
  64. package/dist/cjs/api/types/Form.d.ts +32 -0
  65. package/dist/cjs/api/types/Form.js +3 -0
  66. package/dist/cjs/api/types/FormBackground.d.ts +19 -0
  67. package/dist/cjs/api/types/FormBackground.js +3 -0
  68. package/dist/cjs/api/types/FormBackgroundGradient.d.ts +10 -0
  69. package/dist/cjs/api/types/FormBackgroundGradient.js +3 -0
  70. package/dist/cjs/api/types/FormBackgroundImage.d.ts +13 -0
  71. package/dist/cjs/api/types/FormBackgroundImage.js +3 -0
  72. package/dist/cjs/api/types/FormBackgroundPattern.d.ts +19 -0
  73. package/dist/cjs/api/types/FormBackgroundPattern.js +16 -0
  74. package/dist/cjs/api/types/FormBackgroundSolid.d.ts +24 -0
  75. package/dist/cjs/api/types/FormBackgroundSolid.js +3 -0
  76. package/dist/cjs/api/types/FormColorPalette.d.ts +11 -0
  77. package/dist/cjs/api/types/FormColorPalette.js +3 -0
  78. package/dist/cjs/api/types/FormDefinition.d.ts +18 -0
  79. package/dist/cjs/api/types/FormDefinition.js +3 -0
  80. package/dist/cjs/api/types/FormField.d.ts +55 -0
  81. package/dist/cjs/api/types/FormField.js +3 -0
  82. package/dist/cjs/api/types/FormFieldOption.d.ts +9 -0
  83. package/dist/cjs/api/types/FormFieldOption.js +3 -0
  84. package/dist/cjs/api/types/FormGradient.d.ts +19 -0
  85. package/dist/cjs/api/types/FormGradient.js +12 -0
  86. package/dist/cjs/api/types/FormIdReference.d.ts +4 -0
  87. package/dist/cjs/api/types/FormIdReference.js +3 -0
  88. package/dist/cjs/api/types/FormSubmission.d.ts +34 -0
  89. package/dist/cjs/api/types/FormSubmission.js +3 -0
  90. package/dist/cjs/api/types/FormSubmissionAnswer.d.ts +9 -0
  91. package/dist/cjs/api/types/FormSubmissionAnswer.js +3 -0
  92. package/dist/cjs/api/types/FormSubmissionEvent.d.ts +12 -0
  93. package/dist/cjs/api/types/FormSubmissionEvent.js +3 -0
  94. package/dist/cjs/api/types/FormSubmissionEventConversation.d.ts +15 -0
  95. package/dist/cjs/api/types/FormSubmissionEventConversation.js +3 -0
  96. package/dist/cjs/api/types/FormSubmissionEventForm.d.ts +11 -0
  97. package/dist/cjs/api/types/FormSubmissionEventForm.js +3 -0
  98. package/dist/cjs/api/types/FormSubmissionEventSubmission.d.ts +31 -0
  99. package/dist/cjs/api/types/FormSubmissionEventSubmission.js +3 -0
  100. package/dist/cjs/api/types/FormSubmittedField.d.ts +14 -0
  101. package/dist/cjs/api/types/FormSubmittedField.js +3 -0
  102. package/dist/cjs/api/types/FormThemeOverride.d.ts +77 -0
  103. package/dist/cjs/api/types/FormThemeOverride.js +33 -0
  104. package/dist/cjs/api/types/ListFormSubmissionsResponse.d.ts +12 -0
  105. package/dist/cjs/api/types/ListFormSubmissionsResponse.js +3 -0
  106. package/dist/cjs/api/types/ListFormsResponse.d.ts +12 -0
  107. package/dist/cjs/api/types/ListFormsResponse.js +3 -0
  108. package/dist/cjs/api/types/MessageEvent.d.ts +8 -2
  109. package/dist/cjs/api/types/MessageEvent.js +5 -0
  110. package/dist/cjs/api/types/NumberField.d.ts +14 -0
  111. package/dist/cjs/api/types/NumberField.js +3 -0
  112. package/dist/cjs/api/types/PhoneField.d.ts +8 -0
  113. package/dist/cjs/api/types/PhoneField.js +3 -0
  114. package/dist/cjs/api/types/RadioField.d.ts +8 -0
  115. package/dist/cjs/api/types/RadioField.js +3 -0
  116. package/dist/cjs/api/types/RangeField.d.ts +12 -0
  117. package/dist/cjs/api/types/RangeField.js +3 -0
  118. package/dist/cjs/api/types/RatingField.d.ts +10 -0
  119. package/dist/cjs/api/types/RatingField.js +3 -0
  120. package/dist/cjs/api/types/ScheduledFormSendResult.d.ts +20 -0
  121. package/dist/cjs/api/types/ScheduledFormSendResult.js +3 -0
  122. package/dist/cjs/api/types/SelectField.d.ts +10 -0
  123. package/dist/cjs/api/types/SelectField.js +3 -0
  124. package/dist/cjs/api/types/SendFormOptions.d.ts +18 -0
  125. package/dist/cjs/api/types/SendFormOptions.js +13 -0
  126. package/dist/cjs/api/types/SendFormParams.d.ts +9 -0
  127. package/dist/cjs/api/types/SendFormParams.js +3 -0
  128. package/dist/cjs/api/types/SendFormResult.d.ts +13 -0
  129. package/dist/cjs/api/types/SendFormResult.js +3 -0
  130. package/dist/cjs/api/types/SendFormViaRcsParams.d.ts +28 -0
  131. package/dist/cjs/api/types/SendFormViaRcsParams.js +3 -0
  132. package/dist/cjs/api/types/SendFormViaSmsParams.d.ts +15 -0
  133. package/dist/cjs/api/types/SendFormViaSmsParams.js +3 -0
  134. package/dist/cjs/api/types/TextField.d.ts +14 -0
  135. package/dist/cjs/api/types/TextField.js +3 -0
  136. package/dist/cjs/api/types/TextareaField.d.ts +14 -0
  137. package/dist/cjs/api/types/TextareaField.js +3 -0
  138. package/dist/cjs/api/types/TimeField.d.ts +12 -0
  139. package/dist/cjs/api/types/TimeField.js +3 -0
  140. package/dist/cjs/api/types/UrlField.d.ts +8 -0
  141. package/dist/cjs/api/types/UrlField.js +3 -0
  142. package/dist/cjs/api/types/UserEvent.d.ts +5 -2
  143. package/dist/cjs/api/types/VerificationStatus.d.ts +12 -0
  144. package/dist/cjs/api/types/VerificationStatus.js +15 -0
  145. package/dist/cjs/api/types/WebhookEventEnum.d.ts +2 -0
  146. package/dist/cjs/api/types/WebhookEventEnum.js +2 -0
  147. package/dist/cjs/api/types/index.d.ts +52 -0
  148. package/dist/cjs/api/types/index.js +52 -0
  149. package/dist/cjs/version.d.ts +1 -1
  150. package/dist/cjs/version.js +1 -1
  151. package/dist/cjs/wrapper/messages/Client.d.ts +1 -1
  152. package/dist/esm/Client.d.mts +3 -0
  153. package/dist/esm/Client.mjs +7 -2
  154. package/dist/esm/api/resources/forms/client/Client.d.mts +171 -0
  155. package/dist/esm/api/resources/forms/client/Client.mjs +463 -0
  156. package/dist/esm/api/resources/forms/client/index.d.mts +1 -0
  157. package/dist/esm/api/resources/forms/client/index.mjs +1 -0
  158. package/dist/esm/api/resources/forms/client/requests/ListFormsParams.d.mts +13 -0
  159. package/dist/esm/api/resources/forms/client/requests/ListFormsParams.mjs +2 -0
  160. package/dist/esm/api/resources/forms/client/requests/UpdateFormParams.d.mts +25 -0
  161. package/dist/esm/api/resources/forms/client/requests/UpdateFormParams.mjs +2 -0
  162. package/dist/esm/api/resources/forms/client/requests/index.d.mts +2 -0
  163. package/dist/esm/api/resources/forms/client/requests/index.mjs +1 -0
  164. package/dist/esm/api/resources/forms/index.d.mts +3 -0
  165. package/dist/esm/api/resources/forms/index.mjs +3 -0
  166. package/dist/esm/api/resources/forms/resources/index.d.mts +2 -0
  167. package/dist/esm/api/resources/forms/resources/index.mjs +2 -0
  168. package/dist/esm/api/resources/forms/resources/submissions/client/Client.d.mts +35 -0
  169. package/dist/esm/api/resources/forms/resources/submissions/client/Client.mjs +104 -0
  170. package/dist/esm/api/resources/forms/resources/submissions/client/index.d.mts +1 -0
  171. package/dist/esm/api/resources/forms/resources/submissions/client/index.mjs +1 -0
  172. package/dist/esm/api/resources/forms/resources/submissions/client/requests/ListFormSubmissionsParams.d.mts +13 -0
  173. package/dist/esm/api/resources/forms/resources/submissions/client/requests/ListFormSubmissionsParams.mjs +2 -0
  174. package/dist/esm/api/resources/forms/resources/submissions/client/requests/index.d.mts +1 -0
  175. package/dist/esm/api/resources/forms/resources/submissions/client/requests/index.mjs +1 -0
  176. package/dist/esm/api/resources/forms/resources/submissions/index.d.mts +1 -0
  177. package/dist/esm/api/resources/forms/resources/submissions/index.mjs +1 -0
  178. package/dist/esm/api/resources/forms/types/FormsSendResponse.d.mts +2 -0
  179. package/dist/esm/api/resources/forms/types/FormsSendResponse.mjs +2 -0
  180. package/dist/esm/api/resources/forms/types/index.d.mts +1 -0
  181. package/dist/esm/api/resources/forms/types/index.mjs +1 -0
  182. package/dist/esm/api/resources/index.d.mts +3 -0
  183. package/dist/esm/api/resources/index.mjs +3 -0
  184. package/dist/esm/api/resources/webhooks/client/requests/AttachWebhookParams.d.mts +1 -1
  185. package/dist/esm/api/types/AddressField.d.mts +14 -0
  186. package/dist/esm/api/types/AddressField.mjs +2 -0
  187. package/dist/esm/api/types/AgentSummary.d.mts +16 -2
  188. package/dist/esm/api/types/CampaignStatusEvent.d.mts +19 -0
  189. package/dist/esm/api/types/CampaignStatusEvent.mjs +2 -0
  190. package/dist/esm/api/types/CampaignStatusEventAgent.d.mts +9 -0
  191. package/dist/esm/api/types/CampaignStatusEventAgent.mjs +2 -0
  192. package/dist/esm/api/types/CampaignStatusEventBrand.d.mts +9 -0
  193. package/dist/esm/api/types/CampaignStatusEventBrand.mjs +2 -0
  194. package/dist/esm/api/types/CampaignStatusEventCampaign.d.mts +18 -0
  195. package/dist/esm/api/types/CampaignStatusEventCampaign.mjs +10 -0
  196. package/dist/esm/api/types/CampaignStatusEventCarrierLaunches.d.mts +48 -0
  197. package/dist/esm/api/types/CampaignStatusEventCarrierLaunches.mjs +2 -0
  198. package/dist/esm/api/types/CarrierLaunchStatus.d.mts +4 -4
  199. package/dist/esm/api/types/CarrierLaunchStatus.mjs +4 -4
  200. package/dist/esm/api/types/CarrierLaunches.d.mts +49 -9
  201. package/dist/esm/api/types/CheckboxField.d.mts +12 -0
  202. package/dist/esm/api/types/CheckboxField.mjs +2 -0
  203. package/dist/esm/api/types/ColorField.d.mts +6 -0
  204. package/dist/esm/api/types/ColorField.mjs +2 -0
  205. package/dist/esm/api/types/CreateFormRequest.d.mts +5 -0
  206. package/dist/esm/api/types/CreateFormRequest.mjs +2 -0
  207. package/dist/esm/api/types/DateField.d.mts +12 -0
  208. package/dist/esm/api/types/DateField.mjs +2 -0
  209. package/dist/esm/api/types/DatetimeField.d.mts +12 -0
  210. package/dist/esm/api/types/DatetimeField.mjs +2 -0
  211. package/dist/esm/api/types/EmailField.d.mts +8 -0
  212. package/dist/esm/api/types/EmailField.mjs +2 -0
  213. package/dist/esm/api/types/FieldBase.d.mts +13 -0
  214. package/dist/esm/api/types/FieldBase.mjs +2 -0
  215. package/dist/esm/api/types/Form.d.mts +32 -0
  216. package/dist/esm/api/types/Form.mjs +2 -0
  217. package/dist/esm/api/types/FormBackground.d.mts +19 -0
  218. package/dist/esm/api/types/FormBackground.mjs +2 -0
  219. package/dist/esm/api/types/FormBackgroundGradient.d.mts +10 -0
  220. package/dist/esm/api/types/FormBackgroundGradient.mjs +2 -0
  221. package/dist/esm/api/types/FormBackgroundImage.d.mts +13 -0
  222. package/dist/esm/api/types/FormBackgroundImage.mjs +2 -0
  223. package/dist/esm/api/types/FormBackgroundPattern.d.mts +19 -0
  224. package/dist/esm/api/types/FormBackgroundPattern.mjs +13 -0
  225. package/dist/esm/api/types/FormBackgroundSolid.d.mts +24 -0
  226. package/dist/esm/api/types/FormBackgroundSolid.mjs +2 -0
  227. package/dist/esm/api/types/FormColorPalette.d.mts +11 -0
  228. package/dist/esm/api/types/FormColorPalette.mjs +2 -0
  229. package/dist/esm/api/types/FormDefinition.d.mts +18 -0
  230. package/dist/esm/api/types/FormDefinition.mjs +2 -0
  231. package/dist/esm/api/types/FormField.d.mts +55 -0
  232. package/dist/esm/api/types/FormField.mjs +2 -0
  233. package/dist/esm/api/types/FormFieldOption.d.mts +9 -0
  234. package/dist/esm/api/types/FormFieldOption.mjs +2 -0
  235. package/dist/esm/api/types/FormGradient.d.mts +19 -0
  236. package/dist/esm/api/types/FormGradient.mjs +9 -0
  237. package/dist/esm/api/types/FormIdReference.d.mts +4 -0
  238. package/dist/esm/api/types/FormIdReference.mjs +2 -0
  239. package/dist/esm/api/types/FormSubmission.d.mts +34 -0
  240. package/dist/esm/api/types/FormSubmission.mjs +2 -0
  241. package/dist/esm/api/types/FormSubmissionAnswer.d.mts +9 -0
  242. package/dist/esm/api/types/FormSubmissionAnswer.mjs +2 -0
  243. package/dist/esm/api/types/FormSubmissionEvent.d.mts +12 -0
  244. package/dist/esm/api/types/FormSubmissionEvent.mjs +2 -0
  245. package/dist/esm/api/types/FormSubmissionEventConversation.d.mts +15 -0
  246. package/dist/esm/api/types/FormSubmissionEventConversation.mjs +2 -0
  247. package/dist/esm/api/types/FormSubmissionEventForm.d.mts +11 -0
  248. package/dist/esm/api/types/FormSubmissionEventForm.mjs +2 -0
  249. package/dist/esm/api/types/FormSubmissionEventSubmission.d.mts +31 -0
  250. package/dist/esm/api/types/FormSubmissionEventSubmission.mjs +2 -0
  251. package/dist/esm/api/types/FormSubmittedField.d.mts +14 -0
  252. package/dist/esm/api/types/FormSubmittedField.mjs +2 -0
  253. package/dist/esm/api/types/FormThemeOverride.d.mts +77 -0
  254. package/dist/esm/api/types/FormThemeOverride.mjs +30 -0
  255. package/dist/esm/api/types/ListFormSubmissionsResponse.d.mts +12 -0
  256. package/dist/esm/api/types/ListFormSubmissionsResponse.mjs +2 -0
  257. package/dist/esm/api/types/ListFormsResponse.d.mts +12 -0
  258. package/dist/esm/api/types/ListFormsResponse.mjs +2 -0
  259. package/dist/esm/api/types/MessageEvent.d.mts +8 -2
  260. package/dist/esm/api/types/MessageEvent.mjs +5 -0
  261. package/dist/esm/api/types/NumberField.d.mts +14 -0
  262. package/dist/esm/api/types/NumberField.mjs +2 -0
  263. package/dist/esm/api/types/PhoneField.d.mts +8 -0
  264. package/dist/esm/api/types/PhoneField.mjs +2 -0
  265. package/dist/esm/api/types/RadioField.d.mts +8 -0
  266. package/dist/esm/api/types/RadioField.mjs +2 -0
  267. package/dist/esm/api/types/RangeField.d.mts +12 -0
  268. package/dist/esm/api/types/RangeField.mjs +2 -0
  269. package/dist/esm/api/types/RatingField.d.mts +10 -0
  270. package/dist/esm/api/types/RatingField.mjs +2 -0
  271. package/dist/esm/api/types/ScheduledFormSendResult.d.mts +20 -0
  272. package/dist/esm/api/types/ScheduledFormSendResult.mjs +2 -0
  273. package/dist/esm/api/types/SelectField.d.mts +10 -0
  274. package/dist/esm/api/types/SelectField.mjs +2 -0
  275. package/dist/esm/api/types/SendFormOptions.d.mts +18 -0
  276. package/dist/esm/api/types/SendFormOptions.mjs +10 -0
  277. package/dist/esm/api/types/SendFormParams.d.mts +9 -0
  278. package/dist/esm/api/types/SendFormParams.mjs +2 -0
  279. package/dist/esm/api/types/SendFormResult.d.mts +13 -0
  280. package/dist/esm/api/types/SendFormResult.mjs +2 -0
  281. package/dist/esm/api/types/SendFormViaRcsParams.d.mts +28 -0
  282. package/dist/esm/api/types/SendFormViaRcsParams.mjs +2 -0
  283. package/dist/esm/api/types/SendFormViaSmsParams.d.mts +15 -0
  284. package/dist/esm/api/types/SendFormViaSmsParams.mjs +2 -0
  285. package/dist/esm/api/types/TextField.d.mts +14 -0
  286. package/dist/esm/api/types/TextField.mjs +2 -0
  287. package/dist/esm/api/types/TextareaField.d.mts +14 -0
  288. package/dist/esm/api/types/TextareaField.mjs +2 -0
  289. package/dist/esm/api/types/TimeField.d.mts +12 -0
  290. package/dist/esm/api/types/TimeField.mjs +2 -0
  291. package/dist/esm/api/types/UrlField.d.mts +8 -0
  292. package/dist/esm/api/types/UrlField.mjs +2 -0
  293. package/dist/esm/api/types/UserEvent.d.mts +5 -2
  294. package/dist/esm/api/types/VerificationStatus.d.mts +12 -0
  295. package/dist/esm/api/types/VerificationStatus.mjs +12 -0
  296. package/dist/esm/api/types/WebhookEventEnum.d.mts +2 -0
  297. package/dist/esm/api/types/WebhookEventEnum.mjs +2 -0
  298. package/dist/esm/api/types/index.d.mts +52 -0
  299. package/dist/esm/api/types/index.mjs +52 -0
  300. package/dist/esm/version.d.mts +1 -1
  301. package/dist/esm/version.mjs +1 -1
  302. package/dist/esm/wrapper/messages/Client.d.mts +1 -1
  303. package/package.json +1 -1
  304. package/reference.md +481 -0
@@ -0,0 +1,463 @@
1
+ // This file was auto-generated by Fern from our API Definition.
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
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
+ import * as core from "../../../../core/index.mjs";
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as errors from "../../../../errors/index.mjs";
15
+ import * as Pinnacle from "../../../index.mjs";
16
+ import { Submissions } from "../resources/submissions/client/Client.mjs";
17
+ export class Forms {
18
+ constructor(_options) {
19
+ this._options = _options;
20
+ }
21
+ get submissions() {
22
+ var _a;
23
+ return ((_a = this._submissions) !== null && _a !== void 0 ? _a : (this._submissions = new Submissions(this._options)));
24
+ }
25
+ /**
26
+ * Retrieve a form by id. Includes submission count, last submission timestamp, and archive state.
27
+ *
28
+ * @param {string} id - The unique identifier of the form you want to retrieve.
29
+ * <br><br> This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`. It's returned on every form response (`Form.id`) and by [`POST /forms/send`](/api-reference/forms/send-form) (`response.form.id`).
30
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @throws {@link Pinnacle.BadRequestError}
33
+ * @throws {@link Pinnacle.UnauthorizedError}
34
+ * @throws {@link Pinnacle.NotFoundError}
35
+ * @throws {@link Pinnacle.InternalServerError}
36
+ *
37
+ * @example
38
+ * await client.forms.get("form_Oy2n7iUoi9CJwUU6")
39
+ */
40
+ get(id, requestOptions) {
41
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
42
+ }
43
+ __get(id, requestOptions) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
46
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
47
+ const _response = yield core.fetcher({
48
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, `forms/${core.url.encodePathParam(id)}`),
49
+ method: "GET",
50
+ headers: _headers,
51
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
52
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
53
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
54
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
55
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
56
+ logging: this._options.logging,
57
+ });
58
+ if (_response.ok) {
59
+ return { data: _response.body, rawResponse: _response.rawResponse };
60
+ }
61
+ if (_response.error.reason === "status-code") {
62
+ switch (_response.error.statusCode) {
63
+ case 400:
64
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
65
+ case 401:
66
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
67
+ case 404:
68
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
69
+ case 500:
70
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
71
+ default:
72
+ throw new errors.PinnacleError({
73
+ statusCode: _response.error.statusCode,
74
+ body: _response.error.body,
75
+ rawResponse: _response.rawResponse,
76
+ });
77
+ }
78
+ }
79
+ switch (_response.error.reason) {
80
+ case "non-json":
81
+ throw new errors.PinnacleError({
82
+ statusCode: _response.error.statusCode,
83
+ body: _response.error.rawBody,
84
+ rawResponse: _response.rawResponse,
85
+ });
86
+ case "timeout":
87
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling GET /forms/{id}.");
88
+ case "unknown":
89
+ throw new errors.PinnacleError({
90
+ message: _response.error.errorMessage,
91
+ rawResponse: _response.rawResponse,
92
+ });
93
+ }
94
+ });
95
+ }
96
+ /**
97
+ * Partial update. Only keys present in the body are applied. Archived forms (non-null `archived_at`) cannot be updated — restore the form by setting `archived_at: null` in a PATCH first.
98
+ *
99
+ * @param {string} id - The unique identifier of the form you want to update.
100
+ * <br><br> This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`.
101
+ * @param {Pinnacle.UpdateFormParams} request
102
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
103
+ *
104
+ * @throws {@link Pinnacle.BadRequestError}
105
+ * @throws {@link Pinnacle.UnauthorizedError}
106
+ * @throws {@link Pinnacle.NotFoundError}
107
+ * @throws {@link Pinnacle.InternalServerError}
108
+ *
109
+ * @example
110
+ * await client.forms.update("form_Oy2n7iUoi9CJwUU6", {
111
+ * name: "Contact request (v2)",
112
+ * can_update: true,
113
+ * expires_at: "2026-12-31T23:59:59Z"
114
+ * })
115
+ */
116
+ update(id, request = {}, requestOptions) {
117
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
118
+ }
119
+ __update(id_1) {
120
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
121
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
122
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
123
+ const _response = yield core.fetcher({
124
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, `forms/${core.url.encodePathParam(id)}`),
125
+ method: "PATCH",
126
+ headers: _headers,
127
+ contentType: "application/json",
128
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
129
+ requestType: "json",
130
+ body: request,
131
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
132
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
133
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
134
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
135
+ logging: this._options.logging,
136
+ });
137
+ if (_response.ok) {
138
+ return { data: _response.body, rawResponse: _response.rawResponse };
139
+ }
140
+ if (_response.error.reason === "status-code") {
141
+ switch (_response.error.statusCode) {
142
+ case 400:
143
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
144
+ case 401:
145
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
146
+ case 404:
147
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
148
+ case 500:
149
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
150
+ default:
151
+ throw new errors.PinnacleError({
152
+ statusCode: _response.error.statusCode,
153
+ body: _response.error.body,
154
+ rawResponse: _response.rawResponse,
155
+ });
156
+ }
157
+ }
158
+ switch (_response.error.reason) {
159
+ case "non-json":
160
+ throw new errors.PinnacleError({
161
+ statusCode: _response.error.statusCode,
162
+ body: _response.error.rawBody,
163
+ rawResponse: _response.rawResponse,
164
+ });
165
+ case "timeout":
166
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling PATCH /forms/{id}.");
167
+ case "unknown":
168
+ throw new errors.PinnacleError({
169
+ message: _response.error.errorMessage,
170
+ rawResponse: _response.rawResponse,
171
+ });
172
+ }
173
+ });
174
+ }
175
+ /**
176
+ * Paginated list of forms on your team, sorted by creation date (newest first). Includes archived forms.
177
+ *
178
+ * @param {Pinnacle.ListFormsParams} request
179
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
180
+ *
181
+ * @throws {@link Pinnacle.BadRequestError}
182
+ * @throws {@link Pinnacle.UnauthorizedError}
183
+ * @throws {@link Pinnacle.InternalServerError}
184
+ *
185
+ * @example
186
+ * await client.forms.list({
187
+ * pageIndex: 0,
188
+ * pageSize: 20
189
+ * })
190
+ */
191
+ list(request = {}, requestOptions) {
192
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
193
+ }
194
+ __list() {
195
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
196
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
197
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
198
+ const _response = yield core.fetcher({
199
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "forms/list"),
200
+ method: "POST",
201
+ headers: _headers,
202
+ contentType: "application/json",
203
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
204
+ requestType: "json",
205
+ body: request,
206
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
207
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
208
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
209
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
210
+ logging: this._options.logging,
211
+ });
212
+ if (_response.ok) {
213
+ return { data: _response.body, rawResponse: _response.rawResponse };
214
+ }
215
+ if (_response.error.reason === "status-code") {
216
+ switch (_response.error.statusCode) {
217
+ case 400:
218
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
219
+ case 401:
220
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
221
+ case 500:
222
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
223
+ default:
224
+ throw new errors.PinnacleError({
225
+ statusCode: _response.error.statusCode,
226
+ body: _response.error.body,
227
+ rawResponse: _response.rawResponse,
228
+ });
229
+ }
230
+ }
231
+ switch (_response.error.reason) {
232
+ case "non-json":
233
+ throw new errors.PinnacleError({
234
+ statusCode: _response.error.statusCode,
235
+ body: _response.error.rawBody,
236
+ rawResponse: _response.rawResponse,
237
+ });
238
+ case "timeout":
239
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms/list.");
240
+ case "unknown":
241
+ throw new errors.PinnacleError({
242
+ message: _response.error.errorMessage,
243
+ rawResponse: _response.rawResponse,
244
+ });
245
+ }
246
+ });
247
+ }
248
+ /**
249
+ * Create a hosted form without sending it. <br>
250
+ *
251
+ * Returns the form object including its public URL — `https://forms.pinnacle.sh/{form_id}`. <br>
252
+ *
253
+ * To also deliver the URL to a recipient over SMS or RCS in a single call, use [`POST /forms/send`](/api-reference/forms/send-form).
254
+ *
255
+ * @param {Pinnacle.CreateFormRequest} request
256
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
257
+ *
258
+ * @throws {@link Pinnacle.BadRequestError}
259
+ * @throws {@link Pinnacle.UnauthorizedError}
260
+ * @throws {@link Pinnacle.InternalServerError}
261
+ *
262
+ * @example
263
+ * await client.forms.create({
264
+ * name: "Contact request",
265
+ * description: "We'll follow up over SMS or RCS.",
266
+ * fields: [{
267
+ * type: "text",
268
+ * key: "full_name",
269
+ * label: "Full name",
270
+ * required: true,
271
+ * placeholder: "Ada Lovelace",
272
+ * min_length: 2,
273
+ * max_length: 60
274
+ * }, {
275
+ * type: "email",
276
+ * key: "email",
277
+ * label: "Email",
278
+ * required: true,
279
+ * placeholder: "you@example.com"
280
+ * }, {
281
+ * type: "phone",
282
+ * key: "phone",
283
+ * label: "Phone",
284
+ * required: true,
285
+ * placeholder: "(555) 555-1212"
286
+ * }, {
287
+ * type: "select",
288
+ * key: "plan",
289
+ * label: "Plan",
290
+ * required: true,
291
+ * options: [{
292
+ * value: "basic",
293
+ * label: "Basic"
294
+ * }, {
295
+ * value: "pro",
296
+ * label: "Pro"
297
+ * }, {
298
+ * value: "enterprise",
299
+ * label: "Enterprise"
300
+ * }]
301
+ * }],
302
+ * can_update: false
303
+ * })
304
+ */
305
+ create(request, requestOptions) {
306
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
307
+ }
308
+ __create(request, requestOptions) {
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
311
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
312
+ const _response = yield core.fetcher({
313
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "forms"),
314
+ method: "POST",
315
+ headers: _headers,
316
+ contentType: "application/json",
317
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
318
+ requestType: "json",
319
+ body: request,
320
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
321
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
322
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
323
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
324
+ logging: this._options.logging,
325
+ });
326
+ if (_response.ok) {
327
+ return { data: _response.body, rawResponse: _response.rawResponse };
328
+ }
329
+ if (_response.error.reason === "status-code") {
330
+ switch (_response.error.statusCode) {
331
+ case 400:
332
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
333
+ case 401:
334
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
335
+ case 500:
336
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
337
+ default:
338
+ throw new errors.PinnacleError({
339
+ statusCode: _response.error.statusCode,
340
+ body: _response.error.body,
341
+ rawResponse: _response.rawResponse,
342
+ });
343
+ }
344
+ }
345
+ switch (_response.error.reason) {
346
+ case "non-json":
347
+ throw new errors.PinnacleError({
348
+ statusCode: _response.error.statusCode,
349
+ body: _response.error.rawBody,
350
+ rawResponse: _response.rawResponse,
351
+ });
352
+ case "timeout":
353
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms.");
354
+ case "unknown":
355
+ throw new errors.PinnacleError({
356
+ message: _response.error.errorMessage,
357
+ rawResponse: _response.rawResponse,
358
+ });
359
+ }
360
+ });
361
+ }
362
+ /**
363
+ * Send a form to a recipient over SMS or RCS, or mint a standalone submission URL.
364
+ *
365
+ * Pass `form` as either an existing form id (`form_*`) or an inline `{ fields, ... }` definition to mint a new form for this send.
366
+ *
367
+ * The delivery channel is inferred from `from`:
368
+ * - `from: "agent_*"` → RCS (with optional SMS `fallback`)
369
+ * - `from: "+E.164"` → SMS
370
+ *
371
+ * When `to` is provided, Pinnacle dispatches a message whose body contains the submission URL and the recipient is recorded on the response: `submission.to` echoes the same E.164 number and `message_id` is the id of the outbound SMS/RCS.
372
+ *
373
+ * When `to` is omitted, no message is sent — `submission.to` and `message_id` are both `null` — which is useful for embedding the URL in your own outreach.
374
+ *
375
+ * On completion, a `FORM.SUBMISSION` webhook event is delivered to webhooks subscribed to the sender. See [Receiving Messages and User Events](/guides/messages/receiving).
376
+ *
377
+ * @param {Pinnacle.SendFormParams} request
378
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
379
+ *
380
+ * @throws {@link Pinnacle.BadRequestError}
381
+ * @throws {@link Pinnacle.UnauthorizedError}
382
+ * @throws {@link Pinnacle.NotFoundError}
383
+ * @throws {@link Pinnacle.InternalServerError}
384
+ *
385
+ * @example
386
+ * await client.forms.send({
387
+ * from: "agent_iM9wQcyBBjYn",
388
+ * to: "+14155551234",
389
+ * form: "form_Oy2n7iUoi9CJwUU6",
390
+ * fallback: {
391
+ * from: "+14155550000"
392
+ * },
393
+ * options: {
394
+ * webview_mode: "FULL"
395
+ * }
396
+ * })
397
+ */
398
+ send(request, requestOptions) {
399
+ return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
400
+ }
401
+ __send(request, requestOptions) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
404
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
405
+ const _response = yield core.fetcher({
406
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PinnacleEnvironment.Default, "forms/send"),
407
+ method: "POST",
408
+ headers: _headers,
409
+ contentType: "application/json",
410
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
411
+ requestType: "json",
412
+ body: request,
413
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
414
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
415
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
416
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
417
+ logging: this._options.logging,
418
+ });
419
+ if (_response.ok) {
420
+ return { data: _response.body, rawResponse: _response.rawResponse };
421
+ }
422
+ if (_response.error.reason === "status-code") {
423
+ switch (_response.error.statusCode) {
424
+ case 400:
425
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
426
+ case 401:
427
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
428
+ case 404:
429
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
430
+ case 500:
431
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
432
+ default:
433
+ throw new errors.PinnacleError({
434
+ statusCode: _response.error.statusCode,
435
+ body: _response.error.body,
436
+ rawResponse: _response.rawResponse,
437
+ });
438
+ }
439
+ }
440
+ switch (_response.error.reason) {
441
+ case "non-json":
442
+ throw new errors.PinnacleError({
443
+ statusCode: _response.error.statusCode,
444
+ body: _response.error.rawBody,
445
+ rawResponse: _response.rawResponse,
446
+ });
447
+ case "timeout":
448
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms/send.");
449
+ case "unknown":
450
+ throw new errors.PinnacleError({
451
+ message: _response.error.errorMessage,
452
+ rawResponse: _response.rawResponse,
453
+ });
454
+ }
455
+ });
456
+ }
457
+ _getCustomAuthorizationHeaders() {
458
+ return __awaiter(this, void 0, void 0, function* () {
459
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
460
+ return { "PINNACLE-API-KEY": apiKeyValue };
461
+ });
462
+ }
463
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * pageIndex: 0,
5
+ * pageSize: 20
6
+ * }
7
+ */
8
+ export interface ListFormsParams {
9
+ /** Zero-based page index. */
10
+ pageIndex?: number;
11
+ /** Number of forms to return in a single page. Max 100. */
12
+ pageSize?: number;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,25 @@
1
+ import type * as Pinnacle from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * name: "Contact request (v2)",
6
+ * can_update: true,
7
+ * expires_at: "2026-12-31T23:59:59Z"
8
+ * }
9
+ */
10
+ export interface UpdateFormParams {
11
+ /** Replace the form's title. Pass `null` to clear. */
12
+ name?: string | null;
13
+ /** Replace the form's description. Pass `null` to clear. */
14
+ description?: string | null;
15
+ /** Replace the full set of fields on the form. Partial field updates aren't supported — send the complete new list. */
16
+ fields?: Pinnacle.FormField[];
17
+ /** Toggle whether the recipient can re-edit their submission. */
18
+ can_update?: boolean;
19
+ /** Set or clear the form's expiration timestamp. */
20
+ expires_at?: string | null;
21
+ /** Replace the per-form theme override. Pass `null` to revert to team defaults. */
22
+ theme_override?: Pinnacle.FormThemeOverride | null;
23
+ /** Set to an ISO timestamp to archive the form (soft-delete), or `null` to restore an archived form. */
24
+ archived_at?: string | null;
25
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { ListFormsParams } from "./ListFormsParams.mjs";
2
+ export type { UpdateFormParams } from "./UpdateFormParams.mjs";
@@ -0,0 +1,3 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
3
+ export * from "./types/index.mjs";
@@ -0,0 +1,3 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
3
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./submissions/client/requests/index.mjs";
2
+ export * as submissions from "./submissions/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./submissions/client/requests/index.mjs";
2
+ export * as submissions from "./submissions/index.mjs";
@@ -0,0 +1,35 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import * as core from "../../../../../../core/index.mjs";
3
+ import * as Pinnacle from "../../../../../index.mjs";
4
+ export declare namespace Submissions {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class Submissions {
11
+ protected readonly _options: Submissions.Options;
12
+ constructor(_options: Submissions.Options);
13
+ /**
14
+ * Paginated list of completed submissions for a form, newest first. Each row includes the submitted `data` keyed by field `key`, the sender/recipient, IP, user-agent, and timestamps.
15
+ *
16
+ * @param {string} id - The unique identifier of the form whose submissions you want to list.
17
+ * <br><br> This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`.
18
+ * @param {Pinnacle.forms.ListFormSubmissionsParams} request
19
+ * @param {Submissions.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link Pinnacle.BadRequestError}
22
+ * @throws {@link Pinnacle.UnauthorizedError}
23
+ * @throws {@link Pinnacle.NotFoundError}
24
+ * @throws {@link Pinnacle.InternalServerError}
25
+ *
26
+ * @example
27
+ * await client.forms.submissions.list("form_Oy2n7iUoi9CJwUU6", {
28
+ * pageIndex: 0,
29
+ * pageSize: 20
30
+ * })
31
+ */
32
+ list(id: string, request?: Pinnacle.forms.ListFormSubmissionsParams, requestOptions?: Submissions.RequestOptions): core.HttpResponsePromise<Pinnacle.ListFormSubmissionsResponse>;
33
+ private __list;
34
+ protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
35
+ }