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,500 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.Forms = void 0;
47
+ const headers_js_1 = require("../../../../core/headers.js");
48
+ const core = __importStar(require("../../../../core/index.js"));
49
+ const environments = __importStar(require("../../../../environments.js"));
50
+ const errors = __importStar(require("../../../../errors/index.js"));
51
+ const Pinnacle = __importStar(require("../../../index.js"));
52
+ const Client_js_1 = require("../resources/submissions/client/Client.js");
53
+ class Forms {
54
+ constructor(_options) {
55
+ this._options = _options;
56
+ }
57
+ get submissions() {
58
+ var _a;
59
+ return ((_a = this._submissions) !== null && _a !== void 0 ? _a : (this._submissions = new Client_js_1.Submissions(this._options)));
60
+ }
61
+ /**
62
+ * Retrieve a form by id. Includes submission count, last submission timestamp, and archive state.
63
+ *
64
+ * @param {string} id - The unique identifier of the form you want to retrieve.
65
+ * <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`).
66
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link Pinnacle.BadRequestError}
69
+ * @throws {@link Pinnacle.UnauthorizedError}
70
+ * @throws {@link Pinnacle.NotFoundError}
71
+ * @throws {@link Pinnacle.InternalServerError}
72
+ *
73
+ * @example
74
+ * await client.forms.get("form_Oy2n7iUoi9CJwUU6")
75
+ */
76
+ get(id, requestOptions) {
77
+ return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
78
+ }
79
+ __get(id, requestOptions) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
82
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
83
+ const _response = yield core.fetcher({
84
+ 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)}`),
85
+ method: "GET",
86
+ headers: _headers,
87
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
88
+ 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,
89
+ 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,
90
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
92
+ logging: this._options.logging,
93
+ });
94
+ if (_response.ok) {
95
+ return { data: _response.body, rawResponse: _response.rawResponse };
96
+ }
97
+ if (_response.error.reason === "status-code") {
98
+ switch (_response.error.statusCode) {
99
+ case 400:
100
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
101
+ case 401:
102
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
103
+ case 404:
104
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
105
+ case 500:
106
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
107
+ default:
108
+ throw new errors.PinnacleError({
109
+ statusCode: _response.error.statusCode,
110
+ body: _response.error.body,
111
+ rawResponse: _response.rawResponse,
112
+ });
113
+ }
114
+ }
115
+ switch (_response.error.reason) {
116
+ case "non-json":
117
+ throw new errors.PinnacleError({
118
+ statusCode: _response.error.statusCode,
119
+ body: _response.error.rawBody,
120
+ rawResponse: _response.rawResponse,
121
+ });
122
+ case "timeout":
123
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling GET /forms/{id}.");
124
+ case "unknown":
125
+ throw new errors.PinnacleError({
126
+ message: _response.error.errorMessage,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ }
130
+ });
131
+ }
132
+ /**
133
+ * 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.
134
+ *
135
+ * @param {string} id - The unique identifier of the form you want to update.
136
+ * <br><br> This identifier is a string that always begins with the prefix `form_`, for example: `form_Oy2n7iUoi9CJwUU6`.
137
+ * @param {Pinnacle.UpdateFormParams} request
138
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
139
+ *
140
+ * @throws {@link Pinnacle.BadRequestError}
141
+ * @throws {@link Pinnacle.UnauthorizedError}
142
+ * @throws {@link Pinnacle.NotFoundError}
143
+ * @throws {@link Pinnacle.InternalServerError}
144
+ *
145
+ * @example
146
+ * await client.forms.update("form_Oy2n7iUoi9CJwUU6", {
147
+ * name: "Contact request (v2)",
148
+ * can_update: true,
149
+ * expires_at: "2026-12-31T23:59:59Z"
150
+ * })
151
+ */
152
+ update(id, request = {}, requestOptions) {
153
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
154
+ }
155
+ __update(id_1) {
156
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
158
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
159
+ const _response = yield core.fetcher({
160
+ 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)}`),
161
+ method: "PATCH",
162
+ headers: _headers,
163
+ contentType: "application/json",
164
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
165
+ requestType: "json",
166
+ body: request,
167
+ 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,
168
+ 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,
169
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
170
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
171
+ logging: this._options.logging,
172
+ });
173
+ if (_response.ok) {
174
+ return { data: _response.body, rawResponse: _response.rawResponse };
175
+ }
176
+ if (_response.error.reason === "status-code") {
177
+ switch (_response.error.statusCode) {
178
+ case 400:
179
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
180
+ case 401:
181
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
182
+ case 404:
183
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
184
+ case 500:
185
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
186
+ default:
187
+ throw new errors.PinnacleError({
188
+ statusCode: _response.error.statusCode,
189
+ body: _response.error.body,
190
+ rawResponse: _response.rawResponse,
191
+ });
192
+ }
193
+ }
194
+ switch (_response.error.reason) {
195
+ case "non-json":
196
+ throw new errors.PinnacleError({
197
+ statusCode: _response.error.statusCode,
198
+ body: _response.error.rawBody,
199
+ rawResponse: _response.rawResponse,
200
+ });
201
+ case "timeout":
202
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling PATCH /forms/{id}.");
203
+ case "unknown":
204
+ throw new errors.PinnacleError({
205
+ message: _response.error.errorMessage,
206
+ rawResponse: _response.rawResponse,
207
+ });
208
+ }
209
+ });
210
+ }
211
+ /**
212
+ * Paginated list of forms on your team, sorted by creation date (newest first). Includes archived forms.
213
+ *
214
+ * @param {Pinnacle.ListFormsParams} request
215
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
216
+ *
217
+ * @throws {@link Pinnacle.BadRequestError}
218
+ * @throws {@link Pinnacle.UnauthorizedError}
219
+ * @throws {@link Pinnacle.InternalServerError}
220
+ *
221
+ * @example
222
+ * await client.forms.list({
223
+ * pageIndex: 0,
224
+ * pageSize: 20
225
+ * })
226
+ */
227
+ list(request = {}, requestOptions) {
228
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
229
+ }
230
+ __list() {
231
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
232
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
233
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
234
+ const _response = yield core.fetcher({
235
+ 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"),
236
+ method: "POST",
237
+ headers: _headers,
238
+ contentType: "application/json",
239
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
240
+ requestType: "json",
241
+ body: request,
242
+ 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,
243
+ 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,
244
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
245
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
246
+ logging: this._options.logging,
247
+ });
248
+ if (_response.ok) {
249
+ return { data: _response.body, rawResponse: _response.rawResponse };
250
+ }
251
+ if (_response.error.reason === "status-code") {
252
+ switch (_response.error.statusCode) {
253
+ case 400:
254
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
255
+ case 401:
256
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
257
+ case 500:
258
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
259
+ default:
260
+ throw new errors.PinnacleError({
261
+ statusCode: _response.error.statusCode,
262
+ body: _response.error.body,
263
+ rawResponse: _response.rawResponse,
264
+ });
265
+ }
266
+ }
267
+ switch (_response.error.reason) {
268
+ case "non-json":
269
+ throw new errors.PinnacleError({
270
+ statusCode: _response.error.statusCode,
271
+ body: _response.error.rawBody,
272
+ rawResponse: _response.rawResponse,
273
+ });
274
+ case "timeout":
275
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms/list.");
276
+ case "unknown":
277
+ throw new errors.PinnacleError({
278
+ message: _response.error.errorMessage,
279
+ rawResponse: _response.rawResponse,
280
+ });
281
+ }
282
+ });
283
+ }
284
+ /**
285
+ * Create a hosted form without sending it. <br>
286
+ *
287
+ * Returns the form object including its public URL — `https://forms.pinnacle.sh/{form_id}`. <br>
288
+ *
289
+ * 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).
290
+ *
291
+ * @param {Pinnacle.CreateFormRequest} request
292
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
293
+ *
294
+ * @throws {@link Pinnacle.BadRequestError}
295
+ * @throws {@link Pinnacle.UnauthorizedError}
296
+ * @throws {@link Pinnacle.InternalServerError}
297
+ *
298
+ * @example
299
+ * await client.forms.create({
300
+ * name: "Contact request",
301
+ * description: "We'll follow up over SMS or RCS.",
302
+ * fields: [{
303
+ * type: "text",
304
+ * key: "full_name",
305
+ * label: "Full name",
306
+ * required: true,
307
+ * placeholder: "Ada Lovelace",
308
+ * min_length: 2,
309
+ * max_length: 60
310
+ * }, {
311
+ * type: "email",
312
+ * key: "email",
313
+ * label: "Email",
314
+ * required: true,
315
+ * placeholder: "you@example.com"
316
+ * }, {
317
+ * type: "phone",
318
+ * key: "phone",
319
+ * label: "Phone",
320
+ * required: true,
321
+ * placeholder: "(555) 555-1212"
322
+ * }, {
323
+ * type: "select",
324
+ * key: "plan",
325
+ * label: "Plan",
326
+ * required: true,
327
+ * options: [{
328
+ * value: "basic",
329
+ * label: "Basic"
330
+ * }, {
331
+ * value: "pro",
332
+ * label: "Pro"
333
+ * }, {
334
+ * value: "enterprise",
335
+ * label: "Enterprise"
336
+ * }]
337
+ * }],
338
+ * can_update: false
339
+ * })
340
+ */
341
+ create(request, requestOptions) {
342
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
343
+ }
344
+ __create(request, requestOptions) {
345
+ return __awaiter(this, void 0, void 0, function* () {
346
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
347
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
348
+ const _response = yield core.fetcher({
349
+ 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"),
350
+ method: "POST",
351
+ headers: _headers,
352
+ contentType: "application/json",
353
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
354
+ requestType: "json",
355
+ body: request,
356
+ 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,
357
+ 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,
358
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
359
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
360
+ logging: this._options.logging,
361
+ });
362
+ if (_response.ok) {
363
+ return { data: _response.body, rawResponse: _response.rawResponse };
364
+ }
365
+ if (_response.error.reason === "status-code") {
366
+ switch (_response.error.statusCode) {
367
+ case 400:
368
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
369
+ case 401:
370
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
371
+ case 500:
372
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
373
+ default:
374
+ throw new errors.PinnacleError({
375
+ statusCode: _response.error.statusCode,
376
+ body: _response.error.body,
377
+ rawResponse: _response.rawResponse,
378
+ });
379
+ }
380
+ }
381
+ switch (_response.error.reason) {
382
+ case "non-json":
383
+ throw new errors.PinnacleError({
384
+ statusCode: _response.error.statusCode,
385
+ body: _response.error.rawBody,
386
+ rawResponse: _response.rawResponse,
387
+ });
388
+ case "timeout":
389
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms.");
390
+ case "unknown":
391
+ throw new errors.PinnacleError({
392
+ message: _response.error.errorMessage,
393
+ rawResponse: _response.rawResponse,
394
+ });
395
+ }
396
+ });
397
+ }
398
+ /**
399
+ * Send a form to a recipient over SMS or RCS, or mint a standalone submission URL.
400
+ *
401
+ * Pass `form` as either an existing form id (`form_*`) or an inline `{ fields, ... }` definition to mint a new form for this send.
402
+ *
403
+ * The delivery channel is inferred from `from`:
404
+ * - `from: "agent_*"` → RCS (with optional SMS `fallback`)
405
+ * - `from: "+E.164"` → SMS
406
+ *
407
+ * 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.
408
+ *
409
+ * 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.
410
+ *
411
+ * On completion, a `FORM.SUBMISSION` webhook event is delivered to webhooks subscribed to the sender. See [Receiving Messages and User Events](/guides/messages/receiving).
412
+ *
413
+ * @param {Pinnacle.SendFormParams} request
414
+ * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
415
+ *
416
+ * @throws {@link Pinnacle.BadRequestError}
417
+ * @throws {@link Pinnacle.UnauthorizedError}
418
+ * @throws {@link Pinnacle.NotFoundError}
419
+ * @throws {@link Pinnacle.InternalServerError}
420
+ *
421
+ * @example
422
+ * await client.forms.send({
423
+ * from: "agent_iM9wQcyBBjYn",
424
+ * to: "+14155551234",
425
+ * form: "form_Oy2n7iUoi9CJwUU6",
426
+ * fallback: {
427
+ * from: "+14155550000"
428
+ * },
429
+ * options: {
430
+ * webview_mode: "FULL"
431
+ * }
432
+ * })
433
+ */
434
+ send(request, requestOptions) {
435
+ return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
436
+ }
437
+ __send(request, requestOptions) {
438
+ return __awaiter(this, void 0, void 0, function* () {
439
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
440
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
441
+ const _response = yield core.fetcher({
442
+ 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"),
443
+ method: "POST",
444
+ headers: _headers,
445
+ contentType: "application/json",
446
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
447
+ requestType: "json",
448
+ body: request,
449
+ 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,
450
+ 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,
451
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
452
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
453
+ logging: this._options.logging,
454
+ });
455
+ if (_response.ok) {
456
+ return { data: _response.body, rawResponse: _response.rawResponse };
457
+ }
458
+ if (_response.error.reason === "status-code") {
459
+ switch (_response.error.statusCode) {
460
+ case 400:
461
+ throw new Pinnacle.BadRequestError(_response.error.body, _response.rawResponse);
462
+ case 401:
463
+ throw new Pinnacle.UnauthorizedError(_response.error.body, _response.rawResponse);
464
+ case 404:
465
+ throw new Pinnacle.NotFoundError(_response.error.body, _response.rawResponse);
466
+ case 500:
467
+ throw new Pinnacle.InternalServerError(_response.error.body, _response.rawResponse);
468
+ default:
469
+ throw new errors.PinnacleError({
470
+ statusCode: _response.error.statusCode,
471
+ body: _response.error.body,
472
+ rawResponse: _response.rawResponse,
473
+ });
474
+ }
475
+ }
476
+ switch (_response.error.reason) {
477
+ case "non-json":
478
+ throw new errors.PinnacleError({
479
+ statusCode: _response.error.statusCode,
480
+ body: _response.error.rawBody,
481
+ rawResponse: _response.rawResponse,
482
+ });
483
+ case "timeout":
484
+ throw new errors.PinnacleTimeoutError("Timeout exceeded when calling POST /forms/send.");
485
+ case "unknown":
486
+ throw new errors.PinnacleError({
487
+ message: _response.error.errorMessage,
488
+ rawResponse: _response.rawResponse,
489
+ });
490
+ }
491
+ });
492
+ }
493
+ _getCustomAuthorizationHeaders() {
494
+ return __awaiter(this, void 0, void 0, function* () {
495
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
496
+ return { "PINNACLE-API-KEY": apiKeyValue };
497
+ });
498
+ }
499
+ }
500
+ exports.Forms = Forms;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import type * as Pinnacle from "../../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export type { ListFormsParams } from "./ListFormsParams.js";
2
+ export type { UpdateFormParams } from "./UpdateFormParams.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./client/index.js";
2
+ export * from "./resources/index.js";
3
+ export * from "./types/index.js";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./resources/index.js"), exports);
19
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./submissions/client/requests/index.js";
2
+ export * as submissions from "./submissions/index.js";
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.submissions = void 0;
40
+ __exportStar(require("./submissions/client/requests/index.js"), exports);
41
+ exports.submissions = __importStar(require("./submissions/index.js"));