boldsign 3.2.0-beta.3 → 3.2.0-beta.5

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 (668) hide show
  1. package/api/apis.ts +1 -1
  2. package/api/brandingApi.ts +12 -2
  3. package/dist/WebhookUtility.d.ts +14 -0
  4. package/dist/WebhookUtility.js +119 -0
  5. package/dist/WebhookUtility.js.map +1 -0
  6. package/dist/api/apis.d.ts +29 -0
  7. package/dist/api/apis.js +149 -0
  8. package/dist/api/apis.js.map +1 -0
  9. package/dist/api/brandingApi.d.ts +29 -0
  10. package/dist/api/brandingApi.js +782 -0
  11. package/dist/api/brandingApi.js.map +1 -0
  12. package/dist/api/contactsApi.d.ts +28 -0
  13. package/dist/api/contactsApi.js +501 -0
  14. package/dist/api/contactsApi.js.map +1 -0
  15. package/dist/api/customFieldApi.d.ts +28 -0
  16. package/dist/api/customFieldApi.js +519 -0
  17. package/dist/api/customFieldApi.js.map +1 -0
  18. package/dist/api/documentApi.d.ts +49 -0
  19. package/dist/api/documentApi.js +2346 -0
  20. package/dist/api/documentApi.js.map +1 -0
  21. package/dist/api/groupContactsApi.d.ts +28 -0
  22. package/dist/api/groupContactsApi.js +513 -0
  23. package/dist/api/groupContactsApi.js.map +1 -0
  24. package/dist/api/identityVerificationApi.d.ts +26 -0
  25. package/dist/api/identityVerificationApi.js +369 -0
  26. package/dist/api/identityVerificationApi.js.map +1 -0
  27. package/dist/api/index.d.ts +14 -0
  28. package/dist/api/index.js +33 -0
  29. package/dist/api/index.js.map +1 -0
  30. package/dist/api/planApi.d.ts +24 -0
  31. package/dist/api/planApi.js +174 -0
  32. package/dist/api/planApi.js.map +1 -0
  33. package/dist/api/senderIdentitiesApi.d.ts +30 -0
  34. package/dist/api/senderIdentitiesApi.js +663 -0
  35. package/dist/api/senderIdentitiesApi.js.map +1 -0
  36. package/dist/api/teamsApi.d.ts +27 -0
  37. package/dist/api/teamsApi.js +426 -0
  38. package/dist/api/teamsApi.js.map +1 -0
  39. package/dist/api/templateApi.d.ts +40 -0
  40. package/dist/api/templateApi.js +1509 -0
  41. package/dist/api/templateApi.js.map +1 -0
  42. package/dist/api/userApi.d.ts +31 -0
  43. package/dist/api/userApi.js +723 -0
  44. package/dist/api/userApi.js.map +1 -0
  45. package/dist/api.d.ts +2 -0
  46. package/dist/api.js +19 -0
  47. package/dist/api.js.map +1 -0
  48. package/dist/auth/OAuthClient.d.ts +36 -0
  49. package/dist/auth/OAuthClient.js +152 -0
  50. package/dist/auth/OAuthClient.js.map +1 -0
  51. package/dist/auth/OAuthToken.d.ts +9 -0
  52. package/dist/auth/OAuthToken.js +15 -0
  53. package/dist/auth/OAuthToken.js.map +1 -0
  54. package/dist/auth/PKCEHelper.d.ts +7 -0
  55. package/dist/auth/PKCEHelper.js +58 -0
  56. package/dist/auth/PKCEHelper.js.map +1 -0
  57. package/dist/model/accessCodeDetail.d.ts +37 -0
  58. package/dist/model/accessCodeDetail.js +74 -0
  59. package/dist/model/accessCodeDetail.js.map +1 -0
  60. package/dist/model/accessCodeDetails.d.ts +17 -0
  61. package/dist/model/accessCodeDetails.js +28 -0
  62. package/dist/model/accessCodeDetails.js.map +1 -0
  63. package/dist/model/added.d.ts +16 -0
  64. package/dist/model/added.js +28 -0
  65. package/dist/model/added.js.map +1 -0
  66. package/dist/model/address.d.ts +19 -0
  67. package/dist/model/address.js +43 -0
  68. package/dist/model/address.js.map +1 -0
  69. package/dist/model/attachmentInfo.d.ts +17 -0
  70. package/dist/model/attachmentInfo.js +33 -0
  71. package/dist/model/attachmentInfo.js.map +1 -0
  72. package/dist/model/auditTrail.d.ts +120 -0
  73. package/dist/model/auditTrail.js +179 -0
  74. package/dist/model/auditTrail.js.map +1 -0
  75. package/dist/model/authenticationSettings.d.ts +22 -0
  76. package/dist/model/authenticationSettings.js +27 -0
  77. package/dist/model/authenticationSettings.js.map +1 -0
  78. package/dist/model/base64File.d.ts +15 -0
  79. package/dist/model/base64File.js +23 -0
  80. package/dist/model/base64File.js.map +1 -0
  81. package/dist/model/behalfDocument.d.ts +47 -0
  82. package/dist/model/behalfDocument.js +120 -0
  83. package/dist/model/behalfDocument.js.map +1 -0
  84. package/dist/model/behalfDocumentRecords.d.ts +17 -0
  85. package/dist/model/behalfDocumentRecords.js +23 -0
  86. package/dist/model/behalfDocumentRecords.js.map +1 -0
  87. package/dist/model/behalfOf.d.ts +15 -0
  88. package/dist/model/behalfOf.js +23 -0
  89. package/dist/model/behalfOf.js.map +1 -0
  90. package/dist/model/behalfOfWebhookModel.d.ts +15 -0
  91. package/dist/model/behalfOfWebhookModel.js +23 -0
  92. package/dist/model/behalfOfWebhookModel.js.map +1 -0
  93. package/dist/model/billingViewModel.d.ts +14 -0
  94. package/dist/model/billingViewModel.js +18 -0
  95. package/dist/model/billingViewModel.js.map +1 -0
  96. package/dist/model/brandCreated.d.ts +14 -0
  97. package/dist/model/brandCreated.js +18 -0
  98. package/dist/model/brandCreated.js.map +1 -0
  99. package/dist/model/brandCustomFieldDetails.d.ts +20 -0
  100. package/dist/model/brandCustomFieldDetails.js +46 -0
  101. package/dist/model/brandCustomFieldDetails.js.map +1 -0
  102. package/dist/model/brandingMessage.d.ts +14 -0
  103. package/dist/model/brandingMessage.js +18 -0
  104. package/dist/model/brandingMessage.js.map +1 -0
  105. package/dist/model/brandingRecords.d.ts +15 -0
  106. package/dist/model/brandingRecords.js +18 -0
  107. package/dist/model/brandingRecords.js.map +1 -0
  108. package/dist/model/changeRecipient.d.ts +22 -0
  109. package/dist/model/changeRecipient.js +53 -0
  110. package/dist/model/changeRecipient.js.map +1 -0
  111. package/dist/model/changeTeamRequest.d.ts +15 -0
  112. package/dist/model/changeTeamRequest.js +23 -0
  113. package/dist/model/changeTeamRequest.js.map +1 -0
  114. package/dist/model/checkboxValidationSettings.d.ts +24 -0
  115. package/dist/model/checkboxValidationSettings.js +37 -0
  116. package/dist/model/checkboxValidationSettings.js.map +1 -0
  117. package/dist/model/collaborationSettings.d.ts +17 -0
  118. package/dist/model/collaborationSettings.js +33 -0
  119. package/dist/model/collaborationSettings.js.map +1 -0
  120. package/dist/model/conditionalRule.d.ts +16 -0
  121. package/dist/model/conditionalRule.js +28 -0
  122. package/dist/model/conditionalRule.js.map +1 -0
  123. package/dist/model/contactCreated.d.ts +15 -0
  124. package/dist/model/contactCreated.js +23 -0
  125. package/dist/model/contactCreated.js.map +1 -0
  126. package/dist/model/contactDetails.d.ts +19 -0
  127. package/dist/model/contactDetails.js +38 -0
  128. package/dist/model/contactDetails.js.map +1 -0
  129. package/dist/model/contactPageDetails.d.ts +16 -0
  130. package/dist/model/contactPageDetails.js +28 -0
  131. package/dist/model/contactPageDetails.js.map +1 -0
  132. package/dist/model/contactsDetails.d.ts +20 -0
  133. package/dist/model/contactsDetails.js +43 -0
  134. package/dist/model/contactsDetails.js.map +1 -0
  135. package/dist/model/contactsList.d.ts +17 -0
  136. package/dist/model/contactsList.js +23 -0
  137. package/dist/model/contactsList.js.map +1 -0
  138. package/dist/model/createContactResponse.d.ts +15 -0
  139. package/dist/model/createContactResponse.js +18 -0
  140. package/dist/model/createContactResponse.js.map +1 -0
  141. package/dist/model/createGroupContactResponse.d.ts +15 -0
  142. package/dist/model/createGroupContactResponse.js +23 -0
  143. package/dist/model/createGroupContactResponse.js.map +1 -0
  144. package/dist/model/createSenderIdentityRequest.d.ts +48 -0
  145. package/dist/model/createSenderIdentityRequest.js +74 -0
  146. package/dist/model/createSenderIdentityRequest.js.map +1 -0
  147. package/dist/model/createTeamRequest.d.ts +14 -0
  148. package/dist/model/createTeamRequest.js +18 -0
  149. package/dist/model/createTeamRequest.js.map +1 -0
  150. package/dist/model/createTemplateRequest.d.ts +59 -0
  151. package/dist/model/createTemplateRequest.js +182 -0
  152. package/dist/model/createTemplateRequest.js.map +1 -0
  153. package/dist/model/createUser.d.ts +26 -0
  154. package/dist/model/createUser.js +41 -0
  155. package/dist/model/createUser.js.map +1 -0
  156. package/dist/model/creators.d.ts +15 -0
  157. package/dist/model/creators.js +23 -0
  158. package/dist/model/creators.js.map +1 -0
  159. package/dist/model/customDomainSettings.d.ts +15 -0
  160. package/dist/model/customDomainSettings.js +23 -0
  161. package/dist/model/customDomainSettings.js.map +1 -0
  162. package/dist/model/customFieldCollection.d.ts +15 -0
  163. package/dist/model/customFieldCollection.js +18 -0
  164. package/dist/model/customFieldCollection.js.map +1 -0
  165. package/dist/model/customFieldMessage.d.ts +15 -0
  166. package/dist/model/customFieldMessage.js +23 -0
  167. package/dist/model/customFieldMessage.js.map +1 -0
  168. package/dist/model/customFormField.d.ts +104 -0
  169. package/dist/model/customFormField.js +256 -0
  170. package/dist/model/customFormField.js.map +1 -0
  171. package/dist/model/deleteCustomFieldReply.d.ts +14 -0
  172. package/dist/model/deleteCustomFieldReply.js +18 -0
  173. package/dist/model/deleteCustomFieldReply.js.map +1 -0
  174. package/dist/model/document.d.ts +45 -0
  175. package/dist/model/document.js +115 -0
  176. package/dist/model/document.js.map +1 -0
  177. package/dist/model/documentCC.d.ts +14 -0
  178. package/dist/model/documentCC.js +18 -0
  179. package/dist/model/documentCC.js.map +1 -0
  180. package/dist/model/documentCcDetails.d.ts +15 -0
  181. package/dist/model/documentCcDetails.js +26 -0
  182. package/dist/model/documentCcDetails.js.map +1 -0
  183. package/dist/model/documentCcWebhookModel.d.ts +15 -0
  184. package/dist/model/documentCcWebhookModel.js +23 -0
  185. package/dist/model/documentCcWebhookModel.js.map +1 -0
  186. package/dist/model/documentCreated.d.ts +14 -0
  187. package/dist/model/documentCreated.js +18 -0
  188. package/dist/model/documentCreated.js.map +1 -0
  189. package/dist/model/documentEdited.d.ts +20 -0
  190. package/dist/model/documentEdited.js +25 -0
  191. package/dist/model/documentEdited.js.map +1 -0
  192. package/dist/model/documentEvent.d.ts +68 -0
  193. package/dist/model/documentEvent.js +172 -0
  194. package/dist/model/documentEvent.js.map +1 -0
  195. package/dist/model/documentExpirySettings.d.ts +26 -0
  196. package/dist/model/documentExpirySettings.js +51 -0
  197. package/dist/model/documentExpirySettings.js.map +1 -0
  198. package/dist/model/documentFiles.d.ts +19 -0
  199. package/dist/model/documentFiles.js +43 -0
  200. package/dist/model/documentFiles.js.map +1 -0
  201. package/dist/model/documentFormFields.d.ts +89 -0
  202. package/dist/model/documentFormFields.js +260 -0
  203. package/dist/model/documentFormFields.js.map +1 -0
  204. package/dist/model/documentGroupSignerWebhookModel.d.ts +31 -0
  205. package/dist/model/documentGroupSignerWebhookModel.js +64 -0
  206. package/dist/model/documentGroupSignerWebhookModel.js.map +1 -0
  207. package/dist/model/documentInfo.d.ts +65 -0
  208. package/dist/model/documentInfo.js +83 -0
  209. package/dist/model/documentInfo.js.map +1 -0
  210. package/dist/model/documentProperties.d.ts +121 -0
  211. package/dist/model/documentProperties.js +304 -0
  212. package/dist/model/documentProperties.js.map +1 -0
  213. package/dist/model/documentReassign.d.ts +16 -0
  214. package/dist/model/documentReassign.js +31 -0
  215. package/dist/model/documentReassign.js.map +1 -0
  216. package/dist/model/documentRecords.d.ts +17 -0
  217. package/dist/model/documentRecords.js +23 -0
  218. package/dist/model/documentRecords.js.map +1 -0
  219. package/dist/model/documentSender.d.ts +17 -0
  220. package/dist/model/documentSender.js +33 -0
  221. package/dist/model/documentSender.js.map +1 -0
  222. package/dist/model/documentSenderDetail.d.ts +17 -0
  223. package/dist/model/documentSenderDetail.js +36 -0
  224. package/dist/model/documentSenderDetail.js.map +1 -0
  225. package/dist/model/documentSigner.d.ts +115 -0
  226. package/dist/model/documentSigner.js +215 -0
  227. package/dist/model/documentSigner.js.map +1 -0
  228. package/dist/model/documentSignerDetails.d.ts +131 -0
  229. package/dist/model/documentSignerDetails.js +267 -0
  230. package/dist/model/documentSignerDetails.js.map +1 -0
  231. package/dist/model/documentSignerWebhookModel.d.ts +55 -0
  232. package/dist/model/documentSignerWebhookModel.js +159 -0
  233. package/dist/model/documentSignerWebhookModel.js.map +1 -0
  234. package/dist/model/documentTags.d.ts +15 -0
  235. package/dist/model/documentTags.js +23 -0
  236. package/dist/model/documentTags.js.map +1 -0
  237. package/dist/model/downloadImageRequest.d.ts +19 -0
  238. package/dist/model/downloadImageRequest.js +43 -0
  239. package/dist/model/downloadImageRequest.js.map +1 -0
  240. package/dist/model/editDocumentFile.d.ts +25 -0
  241. package/dist/model/editDocumentFile.js +41 -0
  242. package/dist/model/editDocumentFile.js.map +1 -0
  243. package/dist/model/editDocumentRequest.d.ts +73 -0
  244. package/dist/model/editDocumentRequest.js +193 -0
  245. package/dist/model/editDocumentRequest.js.map +1 -0
  246. package/dist/model/editDocumentSigner.d.ts +121 -0
  247. package/dist/model/editDocumentSigner.js +226 -0
  248. package/dist/model/editDocumentSigner.js.map +1 -0
  249. package/dist/model/editFormField.d.ts +116 -0
  250. package/dist/model/editFormField.js +288 -0
  251. package/dist/model/editFormField.js.map +1 -0
  252. package/dist/model/editSenderIdentityRequest.d.ts +46 -0
  253. package/dist/model/editSenderIdentityRequest.js +64 -0
  254. package/dist/model/editSenderIdentityRequest.js.map +1 -0
  255. package/dist/model/editTemplateRequest.d.ts +52 -0
  256. package/dist/model/editTemplateRequest.js +146 -0
  257. package/dist/model/editTemplateRequest.js.map +1 -0
  258. package/dist/model/editableDateFieldSettings.d.ts +17 -0
  259. package/dist/model/editableDateFieldSettings.js +33 -0
  260. package/dist/model/editableDateFieldSettings.js.map +1 -0
  261. package/dist/model/embeddedCloneDocumentJsonRequest.d.ts +54 -0
  262. package/dist/model/embeddedCloneDocumentJsonRequest.js +115 -0
  263. package/dist/model/embeddedCloneDocumentJsonRequest.js.map +1 -0
  264. package/dist/model/embeddedCloneTemplateJsonRequest.d.ts +54 -0
  265. package/dist/model/embeddedCloneTemplateJsonRequest.js +115 -0
  266. package/dist/model/embeddedCloneTemplateJsonRequest.js.map +1 -0
  267. package/dist/model/embeddedClonedDocument.d.ts +15 -0
  268. package/dist/model/embeddedClonedDocument.js +23 -0
  269. package/dist/model/embeddedClonedDocument.js.map +1 -0
  270. package/dist/model/embeddedClonedTemplate.d.ts +15 -0
  271. package/dist/model/embeddedClonedTemplate.js +23 -0
  272. package/dist/model/embeddedClonedTemplate.js.map +1 -0
  273. package/dist/model/embeddedCreateTemplateRequest.d.ts +97 -0
  274. package/dist/model/embeddedCreateTemplateRequest.js +274 -0
  275. package/dist/model/embeddedCreateTemplateRequest.js.map +1 -0
  276. package/dist/model/embeddedCustomFieldCreated.d.ts +14 -0
  277. package/dist/model/embeddedCustomFieldCreated.js +18 -0
  278. package/dist/model/embeddedCustomFieldCreated.js.map +1 -0
  279. package/dist/model/embeddedDocumentEditJsonRequest.d.ts +51 -0
  280. package/dist/model/embeddedDocumentEditJsonRequest.js +97 -0
  281. package/dist/model/embeddedDocumentEditJsonRequest.js.map +1 -0
  282. package/dist/model/embeddedDocumentEdited.d.ts +14 -0
  283. package/dist/model/embeddedDocumentEdited.js +18 -0
  284. package/dist/model/embeddedDocumentEdited.js.map +1 -0
  285. package/dist/model/embeddedDocumentRequest.d.ts +117 -0
  286. package/dist/model/embeddedDocumentRequest.js +328 -0
  287. package/dist/model/embeddedDocumentRequest.js.map +1 -0
  288. package/dist/model/embeddedFileDetails.d.ts +19 -0
  289. package/dist/model/embeddedFileDetails.js +43 -0
  290. package/dist/model/embeddedFileDetails.js.map +1 -0
  291. package/dist/model/embeddedFileLink.d.ts +14 -0
  292. package/dist/model/embeddedFileLink.js +18 -0
  293. package/dist/model/embeddedFileLink.js.map +1 -0
  294. package/dist/model/embeddedMergeTemplateFormRequest.d.ts +118 -0
  295. package/dist/model/embeddedMergeTemplateFormRequest.js +317 -0
  296. package/dist/model/embeddedMergeTemplateFormRequest.js.map +1 -0
  297. package/dist/model/embeddedSendCreated.d.ts +15 -0
  298. package/dist/model/embeddedSendCreated.js +23 -0
  299. package/dist/model/embeddedSendCreated.js.map +1 -0
  300. package/dist/model/embeddedSendTemplateFormRequest.d.ts +114 -0
  301. package/dist/model/embeddedSendTemplateFormRequest.js +302 -0
  302. package/dist/model/embeddedSendTemplateFormRequest.js.map +1 -0
  303. package/dist/model/embeddedSigningLink.d.ts +14 -0
  304. package/dist/model/embeddedSigningLink.js +18 -0
  305. package/dist/model/embeddedSigningLink.js.map +1 -0
  306. package/dist/model/embeddedTemplateCreated.d.ts +15 -0
  307. package/dist/model/embeddedTemplateCreated.js +23 -0
  308. package/dist/model/embeddedTemplateCreated.js.map +1 -0
  309. package/dist/model/embeddedTemplateEditRequest.d.ts +53 -0
  310. package/dist/model/embeddedTemplateEditRequest.js +109 -0
  311. package/dist/model/embeddedTemplateEditRequest.js.map +1 -0
  312. package/dist/model/embeddedTemplateEdited.d.ts +14 -0
  313. package/dist/model/embeddedTemplateEdited.js +18 -0
  314. package/dist/model/embeddedTemplateEdited.js.map +1 -0
  315. package/dist/model/embeddedTemplatePreview.d.ts +14 -0
  316. package/dist/model/embeddedTemplatePreview.js +18 -0
  317. package/dist/model/embeddedTemplatePreview.js.map +1 -0
  318. package/dist/model/embeddedTemplatePreviewJsonRequest.d.ts +15 -0
  319. package/dist/model/embeddedTemplatePreviewJsonRequest.js +23 -0
  320. package/dist/model/embeddedTemplatePreviewJsonRequest.js.map +1 -0
  321. package/dist/model/errorResponse.d.ts +15 -0
  322. package/dist/model/errorResponse.js +23 -0
  323. package/dist/model/errorResponse.js.map +1 -0
  324. package/dist/model/errorResult.d.ts +14 -0
  325. package/dist/model/errorResult.js +18 -0
  326. package/dist/model/errorResult.js.map +1 -0
  327. package/dist/model/existingFormField.d.ts +19 -0
  328. package/dist/model/existingFormField.js +43 -0
  329. package/dist/model/existingFormField.js.map +1 -0
  330. package/dist/model/extendExpiry.d.ts +17 -0
  331. package/dist/model/extendExpiry.js +33 -0
  332. package/dist/model/extendExpiry.js.map +1 -0
  333. package/dist/model/fileInfo.d.ts +17 -0
  334. package/dist/model/fileInfo.js +33 -0
  335. package/dist/model/fileInfo.js.map +1 -0
  336. package/dist/model/font.d.ts +36 -0
  337. package/dist/model/font.js +70 -0
  338. package/dist/model/font.js.map +1 -0
  339. package/dist/model/formField.d.ts +113 -0
  340. package/dist/model/formField.js +287 -0
  341. package/dist/model/formField.js.map +1 -0
  342. package/dist/model/formFieldPermission.d.ts +16 -0
  343. package/dist/model/formFieldPermission.js +28 -0
  344. package/dist/model/formFieldPermission.js.map +1 -0
  345. package/dist/model/formFieldPermissionWebhookModel.d.ts +16 -0
  346. package/dist/model/formFieldPermissionWebhookModel.js +28 -0
  347. package/dist/model/formFieldPermissionWebhookModel.js.map +1 -0
  348. package/dist/model/formGroup.d.ts +26 -0
  349. package/dist/model/formGroup.js +47 -0
  350. package/dist/model/formGroup.js.map +1 -0
  351. package/dist/model/formulaFieldSettings.d.ts +15 -0
  352. package/dist/model/formulaFieldSettings.js +26 -0
  353. package/dist/model/formulaFieldSettings.js.map +1 -0
  354. package/dist/model/getGroupContactDetails.d.ts +20 -0
  355. package/dist/model/getGroupContactDetails.js +38 -0
  356. package/dist/model/getGroupContactDetails.js.map +1 -0
  357. package/dist/model/groupContact.d.ts +18 -0
  358. package/dist/model/groupContact.js +33 -0
  359. package/dist/model/groupContact.js.map +1 -0
  360. package/dist/model/groupContactDetails.d.ts +17 -0
  361. package/dist/model/groupContactDetails.js +28 -0
  362. package/dist/model/groupContactDetails.js.map +1 -0
  363. package/dist/model/groupContactsList.d.ts +17 -0
  364. package/dist/model/groupContactsList.js +23 -0
  365. package/dist/model/groupContactsList.js.map +1 -0
  366. package/dist/model/groupOption.d.ts +15 -0
  367. package/dist/model/groupOption.js +23 -0
  368. package/dist/model/groupOption.js.map +1 -0
  369. package/dist/model/groupSigner.d.ts +30 -0
  370. package/dist/model/groupSigner.js +59 -0
  371. package/dist/model/groupSigner.js.map +1 -0
  372. package/dist/model/groupSignerSettings.d.ts +15 -0
  373. package/dist/model/groupSignerSettings.js +23 -0
  374. package/dist/model/groupSignerSettings.js.map +1 -0
  375. package/dist/model/groupSignerSettingsWebhookModel.d.ts +15 -0
  376. package/dist/model/groupSignerSettingsWebhookModel.js +23 -0
  377. package/dist/model/groupSignerSettingsWebhookModel.js.map +1 -0
  378. package/dist/model/groupUser.d.ts +15 -0
  379. package/dist/model/groupUser.js +23 -0
  380. package/dist/model/groupUser.js.map +1 -0
  381. package/dist/model/iWebhookData.d.ts +90 -0
  382. package/dist/model/iWebhookData.js +270 -0
  383. package/dist/model/iWebhookData.js.map +1 -0
  384. package/dist/model/idDocument.d.ts +26 -0
  385. package/dist/model/idDocument.js +68 -0
  386. package/dist/model/idDocument.js.map +1 -0
  387. package/dist/model/idReport.d.ts +18 -0
  388. package/dist/model/idReport.js +33 -0
  389. package/dist/model/idReport.js.map +1 -0
  390. package/dist/model/idVerificationDetails.d.ts +23 -0
  391. package/dist/model/idVerificationDetails.js +63 -0
  392. package/dist/model/idVerificationDetails.js.map +1 -0
  393. package/dist/model/idVerificationSignerWebhookModel.d.ts +22 -0
  394. package/dist/model/idVerificationSignerWebhookModel.js +58 -0
  395. package/dist/model/idVerificationSignerWebhookModel.js.map +1 -0
  396. package/dist/model/identityVerificationEvent.d.ts +33 -0
  397. package/dist/model/identityVerificationEvent.js +60 -0
  398. package/dist/model/identityVerificationEvent.js.map +1 -0
  399. package/dist/model/identityVerificationSettings.d.ts +37 -0
  400. package/dist/model/identityVerificationSettings.js +68 -0
  401. package/dist/model/identityVerificationSettings.js.map +1 -0
  402. package/dist/model/imageInfo.d.ts +16 -0
  403. package/dist/model/imageInfo.js +28 -0
  404. package/dist/model/imageInfo.js.map +1 -0
  405. package/dist/model/index.d.ts +208 -0
  406. package/dist/model/index.js +791 -0
  407. package/dist/model/index.js.map +1 -0
  408. package/dist/model/kbaAuthenticationEvent.d.ts +33 -0
  409. package/dist/model/kbaAuthenticationEvent.js +60 -0
  410. package/dist/model/kbaAuthenticationEvent.js.map +1 -0
  411. package/dist/model/kbaDetails.d.ts +17 -0
  412. package/dist/model/kbaDetails.js +33 -0
  413. package/dist/model/kbaDetails.js.map +1 -0
  414. package/dist/model/kbaSettings.d.ts +30 -0
  415. package/dist/model/kbaSettings.js +44 -0
  416. package/dist/model/kbaSettings.js.map +1 -0
  417. package/dist/model/kbaSignerWebhookModel.d.ts +17 -0
  418. package/dist/model/kbaSignerWebhookModel.js +33 -0
  419. package/dist/model/kbaSignerWebhookModel.js.map +1 -0
  420. package/dist/model/mergeAndSendForSignForm.d.ts +81 -0
  421. package/dist/model/mergeAndSendForSignForm.js +238 -0
  422. package/dist/model/mergeAndSendForSignForm.js.map +1 -0
  423. package/dist/model/modelDate.d.ts +16 -0
  424. package/dist/model/modelDate.js +28 -0
  425. package/dist/model/modelDate.js.map +1 -0
  426. package/dist/model/modelError.d.ts +15 -0
  427. package/dist/model/modelError.js +23 -0
  428. package/dist/model/modelError.js.map +1 -0
  429. package/dist/model/models.d.ts +56 -0
  430. package/dist/model/models.js +212 -0
  431. package/dist/model/models.js.map +1 -0
  432. package/dist/model/modificationDetails.d.ts +15 -0
  433. package/dist/model/modificationDetails.js +23 -0
  434. package/dist/model/modificationDetails.js.map +1 -0
  435. package/dist/model/notificationSettings.d.ts +25 -0
  436. package/dist/model/notificationSettings.js +87 -0
  437. package/dist/model/notificationSettings.js.map +1 -0
  438. package/dist/model/pageDetails.d.ts +19 -0
  439. package/dist/model/pageDetails.js +43 -0
  440. package/dist/model/pageDetails.js.map +1 -0
  441. package/dist/model/phoneNumber.d.ts +15 -0
  442. package/dist/model/phoneNumber.js +23 -0
  443. package/dist/model/phoneNumber.js.map +1 -0
  444. package/dist/model/phoneNumberWebhookModel.d.ts +15 -0
  445. package/dist/model/phoneNumberWebhookModel.js +23 -0
  446. package/dist/model/phoneNumberWebhookModel.js.map +1 -0
  447. package/dist/model/prefillField.d.ts +15 -0
  448. package/dist/model/prefillField.js +23 -0
  449. package/dist/model/prefillField.js.map +1 -0
  450. package/dist/model/prefillFieldRequest.d.ts +16 -0
  451. package/dist/model/prefillFieldRequest.js +23 -0
  452. package/dist/model/prefillFieldRequest.js.map +1 -0
  453. package/dist/model/recipientChangeLog.d.ts +17 -0
  454. package/dist/model/recipientChangeLog.js +23 -0
  455. package/dist/model/recipientChangeLog.js.map +1 -0
  456. package/dist/model/recipientNotificationSettings.d.ts +25 -0
  457. package/dist/model/recipientNotificationSettings.js +86 -0
  458. package/dist/model/recipientNotificationSettings.js.map +1 -0
  459. package/dist/model/rectangle.d.ts +17 -0
  460. package/dist/model/rectangle.js +39 -0
  461. package/dist/model/rectangle.js.map +1 -0
  462. package/dist/model/reminderMessage.d.ts +17 -0
  463. package/dist/model/reminderMessage.js +28 -0
  464. package/dist/model/reminderMessage.js.map +1 -0
  465. package/dist/model/reminderSettings.d.ts +16 -0
  466. package/dist/model/reminderSettings.js +33 -0
  467. package/dist/model/reminderSettings.js.map +1 -0
  468. package/dist/model/removeAuthentication.d.ts +18 -0
  469. package/dist/model/removeAuthentication.js +33 -0
  470. package/dist/model/removeAuthentication.js.map +1 -0
  471. package/dist/model/removed.d.ts +16 -0
  472. package/dist/model/removed.js +28 -0
  473. package/dist/model/removed.js.map +1 -0
  474. package/dist/model/revokeDocument.d.ts +15 -0
  475. package/dist/model/revokeDocument.js +23 -0
  476. package/dist/model/revokeDocument.js.map +1 -0
  477. package/dist/model/role.d.ts +117 -0
  478. package/dist/model/role.js +220 -0
  479. package/dist/model/role.js.map +1 -0
  480. package/dist/model/roles.d.ts +114 -0
  481. package/dist/model/roles.js +220 -0
  482. package/dist/model/roles.js.map +1 -0
  483. package/dist/model/sendForSign.d.ts +80 -0
  484. package/dist/model/sendForSign.js +241 -0
  485. package/dist/model/sendForSign.js.map +1 -0
  486. package/dist/model/sendForSignFromTemplateForm.d.ts +77 -0
  487. package/dist/model/sendForSignFromTemplateForm.js +223 -0
  488. package/dist/model/sendForSignFromTemplateForm.js.map +1 -0
  489. package/dist/model/senderIdentityCreated.d.ts +14 -0
  490. package/dist/model/senderIdentityCreated.js +18 -0
  491. package/dist/model/senderIdentityCreated.js.map +1 -0
  492. package/dist/model/senderIdentityCreator.d.ts +17 -0
  493. package/dist/model/senderIdentityCreator.js +33 -0
  494. package/dist/model/senderIdentityCreator.js.map +1 -0
  495. package/dist/model/senderIdentityEvent.d.ts +29 -0
  496. package/dist/model/senderIdentityEvent.js +78 -0
  497. package/dist/model/senderIdentityEvent.js.map +1 -0
  498. package/dist/model/senderIdentityList.d.ts +17 -0
  499. package/dist/model/senderIdentityList.js +23 -0
  500. package/dist/model/senderIdentityList.js.map +1 -0
  501. package/dist/model/senderIdentityViewModel.d.ts +27 -0
  502. package/dist/model/senderIdentityViewModel.js +68 -0
  503. package/dist/model/senderIdentityViewModel.js.map +1 -0
  504. package/dist/model/signatureFrameSettings.d.ts +17 -0
  505. package/dist/model/signatureFrameSettings.js +39 -0
  506. package/dist/model/signatureFrameSettings.js.map +1 -0
  507. package/dist/model/signerAuthenticationSettings.d.ts +15 -0
  508. package/dist/model/signerAuthenticationSettings.js +23 -0
  509. package/dist/model/signerAuthenticationSettings.js.map +1 -0
  510. package/dist/model/signerAuthenticationWebhookModel.d.ts +15 -0
  511. package/dist/model/signerAuthenticationWebhookModel.js +23 -0
  512. package/dist/model/signerAuthenticationWebhookModel.js.map +1 -0
  513. package/dist/model/size.d.ts +15 -0
  514. package/dist/model/size.js +27 -0
  515. package/dist/model/size.js.map +1 -0
  516. package/dist/model/teamCreated.d.ts +14 -0
  517. package/dist/model/teamCreated.js +18 -0
  518. package/dist/model/teamCreated.js.map +1 -0
  519. package/dist/model/teamDocumentRecords.d.ts +17 -0
  520. package/dist/model/teamDocumentRecords.js +23 -0
  521. package/dist/model/teamDocumentRecords.js.map +1 -0
  522. package/dist/model/teamListResponse.d.ts +17 -0
  523. package/dist/model/teamListResponse.js +23 -0
  524. package/dist/model/teamListResponse.js.map +1 -0
  525. package/dist/model/teamPageDetails.d.ts +15 -0
  526. package/dist/model/teamPageDetails.js +23 -0
  527. package/dist/model/teamPageDetails.js.map +1 -0
  528. package/dist/model/teamResponse.d.ts +19 -0
  529. package/dist/model/teamResponse.js +38 -0
  530. package/dist/model/teamResponse.js.map +1 -0
  531. package/dist/model/teamUpdateRequest.d.ts +15 -0
  532. package/dist/model/teamUpdateRequest.js +23 -0
  533. package/dist/model/teamUpdateRequest.js.map +1 -0
  534. package/dist/model/teamUsers.d.ts +31 -0
  535. package/dist/model/teamUsers.js +57 -0
  536. package/dist/model/teamUsers.js.map +1 -0
  537. package/dist/model/teams.d.ts +17 -0
  538. package/dist/model/teams.js +33 -0
  539. package/dist/model/teams.js.map +1 -0
  540. package/dist/model/template.d.ts +52 -0
  541. package/dist/model/template.js +129 -0
  542. package/dist/model/template.js.map +1 -0
  543. package/dist/model/templateCC.d.ts +15 -0
  544. package/dist/model/templateCC.js +23 -0
  545. package/dist/model/templateCC.js.map +1 -0
  546. package/dist/model/templateCcWebhookModel.d.ts +16 -0
  547. package/dist/model/templateCcWebhookModel.js +28 -0
  548. package/dist/model/templateCcWebhookModel.js.map +1 -0
  549. package/dist/model/templateCreated.d.ts +14 -0
  550. package/dist/model/templateCreated.js +18 -0
  551. package/dist/model/templateCreated.js.map +1 -0
  552. package/dist/model/templateEvent.d.ts +56 -0
  553. package/dist/model/templateEvent.js +158 -0
  554. package/dist/model/templateEvent.js.map +1 -0
  555. package/dist/model/templateFiles.d.ts +17 -0
  556. package/dist/model/templateFiles.js +33 -0
  557. package/dist/model/templateFiles.js.map +1 -0
  558. package/dist/model/templateFormFields.d.ts +89 -0
  559. package/dist/model/templateFormFields.js +265 -0
  560. package/dist/model/templateFormFields.js.map +1 -0
  561. package/dist/model/templateGroupSigner.d.ts +15 -0
  562. package/dist/model/templateGroupSigner.js +23 -0
  563. package/dist/model/templateGroupSigner.js.map +1 -0
  564. package/dist/model/templateGroupSignerWebhookModel.d.ts +15 -0
  565. package/dist/model/templateGroupSignerWebhookModel.js +23 -0
  566. package/dist/model/templateGroupSignerWebhookModel.js.map +1 -0
  567. package/dist/model/templateProperties.d.ts +70 -0
  568. package/dist/model/templateProperties.js +192 -0
  569. package/dist/model/templateProperties.js.map +1 -0
  570. package/dist/model/templateRecords.d.ts +17 -0
  571. package/dist/model/templateRecords.js +23 -0
  572. package/dist/model/templateRecords.js.map +1 -0
  573. package/dist/model/templateRole.d.ts +107 -0
  574. package/dist/model/templateRole.js +190 -0
  575. package/dist/model/templateRole.js.map +1 -0
  576. package/dist/model/templateSender.d.ts +18 -0
  577. package/dist/model/templateSender.js +38 -0
  578. package/dist/model/templateSender.js.map +1 -0
  579. package/dist/model/templateSenderDetail.d.ts +15 -0
  580. package/dist/model/templateSenderDetail.js +23 -0
  581. package/dist/model/templateSenderDetail.js.map +1 -0
  582. package/dist/model/templateSenderDetails.d.ts +16 -0
  583. package/dist/model/templateSenderDetails.js +28 -0
  584. package/dist/model/templateSenderDetails.js.map +1 -0
  585. package/dist/model/templateShareErrorResponse.d.ts +17 -0
  586. package/dist/model/templateShareErrorResponse.js +33 -0
  587. package/dist/model/templateShareErrorResponse.js.map +1 -0
  588. package/dist/model/templateShareRequest.d.ts +15 -0
  589. package/dist/model/templateShareRequest.js +18 -0
  590. package/dist/model/templateShareRequest.js.map +1 -0
  591. package/dist/model/templateSharedTemplateDetail.d.ts +21 -0
  592. package/dist/model/templateSharedTemplateDetail.js +30 -0
  593. package/dist/model/templateSharedTemplateDetail.js.map +1 -0
  594. package/dist/model/templateSharing.d.ts +15 -0
  595. package/dist/model/templateSharing.js +18 -0
  596. package/dist/model/templateSharing.js.map +1 -0
  597. package/dist/model/templateSigner.d.ts +44 -0
  598. package/dist/model/templateSigner.js +119 -0
  599. package/dist/model/templateSigner.js.map +1 -0
  600. package/dist/model/templateSignerDetails.d.ts +67 -0
  601. package/dist/model/templateSignerDetails.js +150 -0
  602. package/dist/model/templateSignerDetails.js.map +1 -0
  603. package/dist/model/templateTag.d.ts +17 -0
  604. package/dist/model/templateTag.js +33 -0
  605. package/dist/model/templateTag.js.map +1 -0
  606. package/dist/model/templateTeamShare.d.ts +22 -0
  607. package/dist/model/templateTeamShare.js +31 -0
  608. package/dist/model/templateTeamShare.js.map +1 -0
  609. package/dist/model/templateTeamShareRequest.d.ts +26 -0
  610. package/dist/model/templateTeamShareRequest.js +40 -0
  611. package/dist/model/templateTeamShareRequest.js.map +1 -0
  612. package/dist/model/textTagDefinition.d.ts +91 -0
  613. package/dist/model/textTagDefinition.js +221 -0
  614. package/dist/model/textTagDefinition.js.map +1 -0
  615. package/dist/model/textTagOffset.d.ts +15 -0
  616. package/dist/model/textTagOffset.js +23 -0
  617. package/dist/model/textTagOffset.js.map +1 -0
  618. package/dist/model/updateGroupContact.d.ts +17 -0
  619. package/dist/model/updateGroupContact.js +28 -0
  620. package/dist/model/updateGroupContact.js.map +1 -0
  621. package/dist/model/updateUser.d.ts +28 -0
  622. package/dist/model/updateUser.js +46 -0
  623. package/dist/model/updateUser.js.map +1 -0
  624. package/dist/model/updateUserMetaData.d.ts +17 -0
  625. package/dist/model/updateUserMetaData.js +23 -0
  626. package/dist/model/updateUserMetaData.js.map +1 -0
  627. package/dist/model/userPageDetails.d.ts +15 -0
  628. package/dist/model/userPageDetails.js +23 -0
  629. package/dist/model/userPageDetails.js.map +1 -0
  630. package/dist/model/userProperties.d.ts +26 -0
  631. package/dist/model/userProperties.js +68 -0
  632. package/dist/model/userProperties.js.map +1 -0
  633. package/dist/model/userRecords.d.ts +17 -0
  634. package/dist/model/userRecords.js +23 -0
  635. package/dist/model/userRecords.js.map +1 -0
  636. package/dist/model/usersDetails.d.ts +26 -0
  637. package/dist/model/usersDetails.js +68 -0
  638. package/dist/model/usersDetails.js.map +1 -0
  639. package/dist/model/validation.d.ts +25 -0
  640. package/dist/model/validation.js +38 -0
  641. package/dist/model/validation.js.map +1 -0
  642. package/dist/model/verificationDataRequest.d.ts +18 -0
  643. package/dist/model/verificationDataRequest.js +38 -0
  644. package/dist/model/verificationDataRequest.js.map +1 -0
  645. package/dist/model/viewBrandDetails.d.ts +49 -0
  646. package/dist/model/viewBrandDetails.js +158 -0
  647. package/dist/model/viewBrandDetails.js.map +1 -0
  648. package/dist/model/viewCustomFieldDetails.d.ts +21 -0
  649. package/dist/model/viewCustomFieldDetails.js +48 -0
  650. package/dist/model/viewCustomFieldDetails.js.map +1 -0
  651. package/dist/model/webhookActorDetails.d.ts +25 -0
  652. package/dist/model/webhookActorDetails.js +34 -0
  653. package/dist/model/webhookActorDetails.js.map +1 -0
  654. package/dist/model/webhookContext.d.ts +55 -0
  655. package/dist/model/webhookContext.js +67 -0
  656. package/dist/model/webhookContext.js.map +1 -0
  657. package/dist/model/webhookEvent.d.ts +21 -0
  658. package/dist/model/webhookEvent.js +33 -0
  659. package/dist/model/webhookEvent.js.map +1 -0
  660. package/dist/model/webhookEventMetadata.d.ts +60 -0
  661. package/dist/model/webhookEventMetadata.js +82 -0
  662. package/dist/model/webhookEventMetadata.js.map +1 -0
  663. package/docs/BrandingApi.md +4 -2
  664. package/docs/ExistingFormField.md +1 -0
  665. package/docs/ViewBrandDetails.md +1 -0
  666. package/model/existingFormField.ts +9 -0
  667. package/model/viewBrandDetails.ts +6 -0
  668. package/package.json +1 -1
@@ -0,0 +1,2346 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DocumentApi = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const model_1 = require("../model");
18
+ const _1 = require("./");
19
+ let defaultBasePath = 'https://api.boldsign.com';
20
+ class DocumentApi {
21
+ constructor(basePath) {
22
+ this._basePath = defaultBasePath;
23
+ this._defaultHeaders = { 'User-Agent': _1.USER_AGENT };
24
+ this._useQuerystring = true;
25
+ this.authentications = {
26
+ 'default': new model_1.VoidAuth(),
27
+ 'Bearer': new model_1.ApiKeyAuth('header', 'Authorization'),
28
+ 'X-API-KEY': new model_1.ApiKeyAuth('header', 'X-API-KEY'),
29
+ };
30
+ this.interceptors = [];
31
+ if (basePath) {
32
+ this.basePath = basePath;
33
+ }
34
+ }
35
+ set useQuerystring(value) {
36
+ this._useQuerystring = value;
37
+ }
38
+ set basePath(basePath) {
39
+ this._basePath = basePath;
40
+ }
41
+ set defaultHeaders(defaultHeaders) {
42
+ this._defaultHeaders = Object.assign(Object.assign({}, defaultHeaders), { "User-Agent": _1.USER_AGENT });
43
+ }
44
+ get defaultHeaders() {
45
+ return this._defaultHeaders;
46
+ }
47
+ get basePath() {
48
+ return this._basePath;
49
+ }
50
+ setDefaultAuthentication(auth) {
51
+ this.authentications.default = auth;
52
+ }
53
+ setApiKey(apikey) {
54
+ this.authentications["X-API-KEY"].apiKey = apikey;
55
+ }
56
+ setAccessToken(accessToken) {
57
+ this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
58
+ }
59
+ addInterceptor(interceptor) {
60
+ this.interceptors.push(interceptor);
61
+ }
62
+ addAuthentication(documentId_1, accessCodeDetail_1) {
63
+ return __awaiter(this, arguments, void 0, function* (documentId, accessCodeDetail, options = { headers: {} }) {
64
+ accessCodeDetail = deserializeIfNeeded(accessCodeDetail, "AccessCodeDetail");
65
+ const localVarPath = this.basePath + '/v1/document/addAuthentication';
66
+ let localVarQueryParameters = {};
67
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
68
+ const produces = ['application/json'];
69
+ if (produces.indexOf('application/json') >= 0) {
70
+ localVarHeaderParams['content-type'] = 'application/json';
71
+ }
72
+ else {
73
+ localVarHeaderParams['content-type'] = produces.join(',');
74
+ }
75
+ let localVarFormParams = {};
76
+ let localVarBodyParams = undefined;
77
+ if (documentId === null || documentId === undefined) {
78
+ throw new Error('Required parameter documentId was null or undefined when calling addAuthentication.');
79
+ }
80
+ if (documentId !== undefined) {
81
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
82
+ }
83
+ Object.assign(localVarHeaderParams, options.headers);
84
+ let localVarUseFormData = false;
85
+ const result = (0, _1.generateFormData)(accessCodeDetail, model_1.AccessCodeDetail);
86
+ localVarUseFormData = result.localVarUseFormData;
87
+ let data = {};
88
+ if (localVarUseFormData) {
89
+ const formData = (0, _1.toFormData)(result.data);
90
+ data = formData;
91
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
92
+ }
93
+ else {
94
+ data = model_1.ObjectSerializer.serialize(accessCodeDetail, "AccessCodeDetail");
95
+ }
96
+ let localVarRequestOptions = {
97
+ method: 'PATCH',
98
+ params: localVarQueryParameters,
99
+ headers: localVarHeaderParams,
100
+ url: localVarPath,
101
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
102
+ maxContentLength: Infinity,
103
+ maxBodyLength: Infinity,
104
+ responseType: "json",
105
+ };
106
+ if (localVarRequestOptions.method !== 'GET') {
107
+ localVarRequestOptions.data = data;
108
+ }
109
+ let authenticationPromise = Promise.resolve();
110
+ if (this.authentications["X-API-KEY"].apiKey) {
111
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
112
+ }
113
+ if (this.authentications["Bearer"].apiKey) {
114
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
115
+ }
116
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
117
+ let interceptorPromise = authenticationPromise;
118
+ for (const interceptor of this.interceptors) {
119
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
120
+ }
121
+ return interceptorPromise.then(() => {
122
+ return new Promise((resolve, reject) => {
123
+ axios_1.default.request(localVarRequestOptions)
124
+ .then((response) => {
125
+ handleSuccessfulResponse(resolve, reject, response);
126
+ }, (error) => {
127
+ if (error.response == null) {
128
+ reject(error);
129
+ return;
130
+ }
131
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
132
+ return;
133
+ }
134
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
135
+ return;
136
+ }
137
+ reject(error);
138
+ });
139
+ });
140
+ });
141
+ });
142
+ }
143
+ addTag(documentTags_1) {
144
+ return __awaiter(this, arguments, void 0, function* (documentTags, options = { headers: {} }) {
145
+ documentTags = deserializeIfNeeded(documentTags, "DocumentTags");
146
+ const localVarPath = this.basePath + '/v1/document/addTags';
147
+ let localVarQueryParameters = {};
148
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
149
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
150
+ if (produces.indexOf('application/json') >= 0) {
151
+ localVarHeaderParams['content-type'] = 'application/json';
152
+ }
153
+ else {
154
+ localVarHeaderParams['content-type'] = produces.join(',');
155
+ }
156
+ let localVarFormParams = {};
157
+ let localVarBodyParams = undefined;
158
+ Object.assign(localVarHeaderParams, options.headers);
159
+ let localVarUseFormData = false;
160
+ const result = (0, _1.generateFormData)(documentTags, model_1.DocumentTags);
161
+ localVarUseFormData = result.localVarUseFormData;
162
+ let data = {};
163
+ if (localVarUseFormData) {
164
+ const formData = (0, _1.toFormData)(result.data);
165
+ data = formData;
166
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
167
+ }
168
+ else {
169
+ data = model_1.ObjectSerializer.serialize(documentTags, "DocumentTags");
170
+ }
171
+ let localVarRequestOptions = {
172
+ method: 'PATCH',
173
+ params: localVarQueryParameters,
174
+ headers: localVarHeaderParams,
175
+ url: localVarPath,
176
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
177
+ maxContentLength: Infinity,
178
+ maxBodyLength: Infinity,
179
+ responseType: "json",
180
+ };
181
+ if (localVarRequestOptions.method !== 'GET') {
182
+ localVarRequestOptions.data = data;
183
+ }
184
+ let authenticationPromise = Promise.resolve();
185
+ if (this.authentications["X-API-KEY"].apiKey) {
186
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
187
+ }
188
+ if (this.authentications["Bearer"].apiKey) {
189
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
190
+ }
191
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
192
+ let interceptorPromise = authenticationPromise;
193
+ for (const interceptor of this.interceptors) {
194
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
195
+ }
196
+ return interceptorPromise.then(() => {
197
+ return new Promise((resolve, reject) => {
198
+ axios_1.default.request(localVarRequestOptions)
199
+ .then((response) => {
200
+ handleSuccessfulResponse(resolve, reject, response);
201
+ }, (error) => {
202
+ if (error.response == null) {
203
+ reject(error);
204
+ return;
205
+ }
206
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
207
+ return;
208
+ }
209
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
210
+ return;
211
+ }
212
+ reject(error);
213
+ });
214
+ });
215
+ });
216
+ });
217
+ }
218
+ behalfDocuments(page_1, pageType_1, emailAddress_1, signers_1, pageSize_1, startDate_1, status_1, endDate_1, searchKey_1, labels_1, nextCursor_1, brandIds_1) {
219
+ return __awaiter(this, arguments, void 0, function* (page, pageType, emailAddress, signers, pageSize, startDate, status, endDate, searchKey, labels, nextCursor, brandIds, options = { headers: {} }) {
220
+ const localVarPath = this.basePath + '/v1/document/behalfList';
221
+ let localVarQueryParameters = {};
222
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
223
+ const produces = ['application/json'];
224
+ if (produces.indexOf('application/json') >= 0) {
225
+ localVarHeaderParams['content-type'] = 'application/json';
226
+ }
227
+ else {
228
+ localVarHeaderParams['content-type'] = produces.join(',');
229
+ }
230
+ let localVarFormParams = {};
231
+ let localVarBodyParams = undefined;
232
+ if (page === null || page === undefined) {
233
+ throw new Error('Required parameter page was null or undefined when calling behalfDocuments.');
234
+ }
235
+ if (pageType !== undefined) {
236
+ localVarQueryParameters['PageType'] = model_1.ObjectSerializer.serialize(pageType, "'BehalfOfOthers' | 'BehalfOfMe'");
237
+ }
238
+ if (emailAddress !== undefined) {
239
+ localVarQueryParameters['EmailAddress'] = model_1.ObjectSerializer.serialize(emailAddress, "Array<string>");
240
+ }
241
+ if (signers !== undefined) {
242
+ localVarQueryParameters['Signers'] = model_1.ObjectSerializer.serialize(signers, "Array<string>");
243
+ }
244
+ if (pageSize !== undefined) {
245
+ localVarQueryParameters['PageSize'] = model_1.ObjectSerializer.serialize(pageSize, "number");
246
+ }
247
+ if (page !== undefined) {
248
+ localVarQueryParameters['Page'] = model_1.ObjectSerializer.serialize(page, "number");
249
+ }
250
+ if (startDate !== undefined) {
251
+ localVarQueryParameters['StartDate'] = model_1.ObjectSerializer.serialize(startDate, "Date");
252
+ }
253
+ if (status !== undefined) {
254
+ localVarQueryParameters['Status'] = model_1.ObjectSerializer.serialize(status, "Array<'None' | 'WaitingForMe' | 'WaitingForOthers' | 'NeedAttention' | 'Completed' | 'Declined' | 'Revoked' | 'Expired' | 'Draft' | 'Scheduled'>");
255
+ }
256
+ if (endDate !== undefined) {
257
+ localVarQueryParameters['EndDate'] = model_1.ObjectSerializer.serialize(endDate, "Date");
258
+ }
259
+ if (searchKey !== undefined) {
260
+ localVarQueryParameters['SearchKey'] = model_1.ObjectSerializer.serialize(searchKey, "string");
261
+ }
262
+ if (labels !== undefined) {
263
+ localVarQueryParameters['Labels'] = model_1.ObjectSerializer.serialize(labels, "Array<string>");
264
+ }
265
+ if (nextCursor !== undefined) {
266
+ localVarQueryParameters['NextCursor'] = model_1.ObjectSerializer.serialize(nextCursor, "number");
267
+ }
268
+ if (brandIds !== undefined) {
269
+ localVarQueryParameters['BrandIds'] = model_1.ObjectSerializer.serialize(brandIds, "Array<string>");
270
+ }
271
+ Object.assign(localVarHeaderParams, options.headers);
272
+ let localVarUseFormData = false;
273
+ let data = {};
274
+ if (localVarUseFormData) {
275
+ const formData = (0, _1.toFormData)(localVarFormParams);
276
+ data = formData;
277
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
278
+ }
279
+ let localVarRequestOptions = {
280
+ method: 'GET',
281
+ params: localVarQueryParameters,
282
+ headers: localVarHeaderParams,
283
+ url: localVarPath,
284
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
285
+ maxContentLength: Infinity,
286
+ maxBodyLength: Infinity,
287
+ responseType: "json",
288
+ };
289
+ if (localVarRequestOptions.method !== 'GET') {
290
+ localVarRequestOptions.data = data;
291
+ }
292
+ let authenticationPromise = Promise.resolve();
293
+ if (this.authentications["X-API-KEY"].apiKey) {
294
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
295
+ }
296
+ if (this.authentications["Bearer"].apiKey) {
297
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
298
+ }
299
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
300
+ let interceptorPromise = authenticationPromise;
301
+ for (const interceptor of this.interceptors) {
302
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
303
+ }
304
+ return interceptorPromise.then(() => {
305
+ return new Promise((resolve, reject) => {
306
+ axios_1.default.request(localVarRequestOptions)
307
+ .then((response) => {
308
+ handleSuccessfulResponse(resolve, reject, response, "BehalfDocumentRecords");
309
+ }, (error) => {
310
+ if (error.response == null) {
311
+ reject(error);
312
+ return;
313
+ }
314
+ if (handleErrorCodeResponse(reject, error.response, 200, "BehalfDocumentRecords")) {
315
+ return;
316
+ }
317
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
318
+ return;
319
+ }
320
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
321
+ return;
322
+ }
323
+ reject(error);
324
+ });
325
+ });
326
+ });
327
+ });
328
+ }
329
+ cancelEditing(documentId_1, onBehalfOf_1) {
330
+ return __awaiter(this, arguments, void 0, function* (documentId, onBehalfOf, options = { headers: {} }) {
331
+ const localVarPath = this.basePath + '/v1-beta/document/cancelEditing';
332
+ let localVarQueryParameters = {};
333
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
334
+ const produces = ['application/json'];
335
+ if (produces.indexOf('application/json') >= 0) {
336
+ localVarHeaderParams['content-type'] = 'application/json';
337
+ }
338
+ else {
339
+ localVarHeaderParams['content-type'] = produces.join(',');
340
+ }
341
+ let localVarFormParams = {};
342
+ let localVarBodyParams = undefined;
343
+ if (documentId === null || documentId === undefined) {
344
+ throw new Error('Required parameter documentId was null or undefined when calling cancelEditing.');
345
+ }
346
+ if (documentId !== undefined) {
347
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
348
+ }
349
+ if (onBehalfOf !== undefined) {
350
+ localVarQueryParameters['onBehalfOf'] = model_1.ObjectSerializer.serialize(onBehalfOf, "string");
351
+ }
352
+ Object.assign(localVarHeaderParams, options.headers);
353
+ let localVarUseFormData = false;
354
+ let data = {};
355
+ if (localVarUseFormData) {
356
+ const formData = (0, _1.toFormData)(localVarFormParams);
357
+ data = formData;
358
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
359
+ }
360
+ let localVarRequestOptions = {
361
+ method: 'POST',
362
+ params: localVarQueryParameters,
363
+ headers: localVarHeaderParams,
364
+ url: localVarPath,
365
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
366
+ maxContentLength: Infinity,
367
+ maxBodyLength: Infinity,
368
+ responseType: "json",
369
+ };
370
+ if (localVarRequestOptions.method !== 'GET') {
371
+ localVarRequestOptions.data = data;
372
+ }
373
+ let authenticationPromise = Promise.resolve();
374
+ if (this.authentications["X-API-KEY"].apiKey) {
375
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
376
+ }
377
+ if (this.authentications["Bearer"].apiKey) {
378
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
379
+ }
380
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
381
+ let interceptorPromise = authenticationPromise;
382
+ for (const interceptor of this.interceptors) {
383
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
384
+ }
385
+ return interceptorPromise.then(() => {
386
+ return new Promise((resolve, reject) => {
387
+ axios_1.default.request(localVarRequestOptions)
388
+ .then((response) => {
389
+ handleSuccessfulResponse(resolve, reject, response);
390
+ }, (error) => {
391
+ if (error.response == null) {
392
+ reject(error);
393
+ return;
394
+ }
395
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
396
+ return;
397
+ }
398
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
399
+ return;
400
+ }
401
+ reject(error);
402
+ });
403
+ });
404
+ });
405
+ });
406
+ }
407
+ changeAccessCode(documentId_1, accessCodeDetails_1, emailId_1, zOrder_1) {
408
+ return __awaiter(this, arguments, void 0, function* (documentId, accessCodeDetails, emailId, zOrder, options = { headers: {} }) {
409
+ accessCodeDetails = deserializeIfNeeded(accessCodeDetails, "AccessCodeDetails");
410
+ const localVarPath = this.basePath + '/v1/document/changeAccessCode';
411
+ let localVarQueryParameters = {};
412
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
413
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
414
+ if (produces.indexOf('application/json') >= 0) {
415
+ localVarHeaderParams['content-type'] = 'application/json';
416
+ }
417
+ else {
418
+ localVarHeaderParams['content-type'] = produces.join(',');
419
+ }
420
+ let localVarFormParams = {};
421
+ let localVarBodyParams = undefined;
422
+ if (documentId === null || documentId === undefined) {
423
+ throw new Error('Required parameter documentId was null or undefined when calling changeAccessCode.');
424
+ }
425
+ if (accessCodeDetails === null || accessCodeDetails === undefined) {
426
+ throw new Error('Required parameter accessCodeDetails was null or undefined when calling changeAccessCode.');
427
+ }
428
+ if (documentId !== undefined) {
429
+ localVarQueryParameters['DocumentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
430
+ }
431
+ if (emailId !== undefined) {
432
+ localVarQueryParameters['EmailId'] = model_1.ObjectSerializer.serialize(emailId, "string");
433
+ }
434
+ if (zOrder !== undefined) {
435
+ localVarQueryParameters['ZOrder'] = model_1.ObjectSerializer.serialize(zOrder, "number");
436
+ }
437
+ Object.assign(localVarHeaderParams, options.headers);
438
+ let localVarUseFormData = false;
439
+ const result = (0, _1.generateFormData)(accessCodeDetails, model_1.AccessCodeDetails);
440
+ localVarUseFormData = result.localVarUseFormData;
441
+ let data = {};
442
+ if (localVarUseFormData) {
443
+ const formData = (0, _1.toFormData)(result.data);
444
+ data = formData;
445
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
446
+ }
447
+ else {
448
+ data = model_1.ObjectSerializer.serialize(accessCodeDetails, "AccessCodeDetails");
449
+ }
450
+ let localVarRequestOptions = {
451
+ method: 'PATCH',
452
+ params: localVarQueryParameters,
453
+ headers: localVarHeaderParams,
454
+ url: localVarPath,
455
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
456
+ maxContentLength: Infinity,
457
+ maxBodyLength: Infinity,
458
+ responseType: "json",
459
+ };
460
+ if (localVarRequestOptions.method !== 'GET') {
461
+ localVarRequestOptions.data = data;
462
+ }
463
+ let authenticationPromise = Promise.resolve();
464
+ if (this.authentications["X-API-KEY"].apiKey) {
465
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
466
+ }
467
+ if (this.authentications["Bearer"].apiKey) {
468
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
469
+ }
470
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
471
+ let interceptorPromise = authenticationPromise;
472
+ for (const interceptor of this.interceptors) {
473
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
474
+ }
475
+ return interceptorPromise.then(() => {
476
+ return new Promise((resolve, reject) => {
477
+ axios_1.default.request(localVarRequestOptions)
478
+ .then((response) => {
479
+ handleSuccessfulResponse(resolve, reject, response);
480
+ }, (error) => {
481
+ if (error.response == null) {
482
+ reject(error);
483
+ return;
484
+ }
485
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
486
+ return;
487
+ }
488
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
489
+ return;
490
+ }
491
+ reject(error);
492
+ });
493
+ });
494
+ });
495
+ });
496
+ }
497
+ changeRecipient(documentId_1, changeRecipient_1) {
498
+ return __awaiter(this, arguments, void 0, function* (documentId, changeRecipient, options = { headers: {} }) {
499
+ changeRecipient = deserializeIfNeeded(changeRecipient, "ChangeRecipient");
500
+ const localVarPath = this.basePath + '/v1/document/changeRecipient';
501
+ let localVarQueryParameters = {};
502
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
503
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
504
+ if (produces.indexOf('application/json') >= 0) {
505
+ localVarHeaderParams['content-type'] = 'application/json';
506
+ }
507
+ else {
508
+ localVarHeaderParams['content-type'] = produces.join(',');
509
+ }
510
+ let localVarFormParams = {};
511
+ let localVarBodyParams = undefined;
512
+ if (documentId === null || documentId === undefined) {
513
+ throw new Error('Required parameter documentId was null or undefined when calling changeRecipient.');
514
+ }
515
+ if (changeRecipient === null || changeRecipient === undefined) {
516
+ throw new Error('Required parameter changeRecipient was null or undefined when calling changeRecipient.');
517
+ }
518
+ if (documentId !== undefined) {
519
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
520
+ }
521
+ Object.assign(localVarHeaderParams, options.headers);
522
+ let localVarUseFormData = false;
523
+ const result = (0, _1.generateFormData)(changeRecipient, model_1.ChangeRecipient);
524
+ localVarUseFormData = result.localVarUseFormData;
525
+ let data = {};
526
+ if (localVarUseFormData) {
527
+ const formData = (0, _1.toFormData)(result.data);
528
+ data = formData;
529
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
530
+ }
531
+ else {
532
+ data = model_1.ObjectSerializer.serialize(changeRecipient, "ChangeRecipient");
533
+ }
534
+ let localVarRequestOptions = {
535
+ method: 'PATCH',
536
+ params: localVarQueryParameters,
537
+ headers: localVarHeaderParams,
538
+ url: localVarPath,
539
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
540
+ maxContentLength: Infinity,
541
+ maxBodyLength: Infinity,
542
+ responseType: "json",
543
+ };
544
+ if (localVarRequestOptions.method !== 'GET') {
545
+ localVarRequestOptions.data = data;
546
+ }
547
+ let authenticationPromise = Promise.resolve();
548
+ if (this.authentications["X-API-KEY"].apiKey) {
549
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
550
+ }
551
+ if (this.authentications["Bearer"].apiKey) {
552
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
553
+ }
554
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
555
+ let interceptorPromise = authenticationPromise;
556
+ for (const interceptor of this.interceptors) {
557
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
558
+ }
559
+ return interceptorPromise.then(() => {
560
+ return new Promise((resolve, reject) => {
561
+ axios_1.default.request(localVarRequestOptions)
562
+ .then((response) => {
563
+ handleSuccessfulResponse(resolve, reject, response);
564
+ }, (error) => {
565
+ if (error.response == null) {
566
+ reject(error);
567
+ return;
568
+ }
569
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
570
+ return;
571
+ }
572
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
573
+ return;
574
+ }
575
+ reject(error);
576
+ });
577
+ });
578
+ });
579
+ });
580
+ }
581
+ createEmbeddedDocumentCloneUrl(documentId_1, embeddedCloneDocumentJsonRequest_1) {
582
+ return __awaiter(this, arguments, void 0, function* (documentId, embeddedCloneDocumentJsonRequest, options = { headers: {} }) {
583
+ embeddedCloneDocumentJsonRequest = deserializeIfNeeded(embeddedCloneDocumentJsonRequest, "EmbeddedCloneDocumentJsonRequest");
584
+ const localVarPath = this.basePath + '/v1-beta/document/createEmbeddedCloneUrl';
585
+ let localVarQueryParameters = {};
586
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
587
+ const produces = ['application/json'];
588
+ if (produces.indexOf('application/json') >= 0) {
589
+ localVarHeaderParams['content-type'] = 'application/json';
590
+ }
591
+ else {
592
+ localVarHeaderParams['content-type'] = produces.join(',');
593
+ }
594
+ let localVarFormParams = {};
595
+ let localVarBodyParams = undefined;
596
+ if (documentId === null || documentId === undefined) {
597
+ throw new Error('Required parameter documentId was null or undefined when calling createEmbeddedDocumentCloneUrl.');
598
+ }
599
+ if (documentId !== undefined) {
600
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
601
+ }
602
+ Object.assign(localVarHeaderParams, options.headers);
603
+ let localVarUseFormData = false;
604
+ const result = (0, _1.generateFormData)(embeddedCloneDocumentJsonRequest, model_1.EmbeddedCloneDocumentJsonRequest);
605
+ localVarUseFormData = result.localVarUseFormData;
606
+ let data = {};
607
+ if (localVarUseFormData) {
608
+ const formData = (0, _1.toFormData)(result.data);
609
+ data = formData;
610
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
611
+ }
612
+ else {
613
+ data = model_1.ObjectSerializer.serialize(embeddedCloneDocumentJsonRequest, "EmbeddedCloneDocumentJsonRequest");
614
+ }
615
+ let localVarRequestOptions = {
616
+ method: 'POST',
617
+ params: localVarQueryParameters,
618
+ headers: localVarHeaderParams,
619
+ url: localVarPath,
620
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
621
+ maxContentLength: Infinity,
622
+ maxBodyLength: Infinity,
623
+ responseType: "json",
624
+ };
625
+ if (localVarRequestOptions.method !== 'GET') {
626
+ localVarRequestOptions.data = data;
627
+ }
628
+ let authenticationPromise = Promise.resolve();
629
+ if (this.authentications["X-API-KEY"].apiKey) {
630
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
631
+ }
632
+ if (this.authentications["Bearer"].apiKey) {
633
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
634
+ }
635
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
636
+ let interceptorPromise = authenticationPromise;
637
+ for (const interceptor of this.interceptors) {
638
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
639
+ }
640
+ return interceptorPromise.then(() => {
641
+ return new Promise((resolve, reject) => {
642
+ axios_1.default.request(localVarRequestOptions)
643
+ .then((response) => {
644
+ handleSuccessfulResponse(resolve, reject, response, "EmbeddedClonedDocument");
645
+ }, (error) => {
646
+ if (error.response == null) {
647
+ reject(error);
648
+ return;
649
+ }
650
+ if (handleErrorCodeResponse(reject, error.response, 201, "EmbeddedClonedDocument")) {
651
+ return;
652
+ }
653
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
654
+ return;
655
+ }
656
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
657
+ return;
658
+ }
659
+ reject(error);
660
+ });
661
+ });
662
+ });
663
+ });
664
+ }
665
+ createEmbeddedEditUrl(documentId_1, embeddedDocumentEditJsonRequest_1) {
666
+ return __awaiter(this, arguments, void 0, function* (documentId, embeddedDocumentEditJsonRequest, options = { headers: {} }) {
667
+ embeddedDocumentEditJsonRequest = deserializeIfNeeded(embeddedDocumentEditJsonRequest, "EmbeddedDocumentEditJsonRequest");
668
+ const localVarPath = this.basePath + '/v1-beta/document/createEmbeddedEditUrl';
669
+ let localVarQueryParameters = {};
670
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
671
+ const produces = ['application/json'];
672
+ if (produces.indexOf('application/json') >= 0) {
673
+ localVarHeaderParams['content-type'] = 'application/json';
674
+ }
675
+ else {
676
+ localVarHeaderParams['content-type'] = produces.join(',');
677
+ }
678
+ let localVarFormParams = {};
679
+ let localVarBodyParams = undefined;
680
+ if (documentId === null || documentId === undefined) {
681
+ throw new Error('Required parameter documentId was null or undefined when calling createEmbeddedEditUrl.');
682
+ }
683
+ if (documentId !== undefined) {
684
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
685
+ }
686
+ Object.assign(localVarHeaderParams, options.headers);
687
+ let localVarUseFormData = false;
688
+ const result = (0, _1.generateFormData)(embeddedDocumentEditJsonRequest, model_1.EmbeddedDocumentEditJsonRequest);
689
+ localVarUseFormData = result.localVarUseFormData;
690
+ let data = {};
691
+ if (localVarUseFormData) {
692
+ const formData = (0, _1.toFormData)(result.data);
693
+ data = formData;
694
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
695
+ }
696
+ else {
697
+ data = model_1.ObjectSerializer.serialize(embeddedDocumentEditJsonRequest, "EmbeddedDocumentEditJsonRequest");
698
+ }
699
+ let localVarRequestOptions = {
700
+ method: 'POST',
701
+ params: localVarQueryParameters,
702
+ headers: localVarHeaderParams,
703
+ url: localVarPath,
704
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
705
+ maxContentLength: Infinity,
706
+ maxBodyLength: Infinity,
707
+ responseType: "json",
708
+ };
709
+ if (localVarRequestOptions.method !== 'GET') {
710
+ localVarRequestOptions.data = data;
711
+ }
712
+ let authenticationPromise = Promise.resolve();
713
+ if (this.authentications["X-API-KEY"].apiKey) {
714
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
715
+ }
716
+ if (this.authentications["Bearer"].apiKey) {
717
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
718
+ }
719
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
720
+ let interceptorPromise = authenticationPromise;
721
+ for (const interceptor of this.interceptors) {
722
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
723
+ }
724
+ return interceptorPromise.then(() => {
725
+ return new Promise((resolve, reject) => {
726
+ axios_1.default.request(localVarRequestOptions)
727
+ .then((response) => {
728
+ handleSuccessfulResponse(resolve, reject, response, "EmbeddedDocumentEdited");
729
+ }, (error) => {
730
+ if (error.response == null) {
731
+ reject(error);
732
+ return;
733
+ }
734
+ if (handleErrorCodeResponse(reject, error.response, 201, "EmbeddedDocumentEdited")) {
735
+ return;
736
+ }
737
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
738
+ return;
739
+ }
740
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
741
+ return;
742
+ }
743
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
744
+ return;
745
+ }
746
+ if (handleErrorCodeResponse(reject, error.response, 422, "ErrorResult")) {
747
+ return;
748
+ }
749
+ reject(error);
750
+ });
751
+ });
752
+ });
753
+ });
754
+ }
755
+ createEmbeddedRequestUrlDocument(embeddedDocumentRequest_1) {
756
+ return __awaiter(this, arguments, void 0, function* (embeddedDocumentRequest, options = { headers: {} }) {
757
+ embeddedDocumentRequest = deserializeIfNeeded(embeddedDocumentRequest, "EmbeddedDocumentRequest");
758
+ const localVarPath = this.basePath + '/v1/document/createEmbeddedRequestUrl';
759
+ let localVarQueryParameters = {};
760
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
761
+ const produces = ['application/json'];
762
+ if (produces.indexOf('application/json') >= 0) {
763
+ localVarHeaderParams['content-type'] = 'application/json';
764
+ }
765
+ else {
766
+ localVarHeaderParams['content-type'] = produces.join(',');
767
+ }
768
+ let localVarFormParams = {};
769
+ let localVarBodyParams = undefined;
770
+ Object.assign(localVarHeaderParams, options.headers);
771
+ let localVarUseFormData = false;
772
+ const result = (0, _1.generateFormData)(embeddedDocumentRequest, model_1.EmbeddedDocumentRequest);
773
+ localVarUseFormData = result.localVarUseFormData;
774
+ let data = {};
775
+ if (localVarUseFormData) {
776
+ const formData = (0, _1.toFormData)(result.data);
777
+ data = formData;
778
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
779
+ }
780
+ else {
781
+ data = model_1.ObjectSerializer.serialize(embeddedDocumentRequest, "EmbeddedDocumentRequest");
782
+ }
783
+ let localVarRequestOptions = {
784
+ method: 'POST',
785
+ params: localVarQueryParameters,
786
+ headers: localVarHeaderParams,
787
+ url: localVarPath,
788
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
789
+ maxContentLength: Infinity,
790
+ maxBodyLength: Infinity,
791
+ responseType: "json",
792
+ };
793
+ if (localVarRequestOptions.method !== 'GET') {
794
+ localVarRequestOptions.data = data;
795
+ }
796
+ let authenticationPromise = Promise.resolve();
797
+ if (this.authentications["X-API-KEY"].apiKey) {
798
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
799
+ }
800
+ if (this.authentications["Bearer"].apiKey) {
801
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
802
+ }
803
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
804
+ let interceptorPromise = authenticationPromise;
805
+ for (const interceptor of this.interceptors) {
806
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
807
+ }
808
+ return interceptorPromise.then(() => {
809
+ return new Promise((resolve, reject) => {
810
+ axios_1.default.request(localVarRequestOptions)
811
+ .then((response) => {
812
+ handleSuccessfulResponse(resolve, reject, response, "EmbeddedSendCreated");
813
+ }, (error) => {
814
+ if (error.response == null) {
815
+ reject(error);
816
+ return;
817
+ }
818
+ if (handleErrorCodeResponse(reject, error.response, 201, "EmbeddedSendCreated")) {
819
+ return;
820
+ }
821
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
822
+ return;
823
+ }
824
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
825
+ return;
826
+ }
827
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
828
+ return;
829
+ }
830
+ if (handleErrorCodeResponse(reject, error.response, 422, "ErrorResult")) {
831
+ return;
832
+ }
833
+ reject(error);
834
+ });
835
+ });
836
+ });
837
+ });
838
+ }
839
+ deleteDocument(documentId_1, deletePermanently_1) {
840
+ return __awaiter(this, arguments, void 0, function* (documentId, deletePermanently, options = { headers: {} }) {
841
+ const localVarPath = this.basePath + '/v1/document/delete';
842
+ let localVarQueryParameters = {};
843
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
844
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
845
+ if (produces.indexOf('application/json') >= 0) {
846
+ localVarHeaderParams['content-type'] = 'application/json';
847
+ }
848
+ else {
849
+ localVarHeaderParams['content-type'] = produces.join(',');
850
+ }
851
+ let localVarFormParams = {};
852
+ let localVarBodyParams = undefined;
853
+ if (documentId === null || documentId === undefined) {
854
+ throw new Error('Required parameter documentId was null or undefined when calling deleteDocument.');
855
+ }
856
+ if (documentId !== undefined) {
857
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
858
+ }
859
+ if (deletePermanently !== undefined) {
860
+ localVarQueryParameters['deletePermanently'] = model_1.ObjectSerializer.serialize(deletePermanently, "boolean");
861
+ }
862
+ Object.assign(localVarHeaderParams, options.headers);
863
+ let localVarUseFormData = false;
864
+ let data = {};
865
+ if (localVarUseFormData) {
866
+ const formData = (0, _1.toFormData)(localVarFormParams);
867
+ data = formData;
868
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
869
+ }
870
+ let localVarRequestOptions = {
871
+ method: 'DELETE',
872
+ params: localVarQueryParameters,
873
+ headers: localVarHeaderParams,
874
+ url: localVarPath,
875
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
876
+ maxContentLength: Infinity,
877
+ maxBodyLength: Infinity,
878
+ responseType: "json",
879
+ };
880
+ if (localVarRequestOptions.method !== 'GET') {
881
+ localVarRequestOptions.data = data;
882
+ }
883
+ let authenticationPromise = Promise.resolve();
884
+ if (this.authentications["X-API-KEY"].apiKey) {
885
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
886
+ }
887
+ if (this.authentications["Bearer"].apiKey) {
888
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
889
+ }
890
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
891
+ let interceptorPromise = authenticationPromise;
892
+ for (const interceptor of this.interceptors) {
893
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
894
+ }
895
+ return interceptorPromise.then(() => {
896
+ return new Promise((resolve, reject) => {
897
+ axios_1.default.request(localVarRequestOptions)
898
+ .then((response) => {
899
+ handleSuccessfulResponse(resolve, reject, response);
900
+ }, (error) => {
901
+ if (error.response == null) {
902
+ reject(error);
903
+ return;
904
+ }
905
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
906
+ return;
907
+ }
908
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
909
+ return;
910
+ }
911
+ reject(error);
912
+ });
913
+ });
914
+ });
915
+ });
916
+ }
917
+ deleteTag(documentTags_1) {
918
+ return __awaiter(this, arguments, void 0, function* (documentTags, options = { headers: {} }) {
919
+ documentTags = deserializeIfNeeded(documentTags, "DocumentTags");
920
+ const localVarPath = this.basePath + '/v1/document/deleteTags';
921
+ let localVarQueryParameters = {};
922
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
923
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
924
+ if (produces.indexOf('application/json') >= 0) {
925
+ localVarHeaderParams['content-type'] = 'application/json';
926
+ }
927
+ else {
928
+ localVarHeaderParams['content-type'] = produces.join(',');
929
+ }
930
+ let localVarFormParams = {};
931
+ let localVarBodyParams = undefined;
932
+ Object.assign(localVarHeaderParams, options.headers);
933
+ let localVarUseFormData = false;
934
+ const result = (0, _1.generateFormData)(documentTags, model_1.DocumentTags);
935
+ localVarUseFormData = result.localVarUseFormData;
936
+ let data = {};
937
+ if (localVarUseFormData) {
938
+ const formData = (0, _1.toFormData)(result.data);
939
+ data = formData;
940
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
941
+ }
942
+ else {
943
+ data = model_1.ObjectSerializer.serialize(documentTags, "DocumentTags");
944
+ }
945
+ let localVarRequestOptions = {
946
+ method: 'DELETE',
947
+ params: localVarQueryParameters,
948
+ headers: localVarHeaderParams,
949
+ url: localVarPath,
950
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
951
+ maxContentLength: Infinity,
952
+ maxBodyLength: Infinity,
953
+ responseType: "json",
954
+ };
955
+ if (localVarRequestOptions.method !== 'GET') {
956
+ localVarRequestOptions.data = data;
957
+ }
958
+ let authenticationPromise = Promise.resolve();
959
+ if (this.authentications["X-API-KEY"].apiKey) {
960
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
961
+ }
962
+ if (this.authentications["Bearer"].apiKey) {
963
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
964
+ }
965
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
966
+ let interceptorPromise = authenticationPromise;
967
+ for (const interceptor of this.interceptors) {
968
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
969
+ }
970
+ return interceptorPromise.then(() => {
971
+ return new Promise((resolve, reject) => {
972
+ axios_1.default.request(localVarRequestOptions)
973
+ .then((response) => {
974
+ handleSuccessfulResponse(resolve, reject, response);
975
+ }, (error) => {
976
+ if (error.response == null) {
977
+ reject(error);
978
+ return;
979
+ }
980
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
981
+ return;
982
+ }
983
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
984
+ return;
985
+ }
986
+ reject(error);
987
+ });
988
+ });
989
+ });
990
+ });
991
+ }
992
+ downloadAttachment(documentId_1, attachmentId_1, onBehalfOf_1) {
993
+ return __awaiter(this, arguments, void 0, function* (documentId, attachmentId, onBehalfOf, options = { headers: {} }) {
994
+ const localVarPath = this.basePath + '/v1/document/downloadAttachment';
995
+ let localVarQueryParameters = {};
996
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
997
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
998
+ if (produces.indexOf('application/json') >= 0) {
999
+ localVarHeaderParams['content-type'] = 'application/json';
1000
+ }
1001
+ else {
1002
+ localVarHeaderParams['content-type'] = produces.join(',');
1003
+ }
1004
+ let localVarFormParams = {};
1005
+ let localVarBodyParams = undefined;
1006
+ if (documentId === null || documentId === undefined) {
1007
+ throw new Error('Required parameter documentId was null or undefined when calling downloadAttachment.');
1008
+ }
1009
+ if (attachmentId === null || attachmentId === undefined) {
1010
+ throw new Error('Required parameter attachmentId was null or undefined when calling downloadAttachment.');
1011
+ }
1012
+ if (documentId !== undefined) {
1013
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1014
+ }
1015
+ if (attachmentId !== undefined) {
1016
+ localVarQueryParameters['attachmentId'] = model_1.ObjectSerializer.serialize(attachmentId, "string");
1017
+ }
1018
+ if (onBehalfOf !== undefined) {
1019
+ localVarQueryParameters['onBehalfOf'] = model_1.ObjectSerializer.serialize(onBehalfOf, "string");
1020
+ }
1021
+ Object.assign(localVarHeaderParams, options.headers);
1022
+ let localVarUseFormData = false;
1023
+ let data = {};
1024
+ if (localVarUseFormData) {
1025
+ const formData = (0, _1.toFormData)(localVarFormParams);
1026
+ data = formData;
1027
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1028
+ }
1029
+ let localVarRequestOptions = {
1030
+ method: 'GET',
1031
+ params: localVarQueryParameters,
1032
+ headers: localVarHeaderParams,
1033
+ url: localVarPath,
1034
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1035
+ maxContentLength: Infinity,
1036
+ maxBodyLength: Infinity,
1037
+ responseType: "arraybuffer",
1038
+ };
1039
+ if (localVarRequestOptions.method !== 'GET') {
1040
+ localVarRequestOptions.data = data;
1041
+ }
1042
+ let authenticationPromise = Promise.resolve();
1043
+ if (this.authentications["X-API-KEY"].apiKey) {
1044
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1045
+ }
1046
+ if (this.authentications["Bearer"].apiKey) {
1047
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1048
+ }
1049
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1050
+ let interceptorPromise = authenticationPromise;
1051
+ for (const interceptor of this.interceptors) {
1052
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1053
+ }
1054
+ return interceptorPromise.then(() => {
1055
+ return new Promise((resolve, reject) => {
1056
+ axios_1.default.request(localVarRequestOptions)
1057
+ .then((response) => {
1058
+ handleSuccessfulResponse(resolve, reject, response, "Buffer");
1059
+ }, (error) => {
1060
+ if (error.response == null) {
1061
+ reject(error);
1062
+ return;
1063
+ }
1064
+ if (handleErrorCodeResponse(reject, error.response, 200, "RequestFile")) {
1065
+ return;
1066
+ }
1067
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1068
+ return;
1069
+ }
1070
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1071
+ return;
1072
+ }
1073
+ reject(error);
1074
+ });
1075
+ });
1076
+ });
1077
+ });
1078
+ }
1079
+ downloadAuditLog(documentId_1, onBehalfOf_1) {
1080
+ return __awaiter(this, arguments, void 0, function* (documentId, onBehalfOf, options = { headers: {} }) {
1081
+ const localVarPath = this.basePath + '/v1/document/downloadAuditLog';
1082
+ let localVarQueryParameters = {};
1083
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1084
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1085
+ if (produces.indexOf('application/json') >= 0) {
1086
+ localVarHeaderParams['content-type'] = 'application/json';
1087
+ }
1088
+ else {
1089
+ localVarHeaderParams['content-type'] = produces.join(',');
1090
+ }
1091
+ let localVarFormParams = {};
1092
+ let localVarBodyParams = undefined;
1093
+ if (documentId === null || documentId === undefined) {
1094
+ throw new Error('Required parameter documentId was null or undefined when calling downloadAuditLog.');
1095
+ }
1096
+ if (documentId !== undefined) {
1097
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1098
+ }
1099
+ if (onBehalfOf !== undefined) {
1100
+ localVarQueryParameters['onBehalfOf'] = model_1.ObjectSerializer.serialize(onBehalfOf, "string");
1101
+ }
1102
+ Object.assign(localVarHeaderParams, options.headers);
1103
+ let localVarUseFormData = false;
1104
+ let data = {};
1105
+ if (localVarUseFormData) {
1106
+ const formData = (0, _1.toFormData)(localVarFormParams);
1107
+ data = formData;
1108
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1109
+ }
1110
+ let localVarRequestOptions = {
1111
+ method: 'GET',
1112
+ params: localVarQueryParameters,
1113
+ headers: localVarHeaderParams,
1114
+ url: localVarPath,
1115
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1116
+ maxContentLength: Infinity,
1117
+ maxBodyLength: Infinity,
1118
+ responseType: "arraybuffer",
1119
+ };
1120
+ if (localVarRequestOptions.method !== 'GET') {
1121
+ localVarRequestOptions.data = data;
1122
+ }
1123
+ let authenticationPromise = Promise.resolve();
1124
+ if (this.authentications["X-API-KEY"].apiKey) {
1125
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1126
+ }
1127
+ if (this.authentications["Bearer"].apiKey) {
1128
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1129
+ }
1130
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1131
+ let interceptorPromise = authenticationPromise;
1132
+ for (const interceptor of this.interceptors) {
1133
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1134
+ }
1135
+ return interceptorPromise.then(() => {
1136
+ return new Promise((resolve, reject) => {
1137
+ axios_1.default.request(localVarRequestOptions)
1138
+ .then((response) => {
1139
+ handleSuccessfulResponse(resolve, reject, response, "Buffer");
1140
+ }, (error) => {
1141
+ if (error.response == null) {
1142
+ reject(error);
1143
+ return;
1144
+ }
1145
+ if (handleErrorCodeResponse(reject, error.response, 200, "RequestFile")) {
1146
+ return;
1147
+ }
1148
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1149
+ return;
1150
+ }
1151
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1152
+ return;
1153
+ }
1154
+ reject(error);
1155
+ });
1156
+ });
1157
+ });
1158
+ });
1159
+ }
1160
+ downloadDocument(documentId_1, onBehalfOf_1, format_1) {
1161
+ return __awaiter(this, arguments, void 0, function* (documentId, onBehalfOf, format, options = { headers: {} }) {
1162
+ const localVarPath = this.basePath + '/v1/document/download';
1163
+ let localVarQueryParameters = {};
1164
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1165
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1166
+ if (produces.indexOf('application/json') >= 0) {
1167
+ localVarHeaderParams['content-type'] = 'application/json';
1168
+ }
1169
+ else {
1170
+ localVarHeaderParams['content-type'] = produces.join(',');
1171
+ }
1172
+ let localVarFormParams = {};
1173
+ let localVarBodyParams = undefined;
1174
+ if (documentId === null || documentId === undefined) {
1175
+ throw new Error('Required parameter documentId was null or undefined when calling downloadDocument.');
1176
+ }
1177
+ if (documentId !== undefined) {
1178
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1179
+ }
1180
+ if (onBehalfOf !== undefined) {
1181
+ localVarQueryParameters['onBehalfOf'] = model_1.ObjectSerializer.serialize(onBehalfOf, "string");
1182
+ }
1183
+ if (format !== undefined) {
1184
+ localVarQueryParameters['format'] = model_1.ObjectSerializer.serialize(format, "'Combined' | 'Individually'");
1185
+ }
1186
+ Object.assign(localVarHeaderParams, options.headers);
1187
+ let localVarUseFormData = false;
1188
+ let data = {};
1189
+ if (localVarUseFormData) {
1190
+ const formData = (0, _1.toFormData)(localVarFormParams);
1191
+ data = formData;
1192
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1193
+ }
1194
+ let localVarRequestOptions = {
1195
+ method: 'GET',
1196
+ params: localVarQueryParameters,
1197
+ headers: localVarHeaderParams,
1198
+ url: localVarPath,
1199
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1200
+ maxContentLength: Infinity,
1201
+ maxBodyLength: Infinity,
1202
+ responseType: "arraybuffer",
1203
+ };
1204
+ if (localVarRequestOptions.method !== 'GET') {
1205
+ localVarRequestOptions.data = data;
1206
+ }
1207
+ let authenticationPromise = Promise.resolve();
1208
+ if (this.authentications["X-API-KEY"].apiKey) {
1209
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1210
+ }
1211
+ if (this.authentications["Bearer"].apiKey) {
1212
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1213
+ }
1214
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1215
+ let interceptorPromise = authenticationPromise;
1216
+ for (const interceptor of this.interceptors) {
1217
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1218
+ }
1219
+ return interceptorPromise.then(() => {
1220
+ return new Promise((resolve, reject) => {
1221
+ axios_1.default.request(localVarRequestOptions)
1222
+ .then((response) => {
1223
+ handleSuccessfulResponse(resolve, reject, response, "Buffer");
1224
+ }, (error) => {
1225
+ if (error.response == null) {
1226
+ reject(error);
1227
+ return;
1228
+ }
1229
+ if (handleErrorCodeResponse(reject, error.response, 200, "RequestFile")) {
1230
+ return;
1231
+ }
1232
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1233
+ return;
1234
+ }
1235
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1236
+ return;
1237
+ }
1238
+ reject(error);
1239
+ });
1240
+ });
1241
+ });
1242
+ });
1243
+ }
1244
+ draftSend(documentId_1) {
1245
+ return __awaiter(this, arguments, void 0, function* (documentId, options = { headers: {} }) {
1246
+ const localVarPath = this.basePath + '/v1-beta/document/draftSend';
1247
+ let localVarQueryParameters = {};
1248
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1249
+ const produces = ['application/json'];
1250
+ if (produces.indexOf('application/json') >= 0) {
1251
+ localVarHeaderParams['content-type'] = 'application/json';
1252
+ }
1253
+ else {
1254
+ localVarHeaderParams['content-type'] = produces.join(',');
1255
+ }
1256
+ let localVarFormParams = {};
1257
+ let localVarBodyParams = undefined;
1258
+ if (documentId === null || documentId === undefined) {
1259
+ throw new Error('Required parameter documentId was null or undefined when calling draftSend.');
1260
+ }
1261
+ if (documentId !== undefined) {
1262
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1263
+ }
1264
+ Object.assign(localVarHeaderParams, options.headers);
1265
+ let localVarUseFormData = false;
1266
+ let data = {};
1267
+ if (localVarUseFormData) {
1268
+ const formData = (0, _1.toFormData)(localVarFormParams);
1269
+ data = formData;
1270
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1271
+ }
1272
+ let localVarRequestOptions = {
1273
+ method: 'POST',
1274
+ params: localVarQueryParameters,
1275
+ headers: localVarHeaderParams,
1276
+ url: localVarPath,
1277
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1278
+ maxContentLength: Infinity,
1279
+ maxBodyLength: Infinity,
1280
+ responseType: "json",
1281
+ };
1282
+ if (localVarRequestOptions.method !== 'GET') {
1283
+ localVarRequestOptions.data = data;
1284
+ }
1285
+ let authenticationPromise = Promise.resolve();
1286
+ if (this.authentications["X-API-KEY"].apiKey) {
1287
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1288
+ }
1289
+ if (this.authentications["Bearer"].apiKey) {
1290
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1291
+ }
1292
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1293
+ let interceptorPromise = authenticationPromise;
1294
+ for (const interceptor of this.interceptors) {
1295
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1296
+ }
1297
+ return interceptorPromise.then(() => {
1298
+ return new Promise((resolve, reject) => {
1299
+ axios_1.default.request(localVarRequestOptions)
1300
+ .then((response) => {
1301
+ handleSuccessfulResponse(resolve, reject, response);
1302
+ }, (error) => {
1303
+ if (error.response == null) {
1304
+ reject(error);
1305
+ return;
1306
+ }
1307
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1308
+ return;
1309
+ }
1310
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1311
+ return;
1312
+ }
1313
+ reject(error);
1314
+ });
1315
+ });
1316
+ });
1317
+ });
1318
+ }
1319
+ editDocument(documentId_1, editDocumentRequest_1) {
1320
+ return __awaiter(this, arguments, void 0, function* (documentId, editDocumentRequest, options = { headers: {} }) {
1321
+ editDocumentRequest = deserializeIfNeeded(editDocumentRequest, "EditDocumentRequest");
1322
+ const localVarPath = this.basePath + '/v1-beta/document/edit';
1323
+ let localVarQueryParameters = {};
1324
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1325
+ const produces = ['application/json'];
1326
+ if (produces.indexOf('application/json') >= 0) {
1327
+ localVarHeaderParams['content-type'] = 'application/json';
1328
+ }
1329
+ else {
1330
+ localVarHeaderParams['content-type'] = produces.join(',');
1331
+ }
1332
+ let localVarFormParams = {};
1333
+ let localVarBodyParams = undefined;
1334
+ if (documentId === null || documentId === undefined) {
1335
+ throw new Error('Required parameter documentId was null or undefined when calling editDocument.');
1336
+ }
1337
+ if (documentId !== undefined) {
1338
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1339
+ }
1340
+ Object.assign(localVarHeaderParams, options.headers);
1341
+ let localVarUseFormData = false;
1342
+ const result = (0, _1.generateFormData)(editDocumentRequest, model_1.EditDocumentRequest);
1343
+ localVarUseFormData = result.localVarUseFormData;
1344
+ let data = {};
1345
+ if (localVarUseFormData) {
1346
+ const formData = (0, _1.toFormData)(result.data);
1347
+ data = formData;
1348
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1349
+ }
1350
+ else {
1351
+ data = model_1.ObjectSerializer.serialize(editDocumentRequest, "EditDocumentRequest");
1352
+ }
1353
+ let localVarRequestOptions = {
1354
+ method: 'PUT',
1355
+ params: localVarQueryParameters,
1356
+ headers: localVarHeaderParams,
1357
+ url: localVarPath,
1358
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1359
+ maxContentLength: Infinity,
1360
+ maxBodyLength: Infinity,
1361
+ responseType: "json",
1362
+ };
1363
+ if (localVarRequestOptions.method !== 'GET') {
1364
+ localVarRequestOptions.data = data;
1365
+ }
1366
+ let authenticationPromise = Promise.resolve();
1367
+ if (this.authentications["X-API-KEY"].apiKey) {
1368
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1369
+ }
1370
+ if (this.authentications["Bearer"].apiKey) {
1371
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1372
+ }
1373
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1374
+ let interceptorPromise = authenticationPromise;
1375
+ for (const interceptor of this.interceptors) {
1376
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1377
+ }
1378
+ return interceptorPromise.then(() => {
1379
+ return new Promise((resolve, reject) => {
1380
+ axios_1.default.request(localVarRequestOptions)
1381
+ .then((response) => {
1382
+ handleSuccessfulResponse(resolve, reject, response, "DocumentEdited");
1383
+ }, (error) => {
1384
+ if (error.response == null) {
1385
+ reject(error);
1386
+ return;
1387
+ }
1388
+ if (handleErrorCodeResponse(reject, error.response, 200, "DocumentEdited")) {
1389
+ return;
1390
+ }
1391
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1392
+ return;
1393
+ }
1394
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1395
+ return;
1396
+ }
1397
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
1398
+ return;
1399
+ }
1400
+ if (handleErrorCodeResponse(reject, error.response, 422, "ErrorResult")) {
1401
+ return;
1402
+ }
1403
+ reject(error);
1404
+ });
1405
+ });
1406
+ });
1407
+ });
1408
+ }
1409
+ extendExpiry(documentId_1, extendExpiry_1) {
1410
+ return __awaiter(this, arguments, void 0, function* (documentId, extendExpiry, options = { headers: {} }) {
1411
+ extendExpiry = deserializeIfNeeded(extendExpiry, "ExtendExpiry");
1412
+ const localVarPath = this.basePath + '/v1/document/extendExpiry';
1413
+ let localVarQueryParameters = {};
1414
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1415
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1416
+ if (produces.indexOf('application/json') >= 0) {
1417
+ localVarHeaderParams['content-type'] = 'application/json';
1418
+ }
1419
+ else {
1420
+ localVarHeaderParams['content-type'] = produces.join(',');
1421
+ }
1422
+ let localVarFormParams = {};
1423
+ let localVarBodyParams = undefined;
1424
+ if (documentId === null || documentId === undefined) {
1425
+ throw new Error('Required parameter documentId was null or undefined when calling extendExpiry.');
1426
+ }
1427
+ if (documentId !== undefined) {
1428
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1429
+ }
1430
+ Object.assign(localVarHeaderParams, options.headers);
1431
+ let localVarUseFormData = false;
1432
+ const result = (0, _1.generateFormData)(extendExpiry, model_1.ExtendExpiry);
1433
+ localVarUseFormData = result.localVarUseFormData;
1434
+ let data = {};
1435
+ if (localVarUseFormData) {
1436
+ const formData = (0, _1.toFormData)(result.data);
1437
+ data = formData;
1438
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1439
+ }
1440
+ else {
1441
+ data = model_1.ObjectSerializer.serialize(extendExpiry, "ExtendExpiry");
1442
+ }
1443
+ let localVarRequestOptions = {
1444
+ method: 'PATCH',
1445
+ params: localVarQueryParameters,
1446
+ headers: localVarHeaderParams,
1447
+ url: localVarPath,
1448
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1449
+ maxContentLength: Infinity,
1450
+ maxBodyLength: Infinity,
1451
+ responseType: "json",
1452
+ };
1453
+ if (localVarRequestOptions.method !== 'GET') {
1454
+ localVarRequestOptions.data = data;
1455
+ }
1456
+ let authenticationPromise = Promise.resolve();
1457
+ if (this.authentications["X-API-KEY"].apiKey) {
1458
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1459
+ }
1460
+ if (this.authentications["Bearer"].apiKey) {
1461
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1462
+ }
1463
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1464
+ let interceptorPromise = authenticationPromise;
1465
+ for (const interceptor of this.interceptors) {
1466
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1467
+ }
1468
+ return interceptorPromise.then(() => {
1469
+ return new Promise((resolve, reject) => {
1470
+ axios_1.default.request(localVarRequestOptions)
1471
+ .then((response) => {
1472
+ handleSuccessfulResponse(resolve, reject, response);
1473
+ }, (error) => {
1474
+ if (error.response == null) {
1475
+ reject(error);
1476
+ return;
1477
+ }
1478
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1479
+ return;
1480
+ }
1481
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1482
+ return;
1483
+ }
1484
+ reject(error);
1485
+ });
1486
+ });
1487
+ });
1488
+ });
1489
+ }
1490
+ getProperties(documentId_1) {
1491
+ return __awaiter(this, arguments, void 0, function* (documentId, options = { headers: {} }) {
1492
+ const localVarPath = this.basePath + '/v1/document/properties';
1493
+ let localVarQueryParameters = {};
1494
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1495
+ const produces = ['application/json'];
1496
+ if (produces.indexOf('application/json') >= 0) {
1497
+ localVarHeaderParams['content-type'] = 'application/json';
1498
+ }
1499
+ else {
1500
+ localVarHeaderParams['content-type'] = produces.join(',');
1501
+ }
1502
+ let localVarFormParams = {};
1503
+ let localVarBodyParams = undefined;
1504
+ if (documentId === null || documentId === undefined) {
1505
+ throw new Error('Required parameter documentId was null or undefined when calling getDocumentProperties.');
1506
+ }
1507
+ if (documentId !== undefined) {
1508
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1509
+ }
1510
+ Object.assign(localVarHeaderParams, options.headers);
1511
+ let localVarUseFormData = false;
1512
+ let data = {};
1513
+ if (localVarUseFormData) {
1514
+ const formData = (0, _1.toFormData)(localVarFormParams);
1515
+ data = formData;
1516
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1517
+ }
1518
+ let localVarRequestOptions = {
1519
+ method: 'GET',
1520
+ params: localVarQueryParameters,
1521
+ headers: localVarHeaderParams,
1522
+ url: localVarPath,
1523
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1524
+ maxContentLength: Infinity,
1525
+ maxBodyLength: Infinity,
1526
+ responseType: "json",
1527
+ };
1528
+ if (localVarRequestOptions.method !== 'GET') {
1529
+ localVarRequestOptions.data = data;
1530
+ }
1531
+ let authenticationPromise = Promise.resolve();
1532
+ if (this.authentications["X-API-KEY"].apiKey) {
1533
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1534
+ }
1535
+ if (this.authentications["Bearer"].apiKey) {
1536
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1537
+ }
1538
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1539
+ let interceptorPromise = authenticationPromise;
1540
+ for (const interceptor of this.interceptors) {
1541
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1542
+ }
1543
+ return interceptorPromise.then(() => {
1544
+ return new Promise((resolve, reject) => {
1545
+ axios_1.default.request(localVarRequestOptions)
1546
+ .then((response) => {
1547
+ handleSuccessfulResponse(resolve, reject, response, "DocumentProperties");
1548
+ }, (error) => {
1549
+ if (error.response == null) {
1550
+ reject(error);
1551
+ return;
1552
+ }
1553
+ if (handleErrorCodeResponse(reject, error.response, 200, "DocumentProperties")) {
1554
+ return;
1555
+ }
1556
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1557
+ return;
1558
+ }
1559
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1560
+ return;
1561
+ }
1562
+ reject(error);
1563
+ });
1564
+ });
1565
+ });
1566
+ });
1567
+ }
1568
+ getEmbeddedSignLink(documentId_1, signerEmail_1, countryCode_1, phoneNumber_1, signLinkValidTill_1, redirectUrl_1) {
1569
+ return __awaiter(this, arguments, void 0, function* (documentId, signerEmail, countryCode, phoneNumber, signLinkValidTill, redirectUrl, options = { headers: {} }) {
1570
+ const localVarPath = this.basePath + '/v1/document/getEmbeddedSignLink';
1571
+ let localVarQueryParameters = {};
1572
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1573
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1574
+ if (produces.indexOf('application/json') >= 0) {
1575
+ localVarHeaderParams['content-type'] = 'application/json';
1576
+ }
1577
+ else {
1578
+ localVarHeaderParams['content-type'] = produces.join(',');
1579
+ }
1580
+ let localVarFormParams = {};
1581
+ let localVarBodyParams = undefined;
1582
+ if (documentId === null || documentId === undefined) {
1583
+ throw new Error('Required parameter documentId was null or undefined when calling getEmbeddedSignLink.');
1584
+ }
1585
+ if (documentId !== undefined) {
1586
+ localVarQueryParameters['DocumentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1587
+ }
1588
+ if (signerEmail !== undefined) {
1589
+ localVarQueryParameters['SignerEmail'] = model_1.ObjectSerializer.serialize(signerEmail, "string");
1590
+ }
1591
+ if (countryCode !== undefined) {
1592
+ localVarQueryParameters['CountryCode'] = model_1.ObjectSerializer.serialize(countryCode, "string");
1593
+ }
1594
+ if (phoneNumber !== undefined) {
1595
+ localVarQueryParameters['PhoneNumber'] = model_1.ObjectSerializer.serialize(phoneNumber, "string");
1596
+ }
1597
+ if (signLinkValidTill !== undefined) {
1598
+ localVarQueryParameters['SignLinkValidTill'] = model_1.ObjectSerializer.serialize(signLinkValidTill, "Date");
1599
+ }
1600
+ if (redirectUrl !== undefined) {
1601
+ localVarQueryParameters['RedirectUrl'] = model_1.ObjectSerializer.serialize(redirectUrl, "string");
1602
+ }
1603
+ Object.assign(localVarHeaderParams, options.headers);
1604
+ let localVarUseFormData = false;
1605
+ let data = {};
1606
+ if (localVarUseFormData) {
1607
+ const formData = (0, _1.toFormData)(localVarFormParams);
1608
+ data = formData;
1609
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1610
+ }
1611
+ let localVarRequestOptions = {
1612
+ method: 'GET',
1613
+ params: localVarQueryParameters,
1614
+ headers: localVarHeaderParams,
1615
+ url: localVarPath,
1616
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1617
+ maxContentLength: Infinity,
1618
+ maxBodyLength: Infinity,
1619
+ responseType: "json",
1620
+ };
1621
+ if (localVarRequestOptions.method !== 'GET') {
1622
+ localVarRequestOptions.data = data;
1623
+ }
1624
+ let authenticationPromise = Promise.resolve();
1625
+ if (this.authentications["X-API-KEY"].apiKey) {
1626
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1627
+ }
1628
+ if (this.authentications["Bearer"].apiKey) {
1629
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1630
+ }
1631
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1632
+ let interceptorPromise = authenticationPromise;
1633
+ for (const interceptor of this.interceptors) {
1634
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1635
+ }
1636
+ return interceptorPromise.then(() => {
1637
+ return new Promise((resolve, reject) => {
1638
+ axios_1.default.request(localVarRequestOptions)
1639
+ .then((response) => {
1640
+ handleSuccessfulResponse(resolve, reject, response, "EmbeddedSigningLink");
1641
+ }, (error) => {
1642
+ if (error.response == null) {
1643
+ reject(error);
1644
+ return;
1645
+ }
1646
+ if (handleErrorCodeResponse(reject, error.response, 200, "EmbeddedSigningLink")) {
1647
+ return;
1648
+ }
1649
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1650
+ return;
1651
+ }
1652
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1653
+ return;
1654
+ }
1655
+ reject(error);
1656
+ });
1657
+ });
1658
+ });
1659
+ });
1660
+ }
1661
+ listDocuments(page_1, sentBy_1, recipients_1, transmitType_1, dateFilterType_1, pageSize_1, startDate_1, status_1, endDate_1, searchKey_1, labels_1, nextCursor_1, brandIds_1) {
1662
+ return __awaiter(this, arguments, void 0, function* (page, sentBy, recipients, transmitType, dateFilterType, pageSize, startDate, status, endDate, searchKey, labels, nextCursor, brandIds, options = { headers: {} }) {
1663
+ const localVarPath = this.basePath + '/v1/document/list';
1664
+ let localVarQueryParameters = {};
1665
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1666
+ const produces = ['application/json'];
1667
+ if (produces.indexOf('application/json') >= 0) {
1668
+ localVarHeaderParams['content-type'] = 'application/json';
1669
+ }
1670
+ else {
1671
+ localVarHeaderParams['content-type'] = produces.join(',');
1672
+ }
1673
+ let localVarFormParams = {};
1674
+ let localVarBodyParams = undefined;
1675
+ if (page === null || page === undefined) {
1676
+ throw new Error('Required parameter page was null or undefined when calling listDocuments.');
1677
+ }
1678
+ if (sentBy !== undefined) {
1679
+ localVarQueryParameters['SentBy'] = model_1.ObjectSerializer.serialize(sentBy, "Array<string>");
1680
+ }
1681
+ if (recipients !== undefined) {
1682
+ localVarQueryParameters['Recipients'] = model_1.ObjectSerializer.serialize(recipients, "Array<string>");
1683
+ }
1684
+ if (transmitType !== undefined) {
1685
+ localVarQueryParameters['TransmitType'] = model_1.ObjectSerializer.serialize(transmitType, "'Sent' | 'Received' | 'Both'");
1686
+ }
1687
+ if (dateFilterType !== undefined) {
1688
+ localVarQueryParameters['DateFilterType'] = model_1.ObjectSerializer.serialize(dateFilterType, "'SentBetween' | 'Expiring'");
1689
+ }
1690
+ if (pageSize !== undefined) {
1691
+ localVarQueryParameters['PageSize'] = model_1.ObjectSerializer.serialize(pageSize, "number");
1692
+ }
1693
+ if (page !== undefined) {
1694
+ localVarQueryParameters['Page'] = model_1.ObjectSerializer.serialize(page, "number");
1695
+ }
1696
+ if (startDate !== undefined) {
1697
+ localVarQueryParameters['StartDate'] = model_1.ObjectSerializer.serialize(startDate, "Date");
1698
+ }
1699
+ if (status !== undefined) {
1700
+ localVarQueryParameters['Status'] = model_1.ObjectSerializer.serialize(status, "Array<'None' | 'WaitingForMe' | 'WaitingForOthers' | 'NeedAttention' | 'Completed' | 'Declined' | 'Revoked' | 'Expired' | 'Draft' | 'Scheduled'>");
1701
+ }
1702
+ if (endDate !== undefined) {
1703
+ localVarQueryParameters['EndDate'] = model_1.ObjectSerializer.serialize(endDate, "Date");
1704
+ }
1705
+ if (searchKey !== undefined) {
1706
+ localVarQueryParameters['SearchKey'] = model_1.ObjectSerializer.serialize(searchKey, "string");
1707
+ }
1708
+ if (labels !== undefined) {
1709
+ localVarQueryParameters['Labels'] = model_1.ObjectSerializer.serialize(labels, "Array<string>");
1710
+ }
1711
+ if (nextCursor !== undefined) {
1712
+ localVarQueryParameters['NextCursor'] = model_1.ObjectSerializer.serialize(nextCursor, "number");
1713
+ }
1714
+ if (brandIds !== undefined) {
1715
+ localVarQueryParameters['BrandIds'] = model_1.ObjectSerializer.serialize(brandIds, "Array<string>");
1716
+ }
1717
+ Object.assign(localVarHeaderParams, options.headers);
1718
+ let localVarUseFormData = false;
1719
+ let data = {};
1720
+ if (localVarUseFormData) {
1721
+ const formData = (0, _1.toFormData)(localVarFormParams);
1722
+ data = formData;
1723
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1724
+ }
1725
+ let localVarRequestOptions = {
1726
+ method: 'GET',
1727
+ params: localVarQueryParameters,
1728
+ headers: localVarHeaderParams,
1729
+ url: localVarPath,
1730
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1731
+ maxContentLength: Infinity,
1732
+ maxBodyLength: Infinity,
1733
+ responseType: "json",
1734
+ };
1735
+ if (localVarRequestOptions.method !== 'GET') {
1736
+ localVarRequestOptions.data = data;
1737
+ }
1738
+ let authenticationPromise = Promise.resolve();
1739
+ if (this.authentications["X-API-KEY"].apiKey) {
1740
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1741
+ }
1742
+ if (this.authentications["Bearer"].apiKey) {
1743
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1744
+ }
1745
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1746
+ let interceptorPromise = authenticationPromise;
1747
+ for (const interceptor of this.interceptors) {
1748
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1749
+ }
1750
+ return interceptorPromise.then(() => {
1751
+ return new Promise((resolve, reject) => {
1752
+ axios_1.default.request(localVarRequestOptions)
1753
+ .then((response) => {
1754
+ handleSuccessfulResponse(resolve, reject, response, "DocumentRecords");
1755
+ }, (error) => {
1756
+ if (error.response == null) {
1757
+ reject(error);
1758
+ return;
1759
+ }
1760
+ if (handleErrorCodeResponse(reject, error.response, 200, "DocumentRecords")) {
1761
+ return;
1762
+ }
1763
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1764
+ return;
1765
+ }
1766
+ reject(error);
1767
+ });
1768
+ });
1769
+ });
1770
+ });
1771
+ }
1772
+ prefillFields(documentId_1, prefillFieldRequest_1) {
1773
+ return __awaiter(this, arguments, void 0, function* (documentId, prefillFieldRequest, options = { headers: {} }) {
1774
+ prefillFieldRequest = deserializeIfNeeded(prefillFieldRequest, "PrefillFieldRequest");
1775
+ const localVarPath = this.basePath + '/v1/document/prefillFields';
1776
+ let localVarQueryParameters = {};
1777
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1778
+ const produces = ['application/json'];
1779
+ if (produces.indexOf('application/json') >= 0) {
1780
+ localVarHeaderParams['content-type'] = 'application/json';
1781
+ }
1782
+ else {
1783
+ localVarHeaderParams['content-type'] = produces.join(',');
1784
+ }
1785
+ let localVarFormParams = {};
1786
+ let localVarBodyParams = undefined;
1787
+ if (documentId === null || documentId === undefined) {
1788
+ throw new Error('Required parameter documentId was null or undefined when calling prefillFields.');
1789
+ }
1790
+ if (prefillFieldRequest === null || prefillFieldRequest === undefined) {
1791
+ throw new Error('Required parameter prefillFieldRequest was null or undefined when calling prefillFields.');
1792
+ }
1793
+ if (documentId !== undefined) {
1794
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1795
+ }
1796
+ Object.assign(localVarHeaderParams, options.headers);
1797
+ let localVarUseFormData = false;
1798
+ const result = (0, _1.generateFormData)(prefillFieldRequest, model_1.PrefillFieldRequest);
1799
+ localVarUseFormData = result.localVarUseFormData;
1800
+ let data = {};
1801
+ if (localVarUseFormData) {
1802
+ const formData = (0, _1.toFormData)(result.data);
1803
+ data = formData;
1804
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1805
+ }
1806
+ else {
1807
+ data = model_1.ObjectSerializer.serialize(prefillFieldRequest, "PrefillFieldRequest");
1808
+ }
1809
+ let localVarRequestOptions = {
1810
+ method: 'PATCH',
1811
+ params: localVarQueryParameters,
1812
+ headers: localVarHeaderParams,
1813
+ url: localVarPath,
1814
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1815
+ maxContentLength: Infinity,
1816
+ maxBodyLength: Infinity,
1817
+ responseType: "json",
1818
+ };
1819
+ if (localVarRequestOptions.method !== 'GET') {
1820
+ localVarRequestOptions.data = data;
1821
+ }
1822
+ let authenticationPromise = Promise.resolve();
1823
+ if (this.authentications["X-API-KEY"].apiKey) {
1824
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1825
+ }
1826
+ if (this.authentications["Bearer"].apiKey) {
1827
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1828
+ }
1829
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1830
+ let interceptorPromise = authenticationPromise;
1831
+ for (const interceptor of this.interceptors) {
1832
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1833
+ }
1834
+ return interceptorPromise.then(() => {
1835
+ return new Promise((resolve, reject) => {
1836
+ axios_1.default.request(localVarRequestOptions)
1837
+ .then((response) => {
1838
+ handleSuccessfulResponse(resolve, reject, response);
1839
+ }, (error) => {
1840
+ if (error.response == null) {
1841
+ reject(error);
1842
+ return;
1843
+ }
1844
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1845
+ return;
1846
+ }
1847
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1848
+ return;
1849
+ }
1850
+ reject(error);
1851
+ });
1852
+ });
1853
+ });
1854
+ });
1855
+ }
1856
+ remindDocument(documentId_1, receiverEmails_1, reminderMessage_1) {
1857
+ return __awaiter(this, arguments, void 0, function* (documentId, receiverEmails, reminderMessage, options = { headers: {} }) {
1858
+ reminderMessage = deserializeIfNeeded(reminderMessage, "ReminderMessage");
1859
+ const localVarPath = this.basePath + '/v1/document/remind';
1860
+ let localVarQueryParameters = {};
1861
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1862
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1863
+ if (produces.indexOf('application/json') >= 0) {
1864
+ localVarHeaderParams['content-type'] = 'application/json';
1865
+ }
1866
+ else {
1867
+ localVarHeaderParams['content-type'] = produces.join(',');
1868
+ }
1869
+ let localVarFormParams = {};
1870
+ let localVarBodyParams = undefined;
1871
+ if (documentId === null || documentId === undefined) {
1872
+ throw new Error('Required parameter documentId was null or undefined when calling remindDocument.');
1873
+ }
1874
+ if (documentId !== undefined) {
1875
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1876
+ }
1877
+ if (receiverEmails !== undefined) {
1878
+ localVarQueryParameters['receiverEmails'] = model_1.ObjectSerializer.serialize(receiverEmails, "Array<string>");
1879
+ }
1880
+ Object.assign(localVarHeaderParams, options.headers);
1881
+ let localVarUseFormData = false;
1882
+ const result = (0, _1.generateFormData)(reminderMessage, model_1.ReminderMessage);
1883
+ localVarUseFormData = result.localVarUseFormData;
1884
+ let data = {};
1885
+ if (localVarUseFormData) {
1886
+ const formData = (0, _1.toFormData)(result.data);
1887
+ data = formData;
1888
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1889
+ }
1890
+ else {
1891
+ data = model_1.ObjectSerializer.serialize(reminderMessage, "ReminderMessage");
1892
+ }
1893
+ let localVarRequestOptions = {
1894
+ method: 'POST',
1895
+ params: localVarQueryParameters,
1896
+ headers: localVarHeaderParams,
1897
+ url: localVarPath,
1898
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1899
+ maxContentLength: Infinity,
1900
+ maxBodyLength: Infinity,
1901
+ responseType: "json",
1902
+ };
1903
+ if (localVarRequestOptions.method !== 'GET') {
1904
+ localVarRequestOptions.data = data;
1905
+ }
1906
+ let authenticationPromise = Promise.resolve();
1907
+ if (this.authentications["X-API-KEY"].apiKey) {
1908
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1909
+ }
1910
+ if (this.authentications["Bearer"].apiKey) {
1911
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1912
+ }
1913
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1914
+ let interceptorPromise = authenticationPromise;
1915
+ for (const interceptor of this.interceptors) {
1916
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1917
+ }
1918
+ return interceptorPromise.then(() => {
1919
+ return new Promise((resolve, reject) => {
1920
+ axios_1.default.request(localVarRequestOptions)
1921
+ .then((response) => {
1922
+ handleSuccessfulResponse(resolve, reject, response);
1923
+ }, (error) => {
1924
+ if (error.response == null) {
1925
+ reject(error);
1926
+ return;
1927
+ }
1928
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
1929
+ return;
1930
+ }
1931
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
1932
+ return;
1933
+ }
1934
+ reject(error);
1935
+ });
1936
+ });
1937
+ });
1938
+ });
1939
+ }
1940
+ removeAuthentication(documentId_1, removeAuthentication_1) {
1941
+ return __awaiter(this, arguments, void 0, function* (documentId, removeAuthentication, options = { headers: {} }) {
1942
+ removeAuthentication = deserializeIfNeeded(removeAuthentication, "RemoveAuthentication");
1943
+ const localVarPath = this.basePath + '/v1/document/RemoveAuthentication';
1944
+ let localVarQueryParameters = {};
1945
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
1946
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
1947
+ if (produces.indexOf('application/json') >= 0) {
1948
+ localVarHeaderParams['content-type'] = 'application/json';
1949
+ }
1950
+ else {
1951
+ localVarHeaderParams['content-type'] = produces.join(',');
1952
+ }
1953
+ let localVarFormParams = {};
1954
+ let localVarBodyParams = undefined;
1955
+ if (documentId === null || documentId === undefined) {
1956
+ throw new Error('Required parameter documentId was null or undefined when calling removeAuthentication.');
1957
+ }
1958
+ if (documentId !== undefined) {
1959
+ localVarQueryParameters['DocumentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
1960
+ }
1961
+ Object.assign(localVarHeaderParams, options.headers);
1962
+ let localVarUseFormData = false;
1963
+ const result = (0, _1.generateFormData)(removeAuthentication, model_1.RemoveAuthentication);
1964
+ localVarUseFormData = result.localVarUseFormData;
1965
+ let data = {};
1966
+ if (localVarUseFormData) {
1967
+ const formData = (0, _1.toFormData)(result.data);
1968
+ data = formData;
1969
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
1970
+ }
1971
+ else {
1972
+ data = model_1.ObjectSerializer.serialize(removeAuthentication, "RemoveAuthentication");
1973
+ }
1974
+ let localVarRequestOptions = {
1975
+ method: 'PATCH',
1976
+ params: localVarQueryParameters,
1977
+ headers: localVarHeaderParams,
1978
+ url: localVarPath,
1979
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
1980
+ maxContentLength: Infinity,
1981
+ maxBodyLength: Infinity,
1982
+ responseType: "json",
1983
+ };
1984
+ if (localVarRequestOptions.method !== 'GET') {
1985
+ localVarRequestOptions.data = data;
1986
+ }
1987
+ let authenticationPromise = Promise.resolve();
1988
+ if (this.authentications["X-API-KEY"].apiKey) {
1989
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
1990
+ }
1991
+ if (this.authentications["Bearer"].apiKey) {
1992
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
1993
+ }
1994
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1995
+ let interceptorPromise = authenticationPromise;
1996
+ for (const interceptor of this.interceptors) {
1997
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1998
+ }
1999
+ return interceptorPromise.then(() => {
2000
+ return new Promise((resolve, reject) => {
2001
+ axios_1.default.request(localVarRequestOptions)
2002
+ .then((response) => {
2003
+ handleSuccessfulResponse(resolve, reject, response);
2004
+ }, (error) => {
2005
+ if (error.response == null) {
2006
+ reject(error);
2007
+ return;
2008
+ }
2009
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
2010
+ return;
2011
+ }
2012
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
2013
+ return;
2014
+ }
2015
+ reject(error);
2016
+ });
2017
+ });
2018
+ });
2019
+ });
2020
+ }
2021
+ revokeDocument(documentId_1, revokeDocument_1) {
2022
+ return __awaiter(this, arguments, void 0, function* (documentId, revokeDocument, options = { headers: {} }) {
2023
+ revokeDocument = deserializeIfNeeded(revokeDocument, "RevokeDocument");
2024
+ const localVarPath = this.basePath + '/v1/document/revoke';
2025
+ let localVarQueryParameters = {};
2026
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
2027
+ const produces = ['application/json'];
2028
+ if (produces.indexOf('application/json') >= 0) {
2029
+ localVarHeaderParams['content-type'] = 'application/json';
2030
+ }
2031
+ else {
2032
+ localVarHeaderParams['content-type'] = produces.join(',');
2033
+ }
2034
+ let localVarFormParams = {};
2035
+ let localVarBodyParams = undefined;
2036
+ if (documentId === null || documentId === undefined) {
2037
+ throw new Error('Required parameter documentId was null or undefined when calling revokeDocument.');
2038
+ }
2039
+ if (revokeDocument === null || revokeDocument === undefined) {
2040
+ throw new Error('Required parameter revokeDocument was null or undefined when calling revokeDocument.');
2041
+ }
2042
+ if (documentId !== undefined) {
2043
+ localVarQueryParameters['documentId'] = model_1.ObjectSerializer.serialize(documentId, "string");
2044
+ }
2045
+ Object.assign(localVarHeaderParams, options.headers);
2046
+ let localVarUseFormData = false;
2047
+ const result = (0, _1.generateFormData)(revokeDocument, model_1.RevokeDocument);
2048
+ localVarUseFormData = result.localVarUseFormData;
2049
+ let data = {};
2050
+ if (localVarUseFormData) {
2051
+ const formData = (0, _1.toFormData)(result.data);
2052
+ data = formData;
2053
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
2054
+ }
2055
+ else {
2056
+ data = model_1.ObjectSerializer.serialize(revokeDocument, "RevokeDocument");
2057
+ }
2058
+ let localVarRequestOptions = {
2059
+ method: 'POST',
2060
+ params: localVarQueryParameters,
2061
+ headers: localVarHeaderParams,
2062
+ url: localVarPath,
2063
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
2064
+ maxContentLength: Infinity,
2065
+ maxBodyLength: Infinity,
2066
+ responseType: "json",
2067
+ };
2068
+ if (localVarRequestOptions.method !== 'GET') {
2069
+ localVarRequestOptions.data = data;
2070
+ }
2071
+ let authenticationPromise = Promise.resolve();
2072
+ if (this.authentications["X-API-KEY"].apiKey) {
2073
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
2074
+ }
2075
+ if (this.authentications["Bearer"].apiKey) {
2076
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
2077
+ }
2078
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2079
+ let interceptorPromise = authenticationPromise;
2080
+ for (const interceptor of this.interceptors) {
2081
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
2082
+ }
2083
+ return interceptorPromise.then(() => {
2084
+ return new Promise((resolve, reject) => {
2085
+ axios_1.default.request(localVarRequestOptions)
2086
+ .then((response) => {
2087
+ handleSuccessfulResponse(resolve, reject, response);
2088
+ }, (error) => {
2089
+ if (error.response == null) {
2090
+ reject(error);
2091
+ return;
2092
+ }
2093
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
2094
+ return;
2095
+ }
2096
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
2097
+ return;
2098
+ }
2099
+ reject(error);
2100
+ });
2101
+ });
2102
+ });
2103
+ });
2104
+ }
2105
+ sendDocument(sendForSign_1) {
2106
+ return __awaiter(this, arguments, void 0, function* (sendForSign, options = { headers: {} }) {
2107
+ sendForSign = deserializeIfNeeded(sendForSign, "SendForSign");
2108
+ const localVarPath = this.basePath + '/v1/document/send';
2109
+ let localVarQueryParameters = {};
2110
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
2111
+ const produces = ['application/json'];
2112
+ if (produces.indexOf('application/json') >= 0) {
2113
+ localVarHeaderParams['content-type'] = 'application/json';
2114
+ }
2115
+ else {
2116
+ localVarHeaderParams['content-type'] = produces.join(',');
2117
+ }
2118
+ let localVarFormParams = {};
2119
+ let localVarBodyParams = undefined;
2120
+ Object.assign(localVarHeaderParams, options.headers);
2121
+ let localVarUseFormData = false;
2122
+ const result = (0, _1.generateFormData)(sendForSign, model_1.SendForSign);
2123
+ localVarUseFormData = result.localVarUseFormData;
2124
+ let data = {};
2125
+ if (localVarUseFormData) {
2126
+ const formData = (0, _1.toFormData)(result.data);
2127
+ data = formData;
2128
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
2129
+ }
2130
+ else {
2131
+ data = model_1.ObjectSerializer.serialize(sendForSign, "SendForSign");
2132
+ }
2133
+ let localVarRequestOptions = {
2134
+ method: 'POST',
2135
+ params: localVarQueryParameters,
2136
+ headers: localVarHeaderParams,
2137
+ url: localVarPath,
2138
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
2139
+ maxContentLength: Infinity,
2140
+ maxBodyLength: Infinity,
2141
+ responseType: "json",
2142
+ };
2143
+ if (localVarRequestOptions.method !== 'GET') {
2144
+ localVarRequestOptions.data = data;
2145
+ }
2146
+ let authenticationPromise = Promise.resolve();
2147
+ if (this.authentications["X-API-KEY"].apiKey) {
2148
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
2149
+ }
2150
+ if (this.authentications["Bearer"].apiKey) {
2151
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
2152
+ }
2153
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2154
+ let interceptorPromise = authenticationPromise;
2155
+ for (const interceptor of this.interceptors) {
2156
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
2157
+ }
2158
+ return interceptorPromise.then(() => {
2159
+ return new Promise((resolve, reject) => {
2160
+ axios_1.default.request(localVarRequestOptions)
2161
+ .then((response) => {
2162
+ handleSuccessfulResponse(resolve, reject, response, "DocumentCreated");
2163
+ }, (error) => {
2164
+ if (error.response == null) {
2165
+ reject(error);
2166
+ return;
2167
+ }
2168
+ if (handleErrorCodeResponse(reject, error.response, 201, "DocumentCreated")) {
2169
+ return;
2170
+ }
2171
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
2172
+ return;
2173
+ }
2174
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
2175
+ return;
2176
+ }
2177
+ if (handleErrorCodeResponse(reject, error.response, 400, "ErrorResult")) {
2178
+ return;
2179
+ }
2180
+ if (handleErrorCodeResponse(reject, error.response, 422, "ErrorResult")) {
2181
+ return;
2182
+ }
2183
+ reject(error);
2184
+ });
2185
+ });
2186
+ });
2187
+ });
2188
+ }
2189
+ teamDocuments(page_1, userId_1, teamId_1, transmitType_1, dateFilterType_1, pageSize_1, startDate_1, status_1, endDate_1, searchKey_1, labels_1, nextCursor_1, brandIds_1) {
2190
+ return __awaiter(this, arguments, void 0, function* (page, userId, teamId, transmitType, dateFilterType, pageSize, startDate, status, endDate, searchKey, labels, nextCursor, brandIds, options = { headers: {} }) {
2191
+ const localVarPath = this.basePath + '/v1/document/teamlist';
2192
+ let localVarQueryParameters = {};
2193
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
2194
+ const produces = ['application/json'];
2195
+ if (produces.indexOf('application/json') >= 0) {
2196
+ localVarHeaderParams['content-type'] = 'application/json';
2197
+ }
2198
+ else {
2199
+ localVarHeaderParams['content-type'] = produces.join(',');
2200
+ }
2201
+ let localVarFormParams = {};
2202
+ let localVarBodyParams = undefined;
2203
+ if (page === null || page === undefined) {
2204
+ throw new Error('Required parameter page was null or undefined when calling teamDocuments.');
2205
+ }
2206
+ if (userId !== undefined) {
2207
+ localVarQueryParameters['UserId'] = model_1.ObjectSerializer.serialize(userId, "Array<string>");
2208
+ }
2209
+ if (teamId !== undefined) {
2210
+ localVarQueryParameters['TeamId'] = model_1.ObjectSerializer.serialize(teamId, "Array<string>");
2211
+ }
2212
+ if (transmitType !== undefined) {
2213
+ localVarQueryParameters['TransmitType'] = model_1.ObjectSerializer.serialize(transmitType, "'Sent' | 'Received' | 'Both'");
2214
+ }
2215
+ if (dateFilterType !== undefined) {
2216
+ localVarQueryParameters['DateFilterType'] = model_1.ObjectSerializer.serialize(dateFilterType, "'SentBetween' | 'Expiring'");
2217
+ }
2218
+ if (pageSize !== undefined) {
2219
+ localVarQueryParameters['PageSize'] = model_1.ObjectSerializer.serialize(pageSize, "number");
2220
+ }
2221
+ if (page !== undefined) {
2222
+ localVarQueryParameters['Page'] = model_1.ObjectSerializer.serialize(page, "number");
2223
+ }
2224
+ if (startDate !== undefined) {
2225
+ localVarQueryParameters['StartDate'] = model_1.ObjectSerializer.serialize(startDate, "Date");
2226
+ }
2227
+ if (status !== undefined) {
2228
+ localVarQueryParameters['Status'] = model_1.ObjectSerializer.serialize(status, "Array<'None' | 'WaitingForMe' | 'WaitingForOthers' | 'NeedAttention' | 'Completed' | 'Declined' | 'Revoked' | 'Expired' | 'Draft' | 'Scheduled'>");
2229
+ }
2230
+ if (endDate !== undefined) {
2231
+ localVarQueryParameters['EndDate'] = model_1.ObjectSerializer.serialize(endDate, "Date");
2232
+ }
2233
+ if (searchKey !== undefined) {
2234
+ localVarQueryParameters['SearchKey'] = model_1.ObjectSerializer.serialize(searchKey, "string");
2235
+ }
2236
+ if (labels !== undefined) {
2237
+ localVarQueryParameters['Labels'] = model_1.ObjectSerializer.serialize(labels, "Array<string>");
2238
+ }
2239
+ if (nextCursor !== undefined) {
2240
+ localVarQueryParameters['NextCursor'] = model_1.ObjectSerializer.serialize(nextCursor, "number");
2241
+ }
2242
+ if (brandIds !== undefined) {
2243
+ localVarQueryParameters['BrandIds'] = model_1.ObjectSerializer.serialize(brandIds, "Array<string>");
2244
+ }
2245
+ Object.assign(localVarHeaderParams, options.headers);
2246
+ let localVarUseFormData = false;
2247
+ let data = {};
2248
+ if (localVarUseFormData) {
2249
+ const formData = (0, _1.toFormData)(localVarFormParams);
2250
+ data = formData;
2251
+ localVarHeaderParams = Object.assign(Object.assign({}, localVarHeaderParams), formData.getHeaders());
2252
+ }
2253
+ let localVarRequestOptions = {
2254
+ method: 'GET',
2255
+ params: localVarQueryParameters,
2256
+ headers: localVarHeaderParams,
2257
+ url: localVarPath,
2258
+ paramsSerializer: this._useQuerystring ? _1.queryParamsSerializer : undefined,
2259
+ maxContentLength: Infinity,
2260
+ maxBodyLength: Infinity,
2261
+ responseType: "json",
2262
+ };
2263
+ if (localVarRequestOptions.method !== 'GET') {
2264
+ localVarRequestOptions.data = data;
2265
+ }
2266
+ let authenticationPromise = Promise.resolve();
2267
+ if (this.authentications["X-API-KEY"].apiKey) {
2268
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
2269
+ }
2270
+ if (this.authentications["Bearer"].apiKey) {
2271
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
2272
+ }
2273
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
2274
+ let interceptorPromise = authenticationPromise;
2275
+ for (const interceptor of this.interceptors) {
2276
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
2277
+ }
2278
+ return interceptorPromise.then(() => {
2279
+ return new Promise((resolve, reject) => {
2280
+ axios_1.default.request(localVarRequestOptions)
2281
+ .then((response) => {
2282
+ handleSuccessfulResponse(resolve, reject, response, "TeamDocumentRecords");
2283
+ }, (error) => {
2284
+ if (error.response == null) {
2285
+ reject(error);
2286
+ return;
2287
+ }
2288
+ if (handleErrorCodeResponse(reject, error.response, 200, "TeamDocumentRecords")) {
2289
+ return;
2290
+ }
2291
+ if (handleErrorCodeResponse(reject, error.response, 401, "ErrorResult")) {
2292
+ return;
2293
+ }
2294
+ if (handleErrorCodeResponse(reject, error.response, 403, "ErrorResult")) {
2295
+ return;
2296
+ }
2297
+ reject(error);
2298
+ });
2299
+ });
2300
+ });
2301
+ });
2302
+ }
2303
+ }
2304
+ exports.DocumentApi = DocumentApi;
2305
+ function deserializeIfNeeded(obj, classname) {
2306
+ if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
2307
+ return model_1.ObjectSerializer.deserialize(obj, classname);
2308
+ }
2309
+ return obj;
2310
+ }
2311
+ function handleSuccessfulResponse(resolve, reject, response, returnType) {
2312
+ let body = response.data;
2313
+ if (response.status &&
2314
+ response.status >= 200 &&
2315
+ response.status <= 299) {
2316
+ if (returnType) {
2317
+ body = model_1.ObjectSerializer.deserialize(body, returnType);
2318
+ }
2319
+ resolve(body);
2320
+ }
2321
+ else {
2322
+ reject(new _1.HttpError(response, body, response.status));
2323
+ }
2324
+ }
2325
+ function handleErrorCodeResponse(reject, response, code, returnType) {
2326
+ if (response.status !== code) {
2327
+ return false;
2328
+ }
2329
+ let body = response.data;
2330
+ if (code === 401) {
2331
+ body = "Unauthorized request (401): Invalid authentication.";
2332
+ }
2333
+ reject(new _1.HttpError(response, body, response.status));
2334
+ return true;
2335
+ }
2336
+ function handleErrorRangeResponse(reject, response, code, returnType) {
2337
+ let rangeCodeLeft = Number(code[0] + "00");
2338
+ let rangeCodeRight = Number(code[0] + "99");
2339
+ if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
2340
+ const body = model_1.ObjectSerializer.deserialize(response.data, returnType);
2341
+ reject(new _1.HttpError(response, body, response.status));
2342
+ return true;
2343
+ }
2344
+ return false;
2345
+ }
2346
+ //# sourceMappingURL=documentApi.js.map