@superoffice/webapi 10.2.9

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 (692) hide show
  1. package/LICENSE.md +15 -0
  2. package/README.md +184 -0
  3. package/__tests__/Appointment63-notz.json +1925 -0
  4. package/__tests__/Appointment63-utctz.json +1925 -0
  5. package/__tests__/Appointment63.json +1925 -0
  6. package/__tests__/AppointmentTzTest.ts +114 -0
  7. package/__tests__/AxiosNockTest.ts +28 -0
  8. package/__tests__/ContactDefault.json +699 -0
  9. package/__tests__/ContactEntity.json +273 -0
  10. package/__tests__/ContactRestTest.ts +144 -0
  11. package/__tests__/ContactTest.ts +395 -0
  12. package/__tests__/ConvertersTest.ts +97 -0
  13. package/__tests__/DocumentGetTemplateStream.json +1 -0
  14. package/__tests__/DocumentGetTemplateStreamBinary.json +1 -0
  15. package/__tests__/DocumentTest.ts +101 -0
  16. package/__tests__/Person210-notz.json +1932 -0
  17. package/__tests__/Person210-utctz.json +1932 -0
  18. package/__tests__/Person210.json +1932 -0
  19. package/__tests__/PersonImageData.nock +23 -0
  20. package/__tests__/PersonTest.ts +41 -0
  21. package/__tests__/PersonTzTest.ts +113 -0
  22. package/__tests__/RecurrenceInfo.json +55 -0
  23. package/__tests__/TableRights.json +441 -0
  24. package/__tests__/WebapiTest.ts +264 -0
  25. package/__tests__/Webhook.json +17 -0
  26. package/__tests__/WebhookTest.ts +209 -0
  27. package/dist/cjs/AIAgent.d.ts +265 -0
  28. package/dist/cjs/AIAgent.d.ts.map +1 -0
  29. package/dist/cjs/AIAgent.js +535 -0
  30. package/dist/cjs/AIAgent.js.map +1 -0
  31. package/dist/cjs/AppointmentAgent.d.ts +1539 -0
  32. package/dist/cjs/AppointmentAgent.d.ts.map +1 -0
  33. package/dist/cjs/AppointmentAgent.js +3363 -0
  34. package/dist/cjs/AppointmentAgent.js.map +1 -0
  35. package/dist/cjs/AppointmentRestApi.d.ts +46 -0
  36. package/dist/cjs/AppointmentRestApi.d.ts.map +1 -0
  37. package/dist/cjs/AppointmentRestApi.js +168 -0
  38. package/dist/cjs/AppointmentRestApi.js.map +1 -0
  39. package/dist/cjs/ArchiveAgent.d.ts +582 -0
  40. package/dist/cjs/ArchiveAgent.d.ts.map +1 -0
  41. package/dist/cjs/ArchiveAgent.js +1135 -0
  42. package/dist/cjs/ArchiveAgent.js.map +1 -0
  43. package/dist/cjs/AssociateAgent.d.ts +109 -0
  44. package/dist/cjs/AssociateAgent.d.ts.map +1 -0
  45. package/dist/cjs/AssociateAgent.js +257 -0
  46. package/dist/cjs/AssociateAgent.js.map +1 -0
  47. package/dist/cjs/AudienceAgent.d.ts +359 -0
  48. package/dist/cjs/AudienceAgent.d.ts.map +1 -0
  49. package/dist/cjs/AudienceAgent.js +888 -0
  50. package/dist/cjs/AudienceAgent.js.map +1 -0
  51. package/dist/cjs/AxiosCacheHandler.d.ts +20 -0
  52. package/dist/cjs/AxiosCacheHandler.d.ts.map +1 -0
  53. package/dist/cjs/AxiosCacheHandler.js +68 -0
  54. package/dist/cjs/AxiosCacheHandler.js.map +1 -0
  55. package/dist/cjs/BLOBAgent.d.ts +538 -0
  56. package/dist/cjs/BLOBAgent.d.ts.map +1 -0
  57. package/dist/cjs/BLOBAgent.js +1364 -0
  58. package/dist/cjs/BLOBAgent.js.map +1 -0
  59. package/dist/cjs/Base64.d.ts +4 -0
  60. package/dist/cjs/Base64.d.ts.map +1 -0
  61. package/dist/cjs/Base64.js +233 -0
  62. package/dist/cjs/Base64.js.map +1 -0
  63. package/dist/cjs/BatchAgent.d.ts +252 -0
  64. package/dist/cjs/BatchAgent.d.ts.map +1 -0
  65. package/dist/cjs/BatchAgent.js +522 -0
  66. package/dist/cjs/BatchAgent.js.map +1 -0
  67. package/dist/cjs/BulkUpdateAgent.d.ts +144 -0
  68. package/dist/cjs/BulkUpdateAgent.d.ts.map +1 -0
  69. package/dist/cjs/BulkUpdateAgent.js +288 -0
  70. package/dist/cjs/BulkUpdateAgent.js.map +1 -0
  71. package/dist/cjs/CRMScriptAgent.d.ts +330 -0
  72. package/dist/cjs/CRMScriptAgent.d.ts.map +1 -0
  73. package/dist/cjs/CRMScriptAgent.js +799 -0
  74. package/dist/cjs/CRMScriptAgent.js.map +1 -0
  75. package/dist/cjs/Carriers.d.ts +36976 -0
  76. package/dist/cjs/Carriers.d.ts.map +1 -0
  77. package/dist/cjs/Carriers.js +8 -0
  78. package/dist/cjs/Carriers.js.map +1 -0
  79. package/dist/cjs/ChatAgent.d.ts +366 -0
  80. package/dist/cjs/ChatAgent.d.ts.map +1 -0
  81. package/dist/cjs/ChatAgent.js +919 -0
  82. package/dist/cjs/ChatAgent.js.map +1 -0
  83. package/dist/cjs/ConfigurationAgent.d.ts +534 -0
  84. package/dist/cjs/ConfigurationAgent.d.ts.map +1 -0
  85. package/dist/cjs/ConfigurationAgent.js +1429 -0
  86. package/dist/cjs/ConfigurationAgent.js.map +1 -0
  87. package/dist/cjs/ContactAgent.d.ts +415 -0
  88. package/dist/cjs/ContactAgent.d.ts.map +1 -0
  89. package/dist/cjs/ContactAgent.js +1005 -0
  90. package/dist/cjs/ContactAgent.js.map +1 -0
  91. package/dist/cjs/ContactRestApi.d.ts +46 -0
  92. package/dist/cjs/ContactRestApi.d.ts.map +1 -0
  93. package/dist/cjs/ContactRestApi.js +168 -0
  94. package/dist/cjs/ContactRestApi.js.map +1 -0
  95. package/dist/cjs/Converters.d.ts +1359 -0
  96. package/dist/cjs/Converters.d.ts.map +1 -0
  97. package/dist/cjs/Converters.js +18996 -0
  98. package/dist/cjs/Converters.js.map +1 -0
  99. package/dist/cjs/CustomerServiceAgent.d.ts +447 -0
  100. package/dist/cjs/CustomerServiceAgent.d.ts.map +1 -0
  101. package/dist/cjs/CustomerServiceAgent.js +1123 -0
  102. package/dist/cjs/CustomerServiceAgent.js.map +1 -0
  103. package/dist/cjs/DashAgent.d.ts +370 -0
  104. package/dist/cjs/DashAgent.d.ts.map +1 -0
  105. package/dist/cjs/DashAgent.js +1028 -0
  106. package/dist/cjs/DashAgent.js.map +1 -0
  107. package/dist/cjs/DashboardAgent.d.ts +163 -0
  108. package/dist/cjs/DashboardAgent.d.ts.map +1 -0
  109. package/dist/cjs/DashboardAgent.js +436 -0
  110. package/dist/cjs/DashboardAgent.js.map +1 -0
  111. package/dist/cjs/DatabaseAgent.d.ts +35 -0
  112. package/dist/cjs/DatabaseAgent.d.ts.map +1 -0
  113. package/dist/cjs/DatabaseAgent.js +70 -0
  114. package/dist/cjs/DatabaseAgent.js.map +1 -0
  115. package/dist/cjs/DatabaseTableAgent.d.ts +155 -0
  116. package/dist/cjs/DatabaseTableAgent.d.ts.map +1 -0
  117. package/dist/cjs/DatabaseTableAgent.js +299 -0
  118. package/dist/cjs/DatabaseTableAgent.js.map +1 -0
  119. package/dist/cjs/Day_js.d.ts +4 -0
  120. package/dist/cjs/Day_js.d.ts.map +1 -0
  121. package/dist/cjs/Day_js.js +44 -0
  122. package/dist/cjs/Day_js.js.map +1 -0
  123. package/dist/cjs/DiagnosticsAgent.d.ts +200 -0
  124. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -0
  125. package/dist/cjs/DiagnosticsAgent.js +480 -0
  126. package/dist/cjs/DiagnosticsAgent.js.map +1 -0
  127. package/dist/cjs/DocumentAgent.d.ts +1345 -0
  128. package/dist/cjs/DocumentAgent.d.ts.map +1 -0
  129. package/dist/cjs/DocumentAgent.js +3058 -0
  130. package/dist/cjs/DocumentAgent.js.map +1 -0
  131. package/dist/cjs/DocumentMigrationAgent.d.ts +145 -0
  132. package/dist/cjs/DocumentMigrationAgent.d.ts.map +1 -0
  133. package/dist/cjs/DocumentMigrationAgent.js +297 -0
  134. package/dist/cjs/DocumentMigrationAgent.js.map +1 -0
  135. package/dist/cjs/DocumentRestApi.d.ts +46 -0
  136. package/dist/cjs/DocumentRestApi.d.ts.map +1 -0
  137. package/dist/cjs/DocumentRestApi.js +168 -0
  138. package/dist/cjs/DocumentRestApi.js.map +1 -0
  139. package/dist/cjs/EMailAgent.d.ts +1417 -0
  140. package/dist/cjs/EMailAgent.d.ts.map +1 -0
  141. package/dist/cjs/EMailAgent.js +3202 -0
  142. package/dist/cjs/EMailAgent.js.map +1 -0
  143. package/dist/cjs/Enums.d.ts +6083 -0
  144. package/dist/cjs/Enums.d.ts.map +1 -0
  145. package/dist/cjs/Enums.js +6270 -0
  146. package/dist/cjs/Enums.js.map +1 -0
  147. package/dist/cjs/ErpSyncAgent.d.ts +725 -0
  148. package/dist/cjs/ErpSyncAgent.d.ts.map +1 -0
  149. package/dist/cjs/ErpSyncAgent.js +1601 -0
  150. package/dist/cjs/ErpSyncAgent.js.map +1 -0
  151. package/dist/cjs/FavouriteAgent.d.ts +208 -0
  152. package/dist/cjs/FavouriteAgent.d.ts.map +1 -0
  153. package/dist/cjs/FavouriteAgent.js +407 -0
  154. package/dist/cjs/FavouriteAgent.js.map +1 -0
  155. package/dist/cjs/FindAgent.d.ts +688 -0
  156. package/dist/cjs/FindAgent.d.ts.map +1 -0
  157. package/dist/cjs/FindAgent.js +1337 -0
  158. package/dist/cjs/FindAgent.js.map +1 -0
  159. package/dist/cjs/ForeignSystemAgent.d.ts +478 -0
  160. package/dist/cjs/ForeignSystemAgent.d.ts.map +1 -0
  161. package/dist/cjs/ForeignSystemAgent.js +1022 -0
  162. package/dist/cjs/ForeignSystemAgent.js.map +1 -0
  163. package/dist/cjs/FreeTextAgent.d.ts +172 -0
  164. package/dist/cjs/FreeTextAgent.d.ts.map +1 -0
  165. package/dist/cjs/FreeTextAgent.js +368 -0
  166. package/dist/cjs/FreeTextAgent.js.map +1 -0
  167. package/dist/cjs/ImportAgent.d.ts +92 -0
  168. package/dist/cjs/ImportAgent.d.ts.map +1 -0
  169. package/dist/cjs/ImportAgent.js +164 -0
  170. package/dist/cjs/ImportAgent.js.map +1 -0
  171. package/dist/cjs/LicenseAgent.d.ts +298 -0
  172. package/dist/cjs/LicenseAgent.d.ts.map +1 -0
  173. package/dist/cjs/LicenseAgent.js +639 -0
  174. package/dist/cjs/LicenseAgent.js.map +1 -0
  175. package/dist/cjs/ListAgent.d.ts +2423 -0
  176. package/dist/cjs/ListAgent.d.ts.map +1 -0
  177. package/dist/cjs/ListAgent.js +7813 -0
  178. package/dist/cjs/ListAgent.js.map +1 -0
  179. package/dist/cjs/MDOAgent.d.ts +214 -0
  180. package/dist/cjs/MDOAgent.d.ts.map +1 -0
  181. package/dist/cjs/MDOAgent.js +430 -0
  182. package/dist/cjs/MDOAgent.js.map +1 -0
  183. package/dist/cjs/MarketingAgent.d.ts +170 -0
  184. package/dist/cjs/MarketingAgent.d.ts.map +1 -0
  185. package/dist/cjs/MarketingAgent.js +570 -0
  186. package/dist/cjs/MarketingAgent.js.map +1 -0
  187. package/dist/cjs/MessagingAgent.d.ts +111 -0
  188. package/dist/cjs/MessagingAgent.d.ts.map +1 -0
  189. package/dist/cjs/MessagingAgent.js +217 -0
  190. package/dist/cjs/MessagingAgent.js.map +1 -0
  191. package/dist/cjs/NavigatorAgent.d.ts +40 -0
  192. package/dist/cjs/NavigatorAgent.d.ts.map +1 -0
  193. package/dist/cjs/NavigatorAgent.js +99 -0
  194. package/dist/cjs/NavigatorAgent.js.map +1 -0
  195. package/dist/cjs/NumberAllocationAgent.d.ts +72 -0
  196. package/dist/cjs/NumberAllocationAgent.d.ts.map +1 -0
  197. package/dist/cjs/NumberAllocationAgent.js +199 -0
  198. package/dist/cjs/NumberAllocationAgent.js.map +1 -0
  199. package/dist/cjs/PersonAgent.d.ts +774 -0
  200. package/dist/cjs/PersonAgent.d.ts.map +1 -0
  201. package/dist/cjs/PersonAgent.js +1814 -0
  202. package/dist/cjs/PersonAgent.js.map +1 -0
  203. package/dist/cjs/PersonRestApi.d.ts +46 -0
  204. package/dist/cjs/PersonRestApi.d.ts.map +1 -0
  205. package/dist/cjs/PersonRestApi.js +168 -0
  206. package/dist/cjs/PersonRestApi.js.map +1 -0
  207. package/dist/cjs/PhoneListAgent.d.ts +126 -0
  208. package/dist/cjs/PhoneListAgent.d.ts.map +1 -0
  209. package/dist/cjs/PhoneListAgent.js +269 -0
  210. package/dist/cjs/PhoneListAgent.js.map +1 -0
  211. package/dist/cjs/PocketAgent.d.ts +218 -0
  212. package/dist/cjs/PocketAgent.d.ts.map +1 -0
  213. package/dist/cjs/PocketAgent.js +451 -0
  214. package/dist/cjs/PocketAgent.js.map +1 -0
  215. package/dist/cjs/PreferenceAgent.d.ts +497 -0
  216. package/dist/cjs/PreferenceAgent.d.ts.map +1 -0
  217. package/dist/cjs/PreferenceAgent.js +1194 -0
  218. package/dist/cjs/PreferenceAgent.js.map +1 -0
  219. package/dist/cjs/PreviewsAgent.d.ts +36 -0
  220. package/dist/cjs/PreviewsAgent.d.ts.map +1 -0
  221. package/dist/cjs/PreviewsAgent.js +54 -0
  222. package/dist/cjs/PreviewsAgent.js.map +1 -0
  223. package/dist/cjs/ProjectAgent.d.ts +558 -0
  224. package/dist/cjs/ProjectAgent.d.ts.map +1 -0
  225. package/dist/cjs/ProjectAgent.js +1482 -0
  226. package/dist/cjs/ProjectAgent.js.map +1 -0
  227. package/dist/cjs/ProjectRestApi.d.ts +46 -0
  228. package/dist/cjs/ProjectRestApi.d.ts.map +1 -0
  229. package/dist/cjs/ProjectRestApi.js +168 -0
  230. package/dist/cjs/ProjectRestApi.js.map +1 -0
  231. package/dist/cjs/QuoteAgent.d.ts +1415 -0
  232. package/dist/cjs/QuoteAgent.d.ts.map +1 -0
  233. package/dist/cjs/QuoteAgent.js +3224 -0
  234. package/dist/cjs/QuoteAgent.js.map +1 -0
  235. package/dist/cjs/RelationAgent.d.ts +61 -0
  236. package/dist/cjs/RelationAgent.d.ts.map +1 -0
  237. package/dist/cjs/RelationAgent.js +132 -0
  238. package/dist/cjs/RelationAgent.js.map +1 -0
  239. package/dist/cjs/ReplicationAgent.d.ts +77 -0
  240. package/dist/cjs/ReplicationAgent.d.ts.map +1 -0
  241. package/dist/cjs/ReplicationAgent.js +223 -0
  242. package/dist/cjs/ReplicationAgent.js.map +1 -0
  243. package/dist/cjs/ReportAgent.d.ts +144 -0
  244. package/dist/cjs/ReportAgent.d.ts.map +1 -0
  245. package/dist/cjs/ReportAgent.js +380 -0
  246. package/dist/cjs/ReportAgent.js.map +1 -0
  247. package/dist/cjs/ResourceAgent.d.ts +105 -0
  248. package/dist/cjs/ResourceAgent.d.ts.map +1 -0
  249. package/dist/cjs/ResourceAgent.js +196 -0
  250. package/dist/cjs/ResourceAgent.js.map +1 -0
  251. package/dist/cjs/SaintAgent.d.ts +157 -0
  252. package/dist/cjs/SaintAgent.d.ts.map +1 -0
  253. package/dist/cjs/SaintAgent.js +402 -0
  254. package/dist/cjs/SaintAgent.js.map +1 -0
  255. package/dist/cjs/SaleAgent.d.ts +477 -0
  256. package/dist/cjs/SaleAgent.d.ts.map +1 -0
  257. package/dist/cjs/SaleAgent.js +1182 -0
  258. package/dist/cjs/SaleAgent.js.map +1 -0
  259. package/dist/cjs/SaleRestApi.d.ts +46 -0
  260. package/dist/cjs/SaleRestApi.d.ts.map +1 -0
  261. package/dist/cjs/SaleRestApi.js +168 -0
  262. package/dist/cjs/SaleRestApi.js.map +1 -0
  263. package/dist/cjs/SelectionAgent.d.ts +814 -0
  264. package/dist/cjs/SelectionAgent.d.ts.map +1 -0
  265. package/dist/cjs/SelectionAgent.js +1795 -0
  266. package/dist/cjs/SelectionAgent.js.map +1 -0
  267. package/dist/cjs/SentryAgent.d.ts +113 -0
  268. package/dist/cjs/SentryAgent.d.ts.map +1 -0
  269. package/dist/cjs/SentryAgent.js +238 -0
  270. package/dist/cjs/SentryAgent.js.map +1 -0
  271. package/dist/cjs/SoApiConstants.d.ts +8 -0
  272. package/dist/cjs/SoApiConstants.d.ts.map +1 -0
  273. package/dist/cjs/SoApiConstants.js +12 -0
  274. package/dist/cjs/SoApiConstants.js.map +1 -0
  275. package/dist/cjs/TargetsAgent.d.ts +289 -0
  276. package/dist/cjs/TargetsAgent.d.ts.map +1 -0
  277. package/dist/cjs/TargetsAgent.js +728 -0
  278. package/dist/cjs/TargetsAgent.js.map +1 -0
  279. package/dist/cjs/TicketAgent.d.ts +802 -0
  280. package/dist/cjs/TicketAgent.d.ts.map +1 -0
  281. package/dist/cjs/TicketAgent.js +1865 -0
  282. package/dist/cjs/TicketAgent.js.map +1 -0
  283. package/dist/cjs/TimeZoneAgent.d.ts +139 -0
  284. package/dist/cjs/TimeZoneAgent.d.ts.map +1 -0
  285. package/dist/cjs/TimeZoneAgent.js +348 -0
  286. package/dist/cjs/TimeZoneAgent.js.map +1 -0
  287. package/dist/cjs/TooltipsAgent.d.ts +36 -0
  288. package/dist/cjs/TooltipsAgent.d.ts.map +1 -0
  289. package/dist/cjs/TooltipsAgent.js +54 -0
  290. package/dist/cjs/TooltipsAgent.js.map +1 -0
  291. package/dist/cjs/UserAgent.d.ts +1260 -0
  292. package/dist/cjs/UserAgent.d.ts.map +1 -0
  293. package/dist/cjs/UserAgent.js +2978 -0
  294. package/dist/cjs/UserAgent.js.map +1 -0
  295. package/dist/cjs/UserDefinedFieldInfoAgent.d.ts +474 -0
  296. package/dist/cjs/UserDefinedFieldInfoAgent.d.ts.map +1 -0
  297. package/dist/cjs/UserDefinedFieldInfoAgent.js +1067 -0
  298. package/dist/cjs/UserDefinedFieldInfoAgent.js.map +1 -0
  299. package/dist/cjs/ViewStateAgent.d.ts +230 -0
  300. package/dist/cjs/ViewStateAgent.d.ts.map +1 -0
  301. package/dist/cjs/ViewStateAgent.js +518 -0
  302. package/dist/cjs/ViewStateAgent.js.map +1 -0
  303. package/dist/cjs/WebApi.d.ts +427 -0
  304. package/dist/cjs/WebApi.d.ts.map +1 -0
  305. package/dist/cjs/WebApi.js +656 -0
  306. package/dist/cjs/WebApi.js.map +1 -0
  307. package/dist/cjs/WebApiBase.d.ts +152 -0
  308. package/dist/cjs/WebApiBase.d.ts.map +1 -0
  309. package/dist/cjs/WebApiBase.js +442 -0
  310. package/dist/cjs/WebApiBase.js.map +1 -0
  311. package/dist/cjs/WebhookAgent.d.ts +102 -0
  312. package/dist/cjs/WebhookAgent.d.ts.map +1 -0
  313. package/dist/cjs/WebhookAgent.js +245 -0
  314. package/dist/cjs/WebhookAgent.js.map +1 -0
  315. package/dist/cjs/WorkflowAgent.d.ts +250 -0
  316. package/dist/cjs/WorkflowAgent.d.ts.map +1 -0
  317. package/dist/cjs/WorkflowAgent.js +763 -0
  318. package/dist/cjs/WorkflowAgent.js.map +1 -0
  319. package/dist/cjs/package.json +1 -0
  320. package/dist/esm/AIAgent.d.ts +265 -0
  321. package/dist/esm/AIAgent.d.ts.map +1 -0
  322. package/dist/esm/AIAgent.js +530 -0
  323. package/dist/esm/AIAgent.js.map +1 -0
  324. package/dist/esm/AppointmentAgent.d.ts +1539 -0
  325. package/dist/esm/AppointmentAgent.d.ts.map +1 -0
  326. package/dist/esm/AppointmentAgent.js +3358 -0
  327. package/dist/esm/AppointmentAgent.js.map +1 -0
  328. package/dist/esm/AppointmentRestApi.d.ts +46 -0
  329. package/dist/esm/AppointmentRestApi.d.ts.map +1 -0
  330. package/dist/esm/AppointmentRestApi.js +163 -0
  331. package/dist/esm/AppointmentRestApi.js.map +1 -0
  332. package/dist/esm/ArchiveAgent.d.ts +582 -0
  333. package/dist/esm/ArchiveAgent.d.ts.map +1 -0
  334. package/dist/esm/ArchiveAgent.js +1130 -0
  335. package/dist/esm/ArchiveAgent.js.map +1 -0
  336. package/dist/esm/AssociateAgent.d.ts +109 -0
  337. package/dist/esm/AssociateAgent.d.ts.map +1 -0
  338. package/dist/esm/AssociateAgent.js +252 -0
  339. package/dist/esm/AssociateAgent.js.map +1 -0
  340. package/dist/esm/AudienceAgent.d.ts +359 -0
  341. package/dist/esm/AudienceAgent.d.ts.map +1 -0
  342. package/dist/esm/AudienceAgent.js +883 -0
  343. package/dist/esm/AudienceAgent.js.map +1 -0
  344. package/dist/esm/AxiosCacheHandler.d.ts +20 -0
  345. package/dist/esm/AxiosCacheHandler.d.ts.map +1 -0
  346. package/dist/esm/AxiosCacheHandler.js +64 -0
  347. package/dist/esm/AxiosCacheHandler.js.map +1 -0
  348. package/dist/esm/BLOBAgent.d.ts +538 -0
  349. package/dist/esm/BLOBAgent.d.ts.map +1 -0
  350. package/dist/esm/BLOBAgent.js +1359 -0
  351. package/dist/esm/BLOBAgent.js.map +1 -0
  352. package/dist/esm/Base64.d.ts +4 -0
  353. package/dist/esm/Base64.d.ts.map +1 -0
  354. package/dist/esm/Base64.js +228 -0
  355. package/dist/esm/Base64.js.map +1 -0
  356. package/dist/esm/BatchAgent.d.ts +252 -0
  357. package/dist/esm/BatchAgent.d.ts.map +1 -0
  358. package/dist/esm/BatchAgent.js +517 -0
  359. package/dist/esm/BatchAgent.js.map +1 -0
  360. package/dist/esm/BulkUpdateAgent.d.ts +144 -0
  361. package/dist/esm/BulkUpdateAgent.d.ts.map +1 -0
  362. package/dist/esm/BulkUpdateAgent.js +283 -0
  363. package/dist/esm/BulkUpdateAgent.js.map +1 -0
  364. package/dist/esm/CRMScriptAgent.d.ts +330 -0
  365. package/dist/esm/CRMScriptAgent.d.ts.map +1 -0
  366. package/dist/esm/CRMScriptAgent.js +794 -0
  367. package/dist/esm/CRMScriptAgent.js.map +1 -0
  368. package/dist/esm/Carriers.d.ts +36976 -0
  369. package/dist/esm/Carriers.d.ts.map +1 -0
  370. package/dist/esm/Carriers.js +6 -0
  371. package/dist/esm/Carriers.js.map +1 -0
  372. package/dist/esm/ChatAgent.d.ts +366 -0
  373. package/dist/esm/ChatAgent.d.ts.map +1 -0
  374. package/dist/esm/ChatAgent.js +914 -0
  375. package/dist/esm/ChatAgent.js.map +1 -0
  376. package/dist/esm/ConfigurationAgent.d.ts +534 -0
  377. package/dist/esm/ConfigurationAgent.d.ts.map +1 -0
  378. package/dist/esm/ConfigurationAgent.js +1424 -0
  379. package/dist/esm/ConfigurationAgent.js.map +1 -0
  380. package/dist/esm/ContactAgent.d.ts +415 -0
  381. package/dist/esm/ContactAgent.d.ts.map +1 -0
  382. package/dist/esm/ContactAgent.js +1000 -0
  383. package/dist/esm/ContactAgent.js.map +1 -0
  384. package/dist/esm/ContactRestApi.d.ts +46 -0
  385. package/dist/esm/ContactRestApi.d.ts.map +1 -0
  386. package/dist/esm/ContactRestApi.js +163 -0
  387. package/dist/esm/ContactRestApi.js.map +1 -0
  388. package/dist/esm/Converters.d.ts +1359 -0
  389. package/dist/esm/Converters.d.ts.map +1 -0
  390. package/dist/esm/Converters.js +17609 -0
  391. package/dist/esm/Converters.js.map +1 -0
  392. package/dist/esm/CustomerServiceAgent.d.ts +447 -0
  393. package/dist/esm/CustomerServiceAgent.d.ts.map +1 -0
  394. package/dist/esm/CustomerServiceAgent.js +1118 -0
  395. package/dist/esm/CustomerServiceAgent.js.map +1 -0
  396. package/dist/esm/DashAgent.d.ts +370 -0
  397. package/dist/esm/DashAgent.d.ts.map +1 -0
  398. package/dist/esm/DashAgent.js +1023 -0
  399. package/dist/esm/DashAgent.js.map +1 -0
  400. package/dist/esm/DashboardAgent.d.ts +163 -0
  401. package/dist/esm/DashboardAgent.d.ts.map +1 -0
  402. package/dist/esm/DashboardAgent.js +431 -0
  403. package/dist/esm/DashboardAgent.js.map +1 -0
  404. package/dist/esm/DatabaseAgent.d.ts +35 -0
  405. package/dist/esm/DatabaseAgent.d.ts.map +1 -0
  406. package/dist/esm/DatabaseAgent.js +65 -0
  407. package/dist/esm/DatabaseAgent.js.map +1 -0
  408. package/dist/esm/DatabaseTableAgent.d.ts +155 -0
  409. package/dist/esm/DatabaseTableAgent.d.ts.map +1 -0
  410. package/dist/esm/DatabaseTableAgent.js +294 -0
  411. package/dist/esm/DatabaseTableAgent.js.map +1 -0
  412. package/dist/esm/Day_js.d.ts +4 -0
  413. package/dist/esm/Day_js.d.ts.map +1 -0
  414. package/dist/esm/Day_js.js +38 -0
  415. package/dist/esm/Day_js.js.map +1 -0
  416. package/dist/esm/DiagnosticsAgent.d.ts +200 -0
  417. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -0
  418. package/dist/esm/DiagnosticsAgent.js +475 -0
  419. package/dist/esm/DiagnosticsAgent.js.map +1 -0
  420. package/dist/esm/DocumentAgent.d.ts +1345 -0
  421. package/dist/esm/DocumentAgent.d.ts.map +1 -0
  422. package/dist/esm/DocumentAgent.js +3053 -0
  423. package/dist/esm/DocumentAgent.js.map +1 -0
  424. package/dist/esm/DocumentMigrationAgent.d.ts +145 -0
  425. package/dist/esm/DocumentMigrationAgent.d.ts.map +1 -0
  426. package/dist/esm/DocumentMigrationAgent.js +292 -0
  427. package/dist/esm/DocumentMigrationAgent.js.map +1 -0
  428. package/dist/esm/DocumentRestApi.d.ts +46 -0
  429. package/dist/esm/DocumentRestApi.d.ts.map +1 -0
  430. package/dist/esm/DocumentRestApi.js +163 -0
  431. package/dist/esm/DocumentRestApi.js.map +1 -0
  432. package/dist/esm/EMailAgent.d.ts +1417 -0
  433. package/dist/esm/EMailAgent.d.ts.map +1 -0
  434. package/dist/esm/EMailAgent.js +3197 -0
  435. package/dist/esm/EMailAgent.js.map +1 -0
  436. package/dist/esm/Enums.d.ts +6083 -0
  437. package/dist/esm/Enums.d.ts.map +1 -0
  438. package/dist/esm/Enums.js +6264 -0
  439. package/dist/esm/Enums.js.map +1 -0
  440. package/dist/esm/ErpSyncAgent.d.ts +725 -0
  441. package/dist/esm/ErpSyncAgent.d.ts.map +1 -0
  442. package/dist/esm/ErpSyncAgent.js +1596 -0
  443. package/dist/esm/ErpSyncAgent.js.map +1 -0
  444. package/dist/esm/FavouriteAgent.d.ts +208 -0
  445. package/dist/esm/FavouriteAgent.d.ts.map +1 -0
  446. package/dist/esm/FavouriteAgent.js +402 -0
  447. package/dist/esm/FavouriteAgent.js.map +1 -0
  448. package/dist/esm/FindAgent.d.ts +688 -0
  449. package/dist/esm/FindAgent.d.ts.map +1 -0
  450. package/dist/esm/FindAgent.js +1332 -0
  451. package/dist/esm/FindAgent.js.map +1 -0
  452. package/dist/esm/ForeignSystemAgent.d.ts +478 -0
  453. package/dist/esm/ForeignSystemAgent.d.ts.map +1 -0
  454. package/dist/esm/ForeignSystemAgent.js +1017 -0
  455. package/dist/esm/ForeignSystemAgent.js.map +1 -0
  456. package/dist/esm/FreeTextAgent.d.ts +172 -0
  457. package/dist/esm/FreeTextAgent.d.ts.map +1 -0
  458. package/dist/esm/FreeTextAgent.js +363 -0
  459. package/dist/esm/FreeTextAgent.js.map +1 -0
  460. package/dist/esm/ImportAgent.d.ts +92 -0
  461. package/dist/esm/ImportAgent.d.ts.map +1 -0
  462. package/dist/esm/ImportAgent.js +159 -0
  463. package/dist/esm/ImportAgent.js.map +1 -0
  464. package/dist/esm/LicenseAgent.d.ts +298 -0
  465. package/dist/esm/LicenseAgent.d.ts.map +1 -0
  466. package/dist/esm/LicenseAgent.js +634 -0
  467. package/dist/esm/LicenseAgent.js.map +1 -0
  468. package/dist/esm/ListAgent.d.ts +2423 -0
  469. package/dist/esm/ListAgent.d.ts.map +1 -0
  470. package/dist/esm/ListAgent.js +7808 -0
  471. package/dist/esm/ListAgent.js.map +1 -0
  472. package/dist/esm/MDOAgent.d.ts +214 -0
  473. package/dist/esm/MDOAgent.d.ts.map +1 -0
  474. package/dist/esm/MDOAgent.js +425 -0
  475. package/dist/esm/MDOAgent.js.map +1 -0
  476. package/dist/esm/MarketingAgent.d.ts +170 -0
  477. package/dist/esm/MarketingAgent.d.ts.map +1 -0
  478. package/dist/esm/MarketingAgent.js +565 -0
  479. package/dist/esm/MarketingAgent.js.map +1 -0
  480. package/dist/esm/MessagingAgent.d.ts +111 -0
  481. package/dist/esm/MessagingAgent.d.ts.map +1 -0
  482. package/dist/esm/MessagingAgent.js +212 -0
  483. package/dist/esm/MessagingAgent.js.map +1 -0
  484. package/dist/esm/NavigatorAgent.d.ts +40 -0
  485. package/dist/esm/NavigatorAgent.d.ts.map +1 -0
  486. package/dist/esm/NavigatorAgent.js +94 -0
  487. package/dist/esm/NavigatorAgent.js.map +1 -0
  488. package/dist/esm/NumberAllocationAgent.d.ts +72 -0
  489. package/dist/esm/NumberAllocationAgent.d.ts.map +1 -0
  490. package/dist/esm/NumberAllocationAgent.js +194 -0
  491. package/dist/esm/NumberAllocationAgent.js.map +1 -0
  492. package/dist/esm/PersonAgent.d.ts +774 -0
  493. package/dist/esm/PersonAgent.d.ts.map +1 -0
  494. package/dist/esm/PersonAgent.js +1809 -0
  495. package/dist/esm/PersonAgent.js.map +1 -0
  496. package/dist/esm/PersonRestApi.d.ts +46 -0
  497. package/dist/esm/PersonRestApi.d.ts.map +1 -0
  498. package/dist/esm/PersonRestApi.js +163 -0
  499. package/dist/esm/PersonRestApi.js.map +1 -0
  500. package/dist/esm/PhoneListAgent.d.ts +126 -0
  501. package/dist/esm/PhoneListAgent.d.ts.map +1 -0
  502. package/dist/esm/PhoneListAgent.js +264 -0
  503. package/dist/esm/PhoneListAgent.js.map +1 -0
  504. package/dist/esm/PocketAgent.d.ts +218 -0
  505. package/dist/esm/PocketAgent.d.ts.map +1 -0
  506. package/dist/esm/PocketAgent.js +446 -0
  507. package/dist/esm/PocketAgent.js.map +1 -0
  508. package/dist/esm/PreferenceAgent.d.ts +497 -0
  509. package/dist/esm/PreferenceAgent.d.ts.map +1 -0
  510. package/dist/esm/PreferenceAgent.js +1189 -0
  511. package/dist/esm/PreferenceAgent.js.map +1 -0
  512. package/dist/esm/PreviewsAgent.d.ts +36 -0
  513. package/dist/esm/PreviewsAgent.d.ts.map +1 -0
  514. package/dist/esm/PreviewsAgent.js +49 -0
  515. package/dist/esm/PreviewsAgent.js.map +1 -0
  516. package/dist/esm/ProjectAgent.d.ts +558 -0
  517. package/dist/esm/ProjectAgent.d.ts.map +1 -0
  518. package/dist/esm/ProjectAgent.js +1477 -0
  519. package/dist/esm/ProjectAgent.js.map +1 -0
  520. package/dist/esm/ProjectRestApi.d.ts +46 -0
  521. package/dist/esm/ProjectRestApi.d.ts.map +1 -0
  522. package/dist/esm/ProjectRestApi.js +163 -0
  523. package/dist/esm/ProjectRestApi.js.map +1 -0
  524. package/dist/esm/QuoteAgent.d.ts +1415 -0
  525. package/dist/esm/QuoteAgent.d.ts.map +1 -0
  526. package/dist/esm/QuoteAgent.js +3219 -0
  527. package/dist/esm/QuoteAgent.js.map +1 -0
  528. package/dist/esm/RelationAgent.d.ts +61 -0
  529. package/dist/esm/RelationAgent.d.ts.map +1 -0
  530. package/dist/esm/RelationAgent.js +127 -0
  531. package/dist/esm/RelationAgent.js.map +1 -0
  532. package/dist/esm/ReplicationAgent.d.ts +77 -0
  533. package/dist/esm/ReplicationAgent.d.ts.map +1 -0
  534. package/dist/esm/ReplicationAgent.js +218 -0
  535. package/dist/esm/ReplicationAgent.js.map +1 -0
  536. package/dist/esm/ReportAgent.d.ts +144 -0
  537. package/dist/esm/ReportAgent.d.ts.map +1 -0
  538. package/dist/esm/ReportAgent.js +375 -0
  539. package/dist/esm/ReportAgent.js.map +1 -0
  540. package/dist/esm/ResourceAgent.d.ts +105 -0
  541. package/dist/esm/ResourceAgent.d.ts.map +1 -0
  542. package/dist/esm/ResourceAgent.js +191 -0
  543. package/dist/esm/ResourceAgent.js.map +1 -0
  544. package/dist/esm/SaintAgent.d.ts +157 -0
  545. package/dist/esm/SaintAgent.d.ts.map +1 -0
  546. package/dist/esm/SaintAgent.js +397 -0
  547. package/dist/esm/SaintAgent.js.map +1 -0
  548. package/dist/esm/SaleAgent.d.ts +477 -0
  549. package/dist/esm/SaleAgent.d.ts.map +1 -0
  550. package/dist/esm/SaleAgent.js +1177 -0
  551. package/dist/esm/SaleAgent.js.map +1 -0
  552. package/dist/esm/SaleRestApi.d.ts +46 -0
  553. package/dist/esm/SaleRestApi.d.ts.map +1 -0
  554. package/dist/esm/SaleRestApi.js +163 -0
  555. package/dist/esm/SaleRestApi.js.map +1 -0
  556. package/dist/esm/SelectionAgent.d.ts +814 -0
  557. package/dist/esm/SelectionAgent.d.ts.map +1 -0
  558. package/dist/esm/SelectionAgent.js +1790 -0
  559. package/dist/esm/SelectionAgent.js.map +1 -0
  560. package/dist/esm/SentryAgent.d.ts +113 -0
  561. package/dist/esm/SentryAgent.d.ts.map +1 -0
  562. package/dist/esm/SentryAgent.js +233 -0
  563. package/dist/esm/SentryAgent.js.map +1 -0
  564. package/dist/esm/SoApiConstants.d.ts +8 -0
  565. package/dist/esm/SoApiConstants.d.ts.map +1 -0
  566. package/dist/esm/SoApiConstants.js +9 -0
  567. package/dist/esm/SoApiConstants.js.map +1 -0
  568. package/dist/esm/TargetsAgent.d.ts +289 -0
  569. package/dist/esm/TargetsAgent.d.ts.map +1 -0
  570. package/dist/esm/TargetsAgent.js +723 -0
  571. package/dist/esm/TargetsAgent.js.map +1 -0
  572. package/dist/esm/TicketAgent.d.ts +802 -0
  573. package/dist/esm/TicketAgent.d.ts.map +1 -0
  574. package/dist/esm/TicketAgent.js +1860 -0
  575. package/dist/esm/TicketAgent.js.map +1 -0
  576. package/dist/esm/TimeZoneAgent.d.ts +139 -0
  577. package/dist/esm/TimeZoneAgent.d.ts.map +1 -0
  578. package/dist/esm/TimeZoneAgent.js +343 -0
  579. package/dist/esm/TimeZoneAgent.js.map +1 -0
  580. package/dist/esm/TooltipsAgent.d.ts +36 -0
  581. package/dist/esm/TooltipsAgent.d.ts.map +1 -0
  582. package/dist/esm/TooltipsAgent.js +49 -0
  583. package/dist/esm/TooltipsAgent.js.map +1 -0
  584. package/dist/esm/UserAgent.d.ts +1260 -0
  585. package/dist/esm/UserAgent.d.ts.map +1 -0
  586. package/dist/esm/UserAgent.js +2973 -0
  587. package/dist/esm/UserAgent.js.map +1 -0
  588. package/dist/esm/UserDefinedFieldInfoAgent.d.ts +474 -0
  589. package/dist/esm/UserDefinedFieldInfoAgent.d.ts.map +1 -0
  590. package/dist/esm/UserDefinedFieldInfoAgent.js +1062 -0
  591. package/dist/esm/UserDefinedFieldInfoAgent.js.map +1 -0
  592. package/dist/esm/ViewStateAgent.d.ts +230 -0
  593. package/dist/esm/ViewStateAgent.d.ts.map +1 -0
  594. package/dist/esm/ViewStateAgent.js +513 -0
  595. package/dist/esm/ViewStateAgent.js.map +1 -0
  596. package/dist/esm/WebApi.d.ts +427 -0
  597. package/dist/esm/WebApi.d.ts.map +1 -0
  598. package/dist/esm/WebApi.js +649 -0
  599. package/dist/esm/WebApi.js.map +1 -0
  600. package/dist/esm/WebApiBase.d.ts +152 -0
  601. package/dist/esm/WebApiBase.d.ts.map +1 -0
  602. package/dist/esm/WebApiBase.js +437 -0
  603. package/dist/esm/WebApiBase.js.map +1 -0
  604. package/dist/esm/WebhookAgent.d.ts +102 -0
  605. package/dist/esm/WebhookAgent.d.ts.map +1 -0
  606. package/dist/esm/WebhookAgent.js +240 -0
  607. package/dist/esm/WebhookAgent.js.map +1 -0
  608. package/dist/esm/WorkflowAgent.d.ts +250 -0
  609. package/dist/esm/WorkflowAgent.d.ts.map +1 -0
  610. package/dist/esm/WorkflowAgent.js +758 -0
  611. package/dist/esm/WorkflowAgent.js.map +1 -0
  612. package/dist/esm/package.json +1 -0
  613. package/examples-js/hello.js +12 -0
  614. package/examples-ts/hello.ts +8 -0
  615. package/package.json +89 -0
  616. package/scripts/setVersion.js +46 -0
  617. package/src/AIAgent.ts +928 -0
  618. package/src/AppointmentAgent.ts +5573 -0
  619. package/src/AppointmentRestApi.ts +225 -0
  620. package/src/ArchiveAgent.ts +1950 -0
  621. package/src/AssociateAgent.ts +422 -0
  622. package/src/AudienceAgent.ts +1430 -0
  623. package/src/AxiosCacheHandler.ts +74 -0
  624. package/src/BLOBAgent.ts +2214 -0
  625. package/src/Base64.ts +285 -0
  626. package/src/BatchAgent.ts +910 -0
  627. package/src/BulkUpdateAgent.ts +504 -0
  628. package/src/CRMScriptAgent.ts +1276 -0
  629. package/src/Carriers.ts +49791 -0
  630. package/src/ChatAgent.ts +1422 -0
  631. package/src/ConfigurationAgent.ts +2138 -0
  632. package/src/ContactAgent.ts +1586 -0
  633. package/src/ContactRestApi.ts +235 -0
  634. package/src/Converters.ts +21633 -0
  635. package/src/CustomerServiceAgent.ts +1734 -0
  636. package/src/DashAgent.ts +1504 -0
  637. package/src/DashboardAgent.ts +658 -0
  638. package/src/DatabaseAgent.ts +120 -0
  639. package/src/DatabaseTableAgent.ts +534 -0
  640. package/src/Day_js.ts +41 -0
  641. package/src/DiagnosticsAgent.ts +744 -0
  642. package/src/DocumentAgent.ts +5018 -0
  643. package/src/DocumentMigrationAgent.ts +494 -0
  644. package/src/DocumentRestApi.ts +259 -0
  645. package/src/EMailAgent.ts +5210 -0
  646. package/src/Enums.ts +6438 -0
  647. package/src/ErpSyncAgent.ts +2658 -0
  648. package/src/FavouriteAgent.ts +720 -0
  649. package/src/FindAgent.ts +2330 -0
  650. package/src/ForeignSystemAgent.ts +1710 -0
  651. package/src/FreeTextAgent.ts +626 -0
  652. package/src/ImportAgent.ts +304 -0
  653. package/src/LicenseAgent.ts +1088 -0
  654. package/src/ListAgent.ts +10894 -0
  655. package/src/MDOAgent.ts +748 -0
  656. package/src/MarketingAgent.ts +776 -0
  657. package/src/MessagingAgent.ts +384 -0
  658. package/src/NavigatorAgent.ts +164 -0
  659. package/src/NumberAllocationAgent.ts +296 -0
  660. package/src/PersonAgent.ts +2919 -0
  661. package/src/PersonRestApi.ts +239 -0
  662. package/src/PhoneListAgent.ts +458 -0
  663. package/src/PocketAgent.ts +780 -0
  664. package/src/PreferenceAgent.ts +1900 -0
  665. package/src/PreviewsAgent.ts +116 -0
  666. package/src/ProjectAgent.ts +2275 -0
  667. package/src/ProjectRestApi.ts +239 -0
  668. package/src/QuoteAgent.ts +5294 -0
  669. package/src/RelationAgent.ts +220 -0
  670. package/src/ReplicationAgent.ts +325 -0
  671. package/src/ReportAgent.ts +575 -0
  672. package/src/ResourceAgent.ts +358 -0
  673. package/src/SaintAgent.ts +601 -0
  674. package/src/SaleAgent.ts +1862 -0
  675. package/src/SaleRestApi.ts +233 -0
  676. package/src/SelectionAgent.ts +2980 -0
  677. package/src/SentryAgent.ts +406 -0
  678. package/src/SoApiConstants.ts +8 -0
  679. package/src/TargetsAgent.ts +1104 -0
  680. package/src/TicketAgent.ts +3032 -0
  681. package/src/TimeZoneAgent.ts +528 -0
  682. package/src/TooltipsAgent.ts +116 -0
  683. package/src/UserAgent.ts +4798 -0
  684. package/src/UserDefinedFieldInfoAgent.ts +1764 -0
  685. package/src/ViewStateAgent.ts +858 -0
  686. package/src/WebApi.ts +908 -0
  687. package/src/WebApiBase.ts +562 -0
  688. package/src/WebhookAgent.ts +388 -0
  689. package/src/WorkflowAgent.ts +1054 -0
  690. package/tsconfig.esm.json +8 -0
  691. package/tsconfig.jest.json +12 -0
  692. package/tsconfig.json +35 -0
@@ -0,0 +1,2919 @@
1
+ // <auto-generated>
2
+ // SuperOffice Code Generator
3
+ // modelling\templates\servicestswebapi\tswebapiagents.tt
4
+ // </auto-generated>
5
+
6
+
7
+ /* tslint:disable */
8
+ //----------------------------------------------------------------------------
9
+ // G E N E R A T E D F I L E ! D O N O T E D I T !
10
+ //----------------------------------------------------------------------------
11
+ //
12
+ // File: WebApi/PersonAgent.ts
13
+ //
14
+ //----------------------------------------------------------------------------
15
+ // Copyright (C) SuperOffice AS
16
+ //----------------------------------------------------------------------------
17
+
18
+ import { AxiosRequestConfig } from 'axios';
19
+ import { Duration } from 'dayjs/plugin/duration';
20
+ import * as enums from './Enums.js';
21
+ import * as base from './WebApiBase.js';
22
+ import * as carriers from './Carriers.js';
23
+ import * as converters from './Converters.js';
24
+ import { FromBase64ToString, ToBase64 } from './Base64.js';
25
+
26
+ /**
27
+ * Person data services.
28
+ */
29
+ export interface IPersonAgent {
30
+ createDefaultConsentPersonAsync(): Promise< carriers.ConsentPerson >;
31
+ saveConsentPersonAsync(entity: carriers.ConsentPerson) : Promise< carriers.ConsentPerson >;
32
+ deleteConsentPersonAsync(ConsentPersonId: number) : Promise<void>;
33
+ createDefaultPersonEntityAsync(): Promise< carriers.PersonEntity >;
34
+ savePersonEntityAsync(entity: carriers.PersonEntity) : Promise< carriers.PersonEntity >;
35
+ deletePersonEntityAsync(PersonEntityId: number) : Promise<void>;
36
+ createDefaultPersonImageAsync(): Promise< carriers.PersonImage >;
37
+ getConsentPersonAsync(consentPersonId: number) : Promise< carriers.ConsentPerson >;
38
+ getPersonAsync(personId: number) : Promise< carriers.Person >;
39
+ getPersonEntityAsync(personEntityId: number) : Promise< carriers.PersonEntity >;
40
+ undeleteAsync(request: carriers.Person_UndeleteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
41
+ undeleteAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
42
+ getMyPersonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
43
+ getSalesRepAsync(request: carriers.Person_GetSalesRepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
44
+ getSalesRepAsync(contactName: string, personFirstname: string, personLastname: string, emailAddress: string, phoneNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
45
+ getPhonesAsync(request: carriers.Person_GetPhonesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] >;
46
+ getPhonesAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] >;
47
+ changeCountryAsync(request: carriers.Person_ChangeCountryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
48
+ changeCountryAsync(personEntity: carriers.PersonEntity, toCountryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
49
+ getAddressAsync(request: carriers.Person_GetAddressRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
50
+ getAddressAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
51
+ getAddressByCountryAsync(request: carriers.Person_GetAddressByCountryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
52
+ getAddressByCountryAsync(personId: number, countryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
53
+ getPersonImageAsync(request: carriers.Person_GetPersonImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
54
+ getPersonImageAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
55
+ setPersonImageAsync(request: carriers.Person_SetPersonImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
56
+ setPersonImageAsync(personId: number, image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
57
+ createDefaultByContactIdAsync(request: carriers.Person_CreateDefaultByContactIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
58
+ createDefaultByContactIdAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
59
+ moveAsync(request: carriers.Person_MoveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
60
+ moveAsync(personId: number, destinationContactId: number, moveAfterDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
61
+ mergeAsync(request: carriers.Person_MergeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
62
+ mergeAsync(sourcePersonId: number, destinationPersonId: number, moveAfterDate: Date, deleteSource: boolean, replaceEmptyFieldsOnDestination: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
63
+ createDefaultFromCredentialAsync(request: carriers.Person_CreateDefaultFromCredentialRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
64
+ createDefaultFromCredentialAsync(contactId: number, credentialType: string, credentialValue: string, credentialDisplayValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
65
+ isNumberValidAsync(request: carriers.Person_IsNumberValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
66
+ isNumberValidAsync(contactId: number, number: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
67
+ setConsentAsync(request: carriers.Person_SetConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
68
+ setConsentAsync(personId: number, purpose: string, source: string, legalBase: string, comment: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
69
+ removeConsentAsync(request: carriers.Person_RemoveConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
70
+ removeConsentAsync(personId: number, purpose: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
71
+ hasConsentAsync(request: carriers.Person_HasConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
72
+ hasConsentAsync(personId: number, purpose: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
73
+ getConsentInfosAsync(request: carriers.Person_GetConsentInfosRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] >;
74
+ getConsentInfosAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] >;
75
+ sendConsentConfirmationEmailAsync(request: carriers.Person_SendConsentConfirmationEmailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
76
+ sendConsentConfirmationEmailAsync(personId: number, emailAddress: string, emailTemplateId: number, cultureLcidId: number, subject: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
77
+ resolvePersonFromInfoAsync(request: carriers.Person_ResolvePersonFromInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson >;
78
+ resolvePersonFromInfoAsync(contactId: number, personName: string, phoneNumbers: string[], emails: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson >;
79
+ addEmailAddressToPersonAsync(request: carriers.Person_AddEmailAddressToPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
80
+ addEmailAddressToPersonAsync(personId: number, emailAddress: string, setAsPrimaryEmail: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
81
+ createTemporaryKeyAsync(request: carriers.Person_CreateTemporaryKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
82
+ createTemporaryKeyAsync(domain: enums.TemporaryKeyDomain, targetId: number, personId: number, expires: Date, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
83
+ checkTemporaryKeyAsync(request: carriers.Person_CheckTemporaryKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo >;
84
+ checkTemporaryKeyAsync(temporaryKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo >;
85
+ deleteTemporaryKeysOfDomainAsync(request: carriers.Person_DeleteTemporaryKeysOfDomainRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
86
+ deleteTemporaryKeysOfDomainAsync(domain: enums.TemporaryKeyDomain, personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
87
+ deleteExpiredAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
88
+ getPersonSummaryAsync(request: carriers.Person_GetPersonSummaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary >;
89
+ getPersonSummaryAsync(personId: number, limit: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary >;
90
+ addBounceAsync(request: carriers.Person_AddBounceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
91
+ addBounceAsync(emailAddress: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
92
+ validatePersonEntityAsync(request: carriers.Person_ValidatePersonEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
93
+ validatePersonEntityAsync(personEntity: carriers.PersonEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
94
+ addBounceWithCountAsync(request: carriers.Person_AddBounceWithCountRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
95
+ addBounceWithCountAsync(emailAddress: string, counts: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
96
+ getBestSoLanguageForTemplateAsync(request: carriers.Person_GetBestSoLanguageForTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
97
+ getBestSoLanguageForTemplateAsync(personId: number, templateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
98
+ addBounceWithDetailsAsync(request: carriers.Person_AddBounceWithDetailsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
99
+ addBounceWithDetailsAsync(emailAddress: string, counts: number, code: number, reason: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
100
+ getPersonImagesAsync(request: carriers.Person_GetPersonImagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] >;
101
+ getPersonImagesAsync(personIds: number[], scaledWidth: number, scaledHeight: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] >;
102
+ createOrUpdateUserCandidateAsync(request: carriers.Person_CreateOrUpdateUserCandidateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
103
+ createOrUpdateUserCandidateAsync(personId: number, username: string, accessAllRequests: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
104
+ getUserCandidateByPersonAsync(request: carriers.Person_GetUserCandidateByPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
105
+ getUserCandidateByPersonAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
106
+ getCustomerCentrePasswordReplyTemplateAsync(request: carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
107
+ getCustomerCentrePasswordReplyTemplateAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
108
+ sendEmailAsync(request: carriers.Person_SendEmailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
109
+ sendEmailAsync(from: string, to: string, subject: string, plainBody: string, htmlBody: string, attachmentIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
110
+ getPersonListAsync(personIds: number[]) : Promise< carriers.Person[] >;
111
+ getPersonsFromContactAsync(request: carriers.Person_GetPersonsFromContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
112
+ getPersonsFromContactAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
113
+ getPersonsFromProjectAsync(request: carriers.Person_GetPersonsFromProjectRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
114
+ getPersonsFromProjectAsync(projectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
115
+ getColleaguesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
116
+ getColleaguesByDepartmentAsync(request: carriers.Person_GetColleaguesByDepartmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
117
+ getColleaguesByDepartmentAsync(departmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
118
+ getColleaguesBySourceAsync(request: carriers.Person_GetColleaguesBySourceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
119
+ getColleaguesBySourceAsync(sourceType: enums.AssociateSourceType, count: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
120
+ getMyOwnerAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >;
121
+ getOwnerOnPersonIdAsync(request: carriers.Person_GetOwnerOnPersonIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >;
122
+ getOwnerOnPersonIdAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >;
123
+ changePersonRankAsync(request: carriers.Person_ChangePersonRankRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
124
+ changePersonRankAsync(personId: number, moveUp: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
125
+ setPersonRankAsync(request: carriers.Person_SetPersonRankRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
126
+ setPersonRankAsync(personId: number, desiredRank: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
127
+ normalizeRanksAsync(request: carriers.Person_NormalizeRanksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
128
+ normalizeRanksAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
129
+ } // interface IPersonAgent
130
+
131
+
132
+
133
+
134
+ /**
135
+ * Person data services.
136
+ */
137
+ export class PersonAgent extends base.WebApiBase implements IPersonAgent {
138
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
139
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
140
+ constructor(baseUrl: string, resourceManager:any);
141
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
142
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
143
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
144
+ constructor(options: base.WebApiOptions);
145
+
146
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
147
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
148
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
149
+ cultureCode?: string,
150
+ ) {
151
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
152
+ options.basePath = "v1/Agents/Person/";
153
+ super(options);
154
+ }
155
+
156
+
157
+
158
+ /**
159
+ * Set default values into a new ConsentPerson.
160
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
161
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
162
+ * @returns A blank entity.
163
+ */
164
+ public async createDefaultConsentPersonAsync(options?:base.WebApiRequestOptions) : Promise< carriers.ConsentPerson > {
165
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
166
+ base.WebApiBase.SetPending(options);
167
+ return new Promise< carriers.ConsentPerson >(async (resolve, reject) => {
168
+ try {
169
+ const response = await this._axios.post("CreateDefaultConsentPerson", null, config);
170
+ base.WebApiBase.SetCompleted(options);
171
+ const res : carriers.ConsentPerson = converters.Create_ConsentPerson_From( response.data );
172
+ resolve(res);
173
+ }
174
+ catch( err ) {
175
+ base.WebApiBase.HandleError(options, config, err);
176
+ reject(err);
177
+ }
178
+ });
179
+ }
180
+ /*
181
+ * Replace the existing ConsentPerson or creates a new ConsentPerson if the id parameter is empty
182
+ * @param entity - The ConsentPerson to be saved.
183
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
184
+ * @returns New or updated ConsentPerson
185
+ */
186
+ public async saveConsentPersonAsync(entity: carriers.ConsentPerson, options?:base.WebApiRequestOptions) : Promise< carriers.ConsentPerson > {
187
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
188
+ base.WebApiBase.SetPending(options);
189
+ return new Promise< carriers.ConsentPerson >(async (resolve, reject) => {
190
+ try {
191
+ const response = await this._axios.post("SaveConsentPerson", entity, config);
192
+ base.WebApiBase.SetCompleted(options);
193
+ const res : carriers.ConsentPerson = converters.Create_ConsentPerson_From( response.data );
194
+ resolve(res);
195
+ }
196
+ catch( err ) {
197
+ base.WebApiBase.HandleError(options, config, err);
198
+ reject(err);
199
+ }
200
+ });
201
+ }
202
+
203
+ /*
204
+ * Deletes the ConsentPerson
205
+ * @param ConsentPersonId - The id of the ConsentPerson to be deleted.
206
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
207
+ */
208
+ public async deleteConsentPersonAsync(ConsentPersonId: number, options?:base.WebApiRequestOptions) : Promise< void > {
209
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
210
+ base.WebApiBase.SetPending(options);
211
+ return new Promise< void >(async (resolve, reject) => {
212
+ try {
213
+ const response = await this._axios.post("DeleteConsentPerson?ConsentPersonId=" + ConsentPersonId, null, config );
214
+ base.WebApiBase.SetCompleted(options);
215
+ const res = response.data;
216
+ resolve(res);
217
+ }
218
+ catch( err ) {
219
+ base.WebApiBase.HandleError(options, config, err);
220
+ reject(err);
221
+ }
222
+ });
223
+ }
224
+
225
+ /**
226
+ * Set default values into a new PersonEntity.
227
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
228
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
229
+ * @returns A blank entity.
230
+ */
231
+ public async createDefaultPersonEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
232
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
233
+ base.WebApiBase.SetPending(options);
234
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
235
+ try {
236
+ const response = await this._axios.post("CreateDefaultPersonEntity", null, config);
237
+ base.WebApiBase.SetCompleted(options);
238
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
239
+ resolve(res);
240
+ }
241
+ catch( err ) {
242
+ base.WebApiBase.HandleError(options, config, err);
243
+ reject(err);
244
+ }
245
+ });
246
+ }
247
+ /*
248
+ * Replace the existing PersonEntity or creates a new PersonEntity if the id parameter is empty
249
+ * @param entity - The PersonEntity to be saved.
250
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
251
+ * @returns New or updated PersonEntity
252
+ */
253
+ public async savePersonEntityAsync(entity: carriers.PersonEntity, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
254
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
255
+ base.WebApiBase.SetPending(options);
256
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
257
+ try {
258
+ const response = await this._axios.post("SavePersonEntity", entity, config);
259
+ base.WebApiBase.SetCompleted(options);
260
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
261
+ resolve(res);
262
+ }
263
+ catch( err ) {
264
+ base.WebApiBase.HandleError(options, config, err);
265
+ reject(err);
266
+ }
267
+ });
268
+ }
269
+
270
+ /*
271
+ * Deletes the PersonEntity
272
+ * @param PersonEntityId - The id of the PersonEntity to be deleted.
273
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
274
+ */
275
+ public async deletePersonEntityAsync(PersonEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
276
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
277
+ base.WebApiBase.SetPending(options);
278
+ return new Promise< void >(async (resolve, reject) => {
279
+ try {
280
+ const response = await this._axios.post("DeletePersonEntity?PersonEntityId=" + PersonEntityId, null, config );
281
+ base.WebApiBase.SetCompleted(options);
282
+ const res = response.data;
283
+ resolve(res);
284
+ }
285
+ catch( err ) {
286
+ base.WebApiBase.HandleError(options, config, err);
287
+ reject(err);
288
+ }
289
+ });
290
+ }
291
+
292
+ /**
293
+ * Set default values into a new PersonImage.
294
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
295
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
296
+ * @returns A blank entity.
297
+ */
298
+ public async createDefaultPersonImageAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage > {
299
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
300
+ base.WebApiBase.SetPending(options);
301
+ return new Promise< carriers.PersonImage >(async (resolve, reject) => {
302
+ try {
303
+ const response = await this._axios.post("CreateDefaultPersonImage", null, config);
304
+ base.WebApiBase.SetCompleted(options);
305
+ const res : carriers.PersonImage = converters.Create_PersonImage_From( response.data );
306
+ resolve(res);
307
+ }
308
+ catch( err ) {
309
+ base.WebApiBase.HandleError(options, config, err);
310
+ reject(err);
311
+ }
312
+ });
313
+ }
314
+ /*
315
+ * Gets a ConsentPerson object.
316
+ * @param consentPersonId - The primary key.
317
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
318
+ * @returns A single ConsentPerson
319
+ */
320
+ public async getConsentPersonAsync(consentPersonId: number, options?:base.WebApiRequestOptions) : Promise< carriers.ConsentPerson > {
321
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
322
+ base.WebApiBase.SetPending(options);
323
+ return new Promise< carriers.ConsentPerson >(async (resolve, reject) => {
324
+ try {
325
+ const response = await this._axios.post("GetConsentPerson?consentPersonId=" + consentPersonId, null, config);
326
+ base.WebApiBase.SetCompleted(options);
327
+ const res = converters.Create_ConsentPerson_From( response.data );
328
+ resolve(res);
329
+ }
330
+ catch( err ) {
331
+ base.WebApiBase.HandleError(options, config, err);
332
+ reject(err);
333
+ }
334
+ });
335
+ }
336
+
337
+ /*
338
+ * Gets a Person object.
339
+ * @param personId - The primary key.
340
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
341
+ * @returns A single Person
342
+ */
343
+ public async getPersonAsync(personId: number, options?:base.WebApiRequestOptions) : Promise< carriers.Person > {
344
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
345
+ base.WebApiBase.SetPending(options);
346
+ return new Promise< carriers.Person >(async (resolve, reject) => {
347
+ try {
348
+ const response = await this._axios.post("GetPerson?personId=" + personId, null, config);
349
+ base.WebApiBase.SetCompleted(options);
350
+ const res = converters.Create_Person_From( response.data );
351
+ resolve(res);
352
+ }
353
+ catch( err ) {
354
+ base.WebApiBase.HandleError(options, config, err);
355
+ reject(err);
356
+ }
357
+ });
358
+ }
359
+
360
+ /*
361
+ * Gets a PersonEntity object.
362
+ * @param personEntityId - The primary key.
363
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
364
+ * @returns A single PersonEntity
365
+ */
366
+ public async getPersonEntityAsync(personEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
367
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
368
+ base.WebApiBase.SetPending(options);
369
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
370
+ try {
371
+ const response = await this._axios.post("GetPersonEntity?personEntityId=" + personEntityId, null, config);
372
+ base.WebApiBase.SetCompleted(options);
373
+ const res = converters.Create_PersonEntity_From( response.data );
374
+ resolve(res);
375
+ }
376
+ catch( err ) {
377
+ base.WebApiBase.HandleError(options, config, err);
378
+ reject(err);
379
+ }
380
+ });
381
+ }
382
+
383
+
384
+ private async _undeleteAsync(request: carriers.Person_UndeleteRequest, options?:base.WebApiRequestOptions) : Promise< void > {
385
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
386
+ base.WebApiBase.SetPending(options);
387
+ return new Promise< void >(async (resolve, reject) => {
388
+ try {
389
+ config.baseURL = this._options.baseUrl;
390
+ const response = await this._axios.post("Undelete", request , config);
391
+ base.WebApiBase.SetCompleted(options);
392
+ const res = response.data;
393
+ resolve(res);
394
+ }
395
+ catch( err ) {
396
+ base.WebApiBase.HandleError(options, config, err);
397
+ reject(err);
398
+ }
399
+ });
400
+ }
401
+
402
+
403
+
404
+ /**
405
+ * This entity supports Soft Delete. Call this method to Undelete a previously soft-deleted record
406
+ * @param request - Id
407
+ * @returns This method has no return value
408
+ */
409
+ public async undeleteAsync(request: carriers.Person_UndeleteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
410
+
411
+ /**
412
+ * This entity supports Soft Delete. Call this method to Undelete a previously soft-deleted record
413
+ * @param id - The primary key of the entity to undelete
414
+ * @returns This method has no return value
415
+ */
416
+ public async undeleteAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
417
+
418
+ public async undeleteAsync(id:number|carriers.Person_UndeleteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
419
+ let _request : carriers.Person_UndeleteRequest = null;
420
+ let _options : base.WebApiRequestOptions = null;
421
+ const first : any = id;
422
+ if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
423
+ {
424
+ _request = id as carriers.Person_UndeleteRequest;
425
+ _options = webapi_options as base.WebApiRequestOptions;
426
+ }
427
+ else
428
+ {
429
+ _request = {
430
+ id: id as number,
431
+ };
432
+ _options = webapi_options;
433
+ }
434
+ return this._undeleteAsync( _request, _options );
435
+ }
436
+
437
+
438
+ private async _getMyPersonAsync( options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
439
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
440
+ base.WebApiBase.SetPending(options);
441
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
442
+ try {
443
+ config.baseURL = this._options.baseUrl;
444
+ const response = await this._axios.post("GetMyPerson", undefined , config);
445
+ base.WebApiBase.SetCompleted(options);
446
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
447
+ resolve(res);
448
+ }
449
+ catch( err ) {
450
+ base.WebApiBase.HandleError(options, config, err);
451
+ reject(err);
452
+ }
453
+ });
454
+ }
455
+
456
+
457
+ /**
458
+ * Gets the person info belonging to the currently logged on user.
459
+ * @returns The PersonEntity
460
+ */
461
+ public async getMyPersonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >
462
+ {
463
+ return this._getMyPersonAsync(webapi_options);
464
+ }
465
+
466
+
467
+ private async _getSalesRepAsync(request: carriers.Person_GetSalesRepRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
468
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
469
+ base.WebApiBase.SetPending(options);
470
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
471
+ try {
472
+ config.baseURL = this._options.baseUrl;
473
+ const response = await this._axios.post("GetSalesRep", request , config);
474
+ base.WebApiBase.SetCompleted(options);
475
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
476
+ resolve(res);
477
+ }
478
+ catch( err ) {
479
+ base.WebApiBase.HandleError(options, config, err);
480
+ reject(err);
481
+ }
482
+ });
483
+ }
484
+
485
+
486
+
487
+ /**
488
+ * Returns the sales representative for an external user. If this method is accessed with anonymous authentication the external user is recognized by contact and name, or by email, or phone number. If the external user is recognized as an CRM5 user (internal or external) the input fields can be left blank.
489
+ * @param request - ContactName, PersonFirstname, PersonLastname, EmailAddress, PhoneNumber
490
+ * @returns The PersonEntity of the sales rep.
491
+ */
492
+ public async getSalesRepAsync(request: carriers.Person_GetSalesRepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
493
+
494
+ /**
495
+ * Returns the sales representative for an external user. If this method is accessed with anonymous authentication the external user is recognized by contact and name, or by email, or phone number. If the external user is recognized as an CRM5 user (internal or external) the input fields can be left blank.
496
+ * @param contactName - The company name of the person requesting his sales representative. May be empty if email or phone is provided.
497
+ * @param personFirstname - The firstname of the person requesting his sales representative. May be empty if email or phone is provided.
498
+ * @param personLastname - The lastname of the person requesting his sales representative. May be empty if email or phone is provided.
499
+ * @param emailAddress - The email address of the person requesting his sales representative. May be empty if phone, or contact and person name is provided.
500
+ * @param phoneNumber - The phone number of the person requesting his sales representative. May be empty if email, or contact and person name is provided.
501
+ * @returns The PersonEntity of the sales rep.
502
+ */
503
+ public async getSalesRepAsync(contactName: string, personFirstname: string, personLastname: string, emailAddress: string, phoneNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
504
+
505
+ public async getSalesRepAsync(contactName:string|carriers.Person_GetSalesRepRequest, personFirstname?:string|base.WebApiRequestOptions, personLastname?:string, emailAddress?:string, phoneNumber?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
506
+ let _request : carriers.Person_GetSalesRepRequest = null;
507
+ let _options : base.WebApiRequestOptions = null;
508
+ const first : any = contactName;
509
+ if( typeof( first ) === "object" && first && ( typeof(first.contactName)!='undefined' || typeof(first.personFirstname)!='undefined' || typeof(first.personLastname)!='undefined' || typeof(first.emailAddress)!='undefined' || typeof(first.phoneNumber)!='undefined' ) )
510
+ {
511
+ _request = contactName as carriers.Person_GetSalesRepRequest;
512
+ _options = personFirstname as base.WebApiRequestOptions;
513
+ }
514
+ else
515
+ {
516
+ _request = {
517
+ contactName: contactName as string,
518
+ personFirstname: personFirstname as string,
519
+ personLastname: personLastname as string,
520
+ emailAddress: emailAddress as string,
521
+ phoneNumber: phoneNumber as string,
522
+ };
523
+ _options = webapi_options;
524
+ }
525
+ return this._getSalesRepAsync( _request, _options );
526
+ }
527
+
528
+
529
+ private async _getPhonesAsync(request: carriers.Person_GetPhonesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] > {
530
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
531
+ base.WebApiBase.SetPending(options);
532
+ return new Promise< carriers.EntityElement[] >(async (resolve, reject) => {
533
+ try {
534
+ config.baseURL = this._options.baseUrl;
535
+ const response = await this._axios.post("GetPhones", request , config);
536
+ base.WebApiBase.SetCompleted(options);
537
+ const res : carriers.EntityElement[] = converters.Create_EntityElementArray_From( response.data );
538
+ resolve(res);
539
+ }
540
+ catch( err ) {
541
+ base.WebApiBase.HandleError(options, config, err);
542
+ reject(err);
543
+ }
544
+ });
545
+ }
546
+
547
+
548
+
549
+ /**
550
+ * Returning all phones that belong to a person, ordered by the phone type.
551
+ * @param request - PersonId
552
+ * @returns An array of Phones
553
+ */
554
+ public async getPhonesAsync(request: carriers.Person_GetPhonesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] >;
555
+
556
+ /**
557
+ * Returning all phones that belong to a person, ordered by the phone type.
558
+ * @param personId - The person id
559
+ * @returns An array of Phones
560
+ */
561
+ public async getPhonesAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] >;
562
+
563
+ public async getPhonesAsync(personId:number|carriers.Person_GetPhonesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityElement[] > {
564
+ let _request : carriers.Person_GetPhonesRequest = null;
565
+ let _options : base.WebApiRequestOptions = null;
566
+ const first : any = personId;
567
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
568
+ {
569
+ _request = personId as carriers.Person_GetPhonesRequest;
570
+ _options = webapi_options as base.WebApiRequestOptions;
571
+ }
572
+ else
573
+ {
574
+ _request = {
575
+ personId: personId as number,
576
+ };
577
+ _options = webapi_options;
578
+ }
579
+ return this._getPhonesAsync( _request, _options );
580
+ }
581
+
582
+
583
+ private async _changeCountryAsync(request: carriers.Person_ChangeCountryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
584
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
585
+ base.WebApiBase.SetPending(options);
586
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
587
+ try {
588
+ config.baseURL = this._options.baseUrl;
589
+ const response = await this._axios.post("ChangeCountry", request , config);
590
+ base.WebApiBase.SetCompleted(options);
591
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
592
+ resolve(res);
593
+ }
594
+ catch( err ) {
595
+ base.WebApiBase.HandleError(options, config, err);
596
+ reject(err);
597
+ }
598
+ });
599
+ }
600
+
601
+
602
+
603
+ /**
604
+ * Change country regenerates the default values and localized information such as phone number and address format for this entity.
605
+ * @param request - PersonEntity, ToCountryId
606
+ * @returns The PersonEntity
607
+ */
608
+ public async changeCountryAsync(request: carriers.Person_ChangeCountryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
609
+
610
+ /**
611
+ * Change country regenerates the default values and localized information such as phone number and address format for this entity.
612
+ * @param personEntity - The PersonEntity to change country on
613
+ * @param toCountryId - The country to switch to
614
+ * @returns The PersonEntity
615
+ */
616
+ public async changeCountryAsync(personEntity: carriers.PersonEntity, toCountryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
617
+
618
+ public async changeCountryAsync(personEntity:carriers.PersonEntity|carriers.Person_ChangeCountryRequest, toCountryId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
619
+ let _request : carriers.Person_ChangeCountryRequest = null;
620
+ let _options : base.WebApiRequestOptions = null;
621
+ const first : any = personEntity;
622
+ if( typeof( first ) === "object" && first && ( typeof(first.personEntity)!='undefined' || typeof(first.toCountryId)!='undefined' ) )
623
+ {
624
+ _request = personEntity as carriers.Person_ChangeCountryRequest;
625
+ _options = toCountryId as base.WebApiRequestOptions;
626
+ }
627
+ else
628
+ {
629
+ _request = {
630
+ personEntity: personEntity as carriers.PersonEntity,
631
+ toCountryId: toCountryId as number,
632
+ };
633
+ _options = webapi_options;
634
+ }
635
+ return this._changeCountryAsync( _request, _options );
636
+ }
637
+
638
+
639
+ private async _getAddressAsync(request: carriers.Person_GetAddressRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Address > {
640
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
641
+ base.WebApiBase.SetPending(options);
642
+ return new Promise< carriers.Address >(async (resolve, reject) => {
643
+ try {
644
+ config.baseURL = this._options.baseUrl;
645
+ const response = await this._axios.post("GetAddress", request , config);
646
+ base.WebApiBase.SetCompleted(options);
647
+ const res : carriers.Address = converters.Create_Address_From( response.data );
648
+ resolve(res);
649
+ }
650
+ catch( err ) {
651
+ base.WebApiBase.HandleError(options, config, err);
652
+ reject(err);
653
+ }
654
+ });
655
+ }
656
+
657
+
658
+
659
+ /**
660
+ * Gets the person&apos;s localized address.
661
+ * @param request - PersonId
662
+ * @returns The address as LocalizedField[][].
663
+ */
664
+ public async getAddressAsync(request: carriers.Person_GetAddressRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
665
+
666
+ /**
667
+ * Gets the person&apos;s localized address.
668
+ * @param personId - The person id
669
+ * @returns The address as LocalizedField[][].
670
+ */
671
+ public async getAddressAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
672
+
673
+ public async getAddressAsync(personId:number|carriers.Person_GetAddressRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address > {
674
+ let _request : carriers.Person_GetAddressRequest = null;
675
+ let _options : base.WebApiRequestOptions = null;
676
+ const first : any = personId;
677
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
678
+ {
679
+ _request = personId as carriers.Person_GetAddressRequest;
680
+ _options = webapi_options as base.WebApiRequestOptions;
681
+ }
682
+ else
683
+ {
684
+ _request = {
685
+ personId: personId as number,
686
+ };
687
+ _options = webapi_options;
688
+ }
689
+ return this._getAddressAsync( _request, _options );
690
+ }
691
+
692
+
693
+ private async _getAddressByCountryAsync(request: carriers.Person_GetAddressByCountryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Address > {
694
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
695
+ base.WebApiBase.SetPending(options);
696
+ return new Promise< carriers.Address >(async (resolve, reject) => {
697
+ try {
698
+ config.baseURL = this._options.baseUrl;
699
+ const response = await this._axios.post("GetAddressByCountry", request , config);
700
+ base.WebApiBase.SetCompleted(options);
701
+ const res : carriers.Address = converters.Create_Address_From( response.data );
702
+ resolve(res);
703
+ }
704
+ catch( err ) {
705
+ base.WebApiBase.HandleError(options, config, err);
706
+ reject(err);
707
+ }
708
+ });
709
+ }
710
+
711
+
712
+
713
+ /**
714
+ * Gets the person&apos;s localized address.
715
+ * @param request - PersonId, CountryId
716
+ * @returns The address as LocalizedField[][].
717
+ */
718
+ public async getAddressByCountryAsync(request: carriers.Person_GetAddressByCountryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
719
+
720
+ /**
721
+ * Gets the person&apos;s localized address.
722
+ * @param personId - The person id
723
+ * @param countryId -
724
+ * @returns The address as LocalizedField[][].
725
+ */
726
+ public async getAddressByCountryAsync(personId: number, countryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address >;
727
+
728
+ public async getAddressByCountryAsync(personId:number|carriers.Person_GetAddressByCountryRequest, countryId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Address > {
729
+ let _request : carriers.Person_GetAddressByCountryRequest = null;
730
+ let _options : base.WebApiRequestOptions = null;
731
+ const first : any = personId;
732
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.countryId)!='undefined' ) )
733
+ {
734
+ _request = personId as carriers.Person_GetAddressByCountryRequest;
735
+ _options = countryId as base.WebApiRequestOptions;
736
+ }
737
+ else
738
+ {
739
+ _request = {
740
+ personId: personId as number,
741
+ countryId: countryId as number,
742
+ };
743
+ _options = webapi_options;
744
+ }
745
+ return this._getAddressByCountryAsync( _request, _options );
746
+ }
747
+
748
+
749
+ private async _getPersonImageAsync(request: carriers.Person_GetPersonImageRequest, options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
750
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options) || {};
751
+ base.WebApiBase.SetPending(options);
752
+ return new Promise< ArrayBuffer|string >(async (resolve, reject) => {
753
+ try {
754
+ if( ! options || options.returnBlobAs == base.ReturnBlobType.AsArrayBuffer ) {
755
+ config.responseType = "arraybuffer";
756
+ config.headers = config.headers || {};
757
+ config.headers["Accept"] = "application/octet-stream";
758
+ }
759
+ config.baseURL = this._options.baseUrl;
760
+ const response = await this._axios.post("GetPersonImage", request , config);
761
+ base.WebApiBase.SetCompleted(options);
762
+ let res : ArrayBuffer | string = null;
763
+ if( options && options.returnBlobAs != base.ReturnBlobType.AsArrayBuffer )
764
+ {
765
+ res = response.data as string;
766
+ if( options.returnBlobAs == base.ReturnBlobType.AsString )
767
+ {
768
+ res = FromBase64ToString(res);
769
+ }
770
+ }
771
+ else
772
+ {
773
+ res = response.data as ArrayBuffer;
774
+ }
775
+
776
+ resolve(res);
777
+ }
778
+ catch( err ) {
779
+ base.WebApiBase.HandleError(options, config, err);
780
+ reject(err);
781
+ }
782
+ });
783
+ }
784
+
785
+
786
+
787
+ /**
788
+ * Returns the person image that is displayed in the CRM application.
789
+ * @param request - PersonId
790
+ * @returns The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.)
791
+ */
792
+ public async getPersonImageAsync(request: carriers.Person_GetPersonImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
793
+
794
+ /**
795
+ * Returns the person image that is displayed in the CRM application.
796
+ * @param personId - The person id of the person the image belongs to.
797
+ * @returns The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.)
798
+ */
799
+ public async getPersonImageAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
800
+
801
+ public async getPersonImageAsync(personId:number|carriers.Person_GetPersonImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
802
+ let _request : carriers.Person_GetPersonImageRequest = null;
803
+ let _options : base.WebApiRequestOptions = null;
804
+ const first : any = personId;
805
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
806
+ {
807
+ _request = personId as carriers.Person_GetPersonImageRequest;
808
+ _options = webapi_options as base.WebApiRequestOptions;
809
+ }
810
+ else
811
+ {
812
+ _request = {
813
+ personId: personId as number,
814
+ };
815
+ _options = webapi_options;
816
+ }
817
+ return this._getPersonImageAsync( _request, _options );
818
+ }
819
+
820
+
821
+ private async _setPersonImageAsync(request: carriers.Person_SetPersonImageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
822
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
823
+ base.WebApiBase.SetPending(options);
824
+ return new Promise< void >(async (resolve, reject) => {
825
+ try {
826
+ config.baseURL = this._options.baseUrl;
827
+ const response = await this._axios.post("SetPersonImage", request , config);
828
+ base.WebApiBase.SetCompleted(options);
829
+ const res = response.data;
830
+ resolve(res);
831
+ }
832
+ catch( err ) {
833
+ base.WebApiBase.HandleError(options, config, err);
834
+ reject(err);
835
+ }
836
+ });
837
+ }
838
+
839
+
840
+
841
+ /**
842
+ * Stores the person image that is displayed in the CRM application.
843
+ * @param request - PersonId, Image
844
+ * @returns
845
+ */
846
+ public async setPersonImageAsync(request: carriers.Person_SetPersonImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
847
+
848
+ /**
849
+ * Stores the person image that is displayed in the CRM application.
850
+ * @param personId - The person id of the person the image belongs to.
851
+ * @param image - The image that is stored on the person (System.Drawing.Image)
852
+ * @returns
853
+ */
854
+ public async setPersonImageAsync(personId: number, image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
855
+
856
+ public async setPersonImageAsync(personId:number|carriers.Person_SetPersonImageRequest, image?:ArrayBuffer|string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
857
+ let _request : carriers.Person_SetPersonImageRequest = null;
858
+ let _options : base.WebApiRequestOptions = null;
859
+ const first : any = personId;
860
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.image)!='undefined' ) )
861
+ {
862
+ _request = personId as carriers.Person_SetPersonImageRequest;
863
+ _options = image as base.WebApiRequestOptions;
864
+ }
865
+ else
866
+ {
867
+ _request = {
868
+ personId: personId as number,
869
+ image: image as ArrayBuffer|string,
870
+ };
871
+ _options = webapi_options;
872
+ }
873
+ _request.image = ToBase64(_request.image);
874
+ return this._setPersonImageAsync( _request, _options );
875
+ }
876
+
877
+
878
+ private async _createDefaultByContactIdAsync(request: carriers.Person_CreateDefaultByContactIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
879
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
880
+ base.WebApiBase.SetPending(options);
881
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
882
+ try {
883
+ config.baseURL = this._options.baseUrl;
884
+ const response = await this._axios.post("CreateDefaultByContactId", request , config);
885
+ base.WebApiBase.SetCompleted(options);
886
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
887
+ resolve(res);
888
+ }
889
+ catch( err ) {
890
+ base.WebApiBase.HandleError(options, config, err);
891
+ reject(err);
892
+ }
893
+ });
894
+ }
895
+
896
+
897
+
898
+ /**
899
+ * Creates a PersonEntity with default values based on the contactId.
900
+ * @param request - ContactId
901
+ * @returns
902
+ */
903
+ public async createDefaultByContactIdAsync(request: carriers.Person_CreateDefaultByContactIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
904
+
905
+ /**
906
+ * Creates a PersonEntity with default values based on the contactId.
907
+ * @param contactId - Contact id of the person
908
+ * @returns
909
+ */
910
+ public async createDefaultByContactIdAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
911
+
912
+ public async createDefaultByContactIdAsync(contactId:number|carriers.Person_CreateDefaultByContactIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
913
+ let _request : carriers.Person_CreateDefaultByContactIdRequest = null;
914
+ let _options : base.WebApiRequestOptions = null;
915
+ const first : any = contactId;
916
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' ) )
917
+ {
918
+ _request = contactId as carriers.Person_CreateDefaultByContactIdRequest;
919
+ _options = webapi_options as base.WebApiRequestOptions;
920
+ }
921
+ else
922
+ {
923
+ _request = {
924
+ contactId: contactId as number,
925
+ };
926
+ _options = webapi_options;
927
+ }
928
+ return this._createDefaultByContactIdAsync( _request, _options );
929
+ }
930
+
931
+
932
+ private async _moveAsync(request: carriers.Person_MoveRequest, options?:base.WebApiRequestOptions) : Promise< void > {
933
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
934
+ base.WebApiBase.SetPending(options);
935
+ return new Promise< void >(async (resolve, reject) => {
936
+ try {
937
+ config.baseURL = this._options.baseUrl;
938
+ const response = await this._axios.post("Move", request , config);
939
+ base.WebApiBase.SetCompleted(options);
940
+ const res = response.data;
941
+ resolve(res);
942
+ }
943
+ catch( err ) {
944
+ base.WebApiBase.HandleError(options, config, err);
945
+ reject(err);
946
+ }
947
+ });
948
+ }
949
+
950
+
951
+
952
+ /**
953
+ * Move a person to a specified contact. You must specify the date after which activities will be moved along with the person.
954
+ * @param request - PersonId, DestinationContactId, MoveAfterDate
955
+ * @returns
956
+ */
957
+ public async moveAsync(request: carriers.Person_MoveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
958
+
959
+ /**
960
+ * Move a person to a specified contact. You must specify the date after which activities will be moved along with the person.
961
+ * @param personId - The identifier for the person
962
+ * @param destinationContactId - The identifier for the contact which the person will be moved to
963
+ * @param moveAfterDate - Move activites after this date. Activities before this date are left alone.
964
+ * @returns
965
+ */
966
+ public async moveAsync(personId: number, destinationContactId: number, moveAfterDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
967
+
968
+ public async moveAsync(personId:number|carriers.Person_MoveRequest, destinationContactId?:number|base.WebApiRequestOptions, moveAfterDate?:Date, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
969
+ let _request : carriers.Person_MoveRequest = null;
970
+ let _options : base.WebApiRequestOptions = null;
971
+ const first : any = personId;
972
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.destinationContactId)!='undefined' || typeof(first.moveAfterDate)!='undefined' ) )
973
+ {
974
+ _request = personId as carriers.Person_MoveRequest;
975
+ _options = destinationContactId as base.WebApiRequestOptions;
976
+ }
977
+ else
978
+ {
979
+ _request = {
980
+ personId: personId as number,
981
+ destinationContactId: destinationContactId as number,
982
+ moveAfterDate: moveAfterDate as Date,
983
+ };
984
+ _options = webapi_options;
985
+ }
986
+ return this._moveAsync( _request, _options );
987
+ }
988
+
989
+
990
+ private async _mergeAsync(request: carriers.Person_MergeRequest, options?:base.WebApiRequestOptions) : Promise< void > {
991
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
992
+ base.WebApiBase.SetPending(options);
993
+ return new Promise< void >(async (resolve, reject) => {
994
+ try {
995
+ config.baseURL = this._options.baseUrl;
996
+ const response = await this._axios.post("Merge", request , config);
997
+ base.WebApiBase.SetCompleted(options);
998
+ const res = response.data;
999
+ resolve(res);
1000
+ }
1001
+ catch( err ) {
1002
+ base.WebApiBase.HandleError(options, config, err);
1003
+ reject(err);
1004
+ }
1005
+ });
1006
+ }
1007
+
1008
+
1009
+
1010
+ /**
1011
+ * Merge two persons. The destination person will remain. You must specify the date after which activities will be moved along with the person.
1012
+ * @param request - SourcePersonId, DestinationPersonId, MoveAfterDate, DeleteSource, ReplaceEmptyFieldsOnDestination
1013
+ * @returns
1014
+ */
1015
+ public async mergeAsync(request: carriers.Person_MergeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1016
+
1017
+ /**
1018
+ * Merge two persons. The destination person will remain. You must specify the date after which activities will be moved along with the person.
1019
+ * @param sourcePersonId - The identifier for the person which will be merged into the destination person. The source person is deleted/marked retired after the merge.
1020
+ * @param destinationPersonId - The identifier for the person which will remain after the merge. The target person is updated.
1021
+ * @param moveAfterDate - Merge activites after this date. Activities before this date are left alone.
1022
+ * @param deleteSource - If true, the source person will be deleted after the merge. If false, it will have its retired flag set
1023
+ * @param replaceEmptyFieldsOnDestination - If true, empty fields on destination will be replaced by values from source.
1024
+ * @returns
1025
+ */
1026
+ public async mergeAsync(sourcePersonId: number, destinationPersonId: number, moveAfterDate: Date, deleteSource: boolean, replaceEmptyFieldsOnDestination: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1027
+
1028
+ public async mergeAsync(sourcePersonId:number|carriers.Person_MergeRequest, destinationPersonId?:number|base.WebApiRequestOptions, moveAfterDate?:Date, deleteSource?:boolean, replaceEmptyFieldsOnDestination?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1029
+ let _request : carriers.Person_MergeRequest = null;
1030
+ let _options : base.WebApiRequestOptions = null;
1031
+ const first : any = sourcePersonId;
1032
+ if( typeof( first ) === "object" && first && ( typeof(first.sourcePersonId)!='undefined' || typeof(first.destinationPersonId)!='undefined' || typeof(first.moveAfterDate)!='undefined' || typeof(first.deleteSource)!='undefined' || typeof(first.replaceEmptyFieldsOnDestination)!='undefined' ) )
1033
+ {
1034
+ _request = sourcePersonId as carriers.Person_MergeRequest;
1035
+ _options = destinationPersonId as base.WebApiRequestOptions;
1036
+ }
1037
+ else
1038
+ {
1039
+ _request = {
1040
+ sourcePersonId: sourcePersonId as number,
1041
+ destinationPersonId: destinationPersonId as number,
1042
+ moveAfterDate: moveAfterDate as Date,
1043
+ deleteSource: deleteSource as boolean,
1044
+ replaceEmptyFieldsOnDestination: replaceEmptyFieldsOnDestination as boolean,
1045
+ };
1046
+ _options = webapi_options;
1047
+ }
1048
+ return this._mergeAsync( _request, _options );
1049
+ }
1050
+
1051
+
1052
+ private async _createDefaultFromCredentialAsync(request: carriers.Person_CreateDefaultFromCredentialRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
1053
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1054
+ base.WebApiBase.SetPending(options);
1055
+ return new Promise< carriers.PersonEntity >(async (resolve, reject) => {
1056
+ try {
1057
+ config.baseURL = this._options.baseUrl;
1058
+ const response = await this._axios.post("CreateDefaultFromCredential", request , config);
1059
+ base.WebApiBase.SetCompleted(options);
1060
+ const res : carriers.PersonEntity = converters.Create_PersonEntity_From( response.data );
1061
+ resolve(res);
1062
+ }
1063
+ catch( err ) {
1064
+ base.WebApiBase.HandleError(options, config, err);
1065
+ reject(err);
1066
+ }
1067
+ });
1068
+ }
1069
+
1070
+
1071
+
1072
+ /**
1073
+ * Creates a PersonEntity with default values based on the contactId and credentials.
1074
+ * @param request - ContactId, CredentialType, CredentialValue, CredentialDisplayValue
1075
+ * @returns
1076
+ */
1077
+ public async createDefaultFromCredentialAsync(request: carriers.Person_CreateDefaultFromCredentialRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
1078
+
1079
+ /**
1080
+ * Creates a PersonEntity with default values based on the contactId and credentials.
1081
+ * @param contactId - Contact id of the person
1082
+ * @param credentialType - Type of credentials, corresponding to name of plugin and type in the credentials table.
1083
+ * @param credentialValue - This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory
1084
+ * @param credentialDisplayValue - The value displayed to the user. this will typically be the users login name in active directory.
1085
+ * @returns
1086
+ */
1087
+ public async createDefaultFromCredentialAsync(contactId: number, credentialType: string, credentialValue: string, credentialDisplayValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity >;
1088
+
1089
+ public async createDefaultFromCredentialAsync(contactId:number|carriers.Person_CreateDefaultFromCredentialRequest, credentialType?:string|base.WebApiRequestOptions, credentialValue?:string, credentialDisplayValue?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonEntity > {
1090
+ let _request : carriers.Person_CreateDefaultFromCredentialRequest = null;
1091
+ let _options : base.WebApiRequestOptions = null;
1092
+ const first : any = contactId;
1093
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' || typeof(first.credentialType)!='undefined' || typeof(first.credentialValue)!='undefined' || typeof(first.credentialDisplayValue)!='undefined' ) )
1094
+ {
1095
+ _request = contactId as carriers.Person_CreateDefaultFromCredentialRequest;
1096
+ _options = credentialType as base.WebApiRequestOptions;
1097
+ }
1098
+ else
1099
+ {
1100
+ _request = {
1101
+ contactId: contactId as number,
1102
+ credentialType: credentialType as string,
1103
+ credentialValue: credentialValue as string,
1104
+ credentialDisplayValue: credentialDisplayValue as string,
1105
+ };
1106
+ _options = webapi_options;
1107
+ }
1108
+ return this._createDefaultFromCredentialAsync( _request, _options );
1109
+ }
1110
+
1111
+
1112
+ private async _isNumberValidAsync(request: carriers.Person_IsNumberValidRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
1113
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1114
+ base.WebApiBase.SetPending(options);
1115
+ return new Promise< boolean >(async (resolve, reject) => {
1116
+ try {
1117
+ config.baseURL = this._options.baseUrl;
1118
+ const response = await this._axios.post("IsNumberValid", request , config);
1119
+ base.WebApiBase.SetCompleted(options);
1120
+ const res : boolean = response.data as boolean;
1121
+ resolve(res);
1122
+ }
1123
+ catch( err ) {
1124
+ base.WebApiBase.HandleError(options, config, err);
1125
+ reject(err);
1126
+ }
1127
+ });
1128
+ }
1129
+
1130
+
1131
+
1132
+ /**
1133
+ * Checks if the number is unique or required. The setting is configured from admin under system options.
1134
+ * @param request - ContactId, Number
1135
+ * @returns True if number is ok (passes uniqueness/required checks)
1136
+ */
1137
+ public async isNumberValidAsync(request: carriers.Person_IsNumberValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1138
+
1139
+ /**
1140
+ * Checks if the number is unique or required. The setting is configured from admin under system options.
1141
+ * @param contactId -
1142
+ * @param number - Number to check.
1143
+ * @returns True if number is ok (passes uniqueness/required checks)
1144
+ */
1145
+ public async isNumberValidAsync(contactId: number, number: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1146
+
1147
+ public async isNumberValidAsync(contactId:number|carriers.Person_IsNumberValidRequest, number?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
1148
+ let _request : carriers.Person_IsNumberValidRequest = null;
1149
+ let _options : base.WebApiRequestOptions = null;
1150
+ const first : any = contactId;
1151
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' || typeof(first.number)!='undefined' ) )
1152
+ {
1153
+ _request = contactId as carriers.Person_IsNumberValidRequest;
1154
+ _options = number as base.WebApiRequestOptions;
1155
+ }
1156
+ else
1157
+ {
1158
+ _request = {
1159
+ contactId: contactId as number,
1160
+ number: number as string,
1161
+ };
1162
+ _options = webapi_options;
1163
+ }
1164
+ return this._isNumberValidAsync( _request, _options );
1165
+ }
1166
+
1167
+
1168
+ private async _setConsentAsync(request: carriers.Person_SetConsentRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1169
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1170
+ base.WebApiBase.SetPending(options);
1171
+ return new Promise< void >(async (resolve, reject) => {
1172
+ try {
1173
+ config.baseURL = this._options.baseUrl;
1174
+ const response = await this._axios.post("SetConsent", request , config);
1175
+ base.WebApiBase.SetCompleted(options);
1176
+ const res = response.data;
1177
+ resolve(res);
1178
+ }
1179
+ catch( err ) {
1180
+ base.WebApiBase.HandleError(options, config, err);
1181
+ reject(err);
1182
+ }
1183
+ });
1184
+ }
1185
+
1186
+
1187
+
1188
+ /**
1189
+ * Set a specified type of consent on the person.
1190
+ * @param request - PersonId, Purpose, Source, LegalBase, Comment
1191
+ * @returns
1192
+ */
1193
+ public async setConsentAsync(request: carriers.Person_SetConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1194
+
1195
+ /**
1196
+ * Set a specified type of consent on the person.
1197
+ * @param personId - The person id
1198
+ * @param purpose - The Key of the purpose this affects. e.g. 'STORE' or 'EMARKETING'.
1199
+ * @param source - The Key of the source of this consent. e.g. 'USER', 'WEBFORM' or 'API'.
1200
+ * @param legalBase - The Key of the legal base for this consent. e.g. '61A', '61B', '61F'
1201
+ * @param comment - A comment regarding this consent. May be null or empty.
1202
+ * @returns
1203
+ */
1204
+ public async setConsentAsync(personId: number, purpose: string, source: string, legalBase: string, comment: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1205
+
1206
+ public async setConsentAsync(personId:number|carriers.Person_SetConsentRequest, purpose?:string|base.WebApiRequestOptions, source?:string, legalBase?:string, comment?:string, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1207
+ let _request : carriers.Person_SetConsentRequest = null;
1208
+ let _options : base.WebApiRequestOptions = null;
1209
+ const first : any = personId;
1210
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.purpose)!='undefined' || typeof(first.source)!='undefined' || typeof(first.legalBase)!='undefined' || typeof(first.comment)!='undefined' ) )
1211
+ {
1212
+ _request = personId as carriers.Person_SetConsentRequest;
1213
+ _options = purpose as base.WebApiRequestOptions;
1214
+ }
1215
+ else
1216
+ {
1217
+ _request = {
1218
+ personId: personId as number,
1219
+ purpose: purpose as string,
1220
+ source: source as string,
1221
+ legalBase: legalBase as string,
1222
+ comment: comment as string,
1223
+ };
1224
+ _options = webapi_options;
1225
+ }
1226
+ return this._setConsentAsync( _request, _options );
1227
+ }
1228
+
1229
+
1230
+ private async _removeConsentAsync(request: carriers.Person_RemoveConsentRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1231
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1232
+ base.WebApiBase.SetPending(options);
1233
+ return new Promise< void >(async (resolve, reject) => {
1234
+ try {
1235
+ config.baseURL = this._options.baseUrl;
1236
+ const response = await this._axios.post("RemoveConsent", request , config);
1237
+ base.WebApiBase.SetCompleted(options);
1238
+ const res = response.data;
1239
+ resolve(res);
1240
+ }
1241
+ catch( err ) {
1242
+ base.WebApiBase.HandleError(options, config, err);
1243
+ reject(err);
1244
+ }
1245
+ });
1246
+ }
1247
+
1248
+
1249
+
1250
+ /**
1251
+ * Turn off consent for a specified person and purpose.
1252
+ * @param request - PersonId, Purpose
1253
+ * @returns
1254
+ */
1255
+ public async removeConsentAsync(request: carriers.Person_RemoveConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1256
+
1257
+ /**
1258
+ * Turn off consent for a specified person and purpose.
1259
+ * @param personId - The person id
1260
+ * @param purpose - The key of the purpose to remove. (e.g. 'STORE' or 'EMARKETING')
1261
+ * @returns
1262
+ */
1263
+ public async removeConsentAsync(personId: number, purpose: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1264
+
1265
+ public async removeConsentAsync(personId:number|carriers.Person_RemoveConsentRequest, purpose?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1266
+ let _request : carriers.Person_RemoveConsentRequest = null;
1267
+ let _options : base.WebApiRequestOptions = null;
1268
+ const first : any = personId;
1269
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.purpose)!='undefined' ) )
1270
+ {
1271
+ _request = personId as carriers.Person_RemoveConsentRequest;
1272
+ _options = purpose as base.WebApiRequestOptions;
1273
+ }
1274
+ else
1275
+ {
1276
+ _request = {
1277
+ personId: personId as number,
1278
+ purpose: purpose as string,
1279
+ };
1280
+ _options = webapi_options;
1281
+ }
1282
+ return this._removeConsentAsync( _request, _options );
1283
+ }
1284
+
1285
+
1286
+ private async _hasConsentAsync(request: carriers.Person_HasConsentRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
1287
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1288
+ base.WebApiBase.SetPending(options);
1289
+ return new Promise< boolean >(async (resolve, reject) => {
1290
+ try {
1291
+ config.baseURL = this._options.baseUrl;
1292
+ const response = await this._axios.post("HasConsent", request , config);
1293
+ base.WebApiBase.SetCompleted(options);
1294
+ const res : boolean = response.data as boolean;
1295
+ resolve(res);
1296
+ }
1297
+ catch( err ) {
1298
+ base.WebApiBase.HandleError(options, config, err);
1299
+ reject(err);
1300
+ }
1301
+ });
1302
+ }
1303
+
1304
+
1305
+
1306
+ /**
1307
+ * Check if consent has been given by a specified person, for a specific purpose. Withdraw consents return FALSE.
1308
+ * @param request - PersonId, Purpose
1309
+ * @returns True if the person has consented to the given purpose.
1310
+ */
1311
+ public async hasConsentAsync(request: carriers.Person_HasConsentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1312
+
1313
+ /**
1314
+ * Check if consent has been given by a specified person, for a specific purpose. Withdraw consents return FALSE.
1315
+ * @param personId - The person id
1316
+ * @param purpose - The key of the purpose to check. (e.g. 'STORE' or 'EMARKETING')
1317
+ * @returns True if the person has consented to the given purpose.
1318
+ */
1319
+ public async hasConsentAsync(personId: number, purpose: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1320
+
1321
+ public async hasConsentAsync(personId:number|carriers.Person_HasConsentRequest, purpose?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
1322
+ let _request : carriers.Person_HasConsentRequest = null;
1323
+ let _options : base.WebApiRequestOptions = null;
1324
+ const first : any = personId;
1325
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.purpose)!='undefined' ) )
1326
+ {
1327
+ _request = personId as carriers.Person_HasConsentRequest;
1328
+ _options = purpose as base.WebApiRequestOptions;
1329
+ }
1330
+ else
1331
+ {
1332
+ _request = {
1333
+ personId: personId as number,
1334
+ purpose: purpose as string,
1335
+ };
1336
+ _options = webapi_options;
1337
+ }
1338
+ return this._hasConsentAsync( _request, _options );
1339
+ }
1340
+
1341
+
1342
+ private async _getConsentInfosAsync(request: carriers.Person_GetConsentInfosRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] > {
1343
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1344
+ base.WebApiBase.SetPending(options);
1345
+ return new Promise< carriers.ConsentInfo[] >(async (resolve, reject) => {
1346
+ try {
1347
+ config.baseURL = this._options.baseUrl;
1348
+ const response = await this._axios.post("GetConsentInfos", request , config);
1349
+ base.WebApiBase.SetCompleted(options);
1350
+ const res : carriers.ConsentInfo[] = converters.Create_ConsentInfoArray_From( response.data );
1351
+ resolve(res);
1352
+ }
1353
+ catch( err ) {
1354
+ base.WebApiBase.HandleError(options, config, err);
1355
+ reject(err);
1356
+ }
1357
+ });
1358
+ }
1359
+
1360
+
1361
+
1362
+ /**
1363
+ * Get all consent information for a given person. May include withdrawn consents (check
1364
+ * @param request - PersonId
1365
+ * @returns List of consents recorded on this person
1366
+ */
1367
+ public async getConsentInfosAsync(request: carriers.Person_GetConsentInfosRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] >;
1368
+
1369
+ /**
1370
+ * Get all consent information for a given person. May include withdrawn consents (check
1371
+ * @param personId - The person id to get consents for
1372
+ * @returns List of consents recorded on this person
1373
+ */
1374
+ public async getConsentInfosAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] >;
1375
+
1376
+ public async getConsentInfosAsync(personId:number|carriers.Person_GetConsentInfosRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ConsentInfo[] > {
1377
+ let _request : carriers.Person_GetConsentInfosRequest = null;
1378
+ let _options : base.WebApiRequestOptions = null;
1379
+ const first : any = personId;
1380
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
1381
+ {
1382
+ _request = personId as carriers.Person_GetConsentInfosRequest;
1383
+ _options = webapi_options as base.WebApiRequestOptions;
1384
+ }
1385
+ else
1386
+ {
1387
+ _request = {
1388
+ personId: personId as number,
1389
+ };
1390
+ _options = webapi_options;
1391
+ }
1392
+ return this._getConsentInfosAsync( _request, _options );
1393
+ }
1394
+
1395
+
1396
+ private async _sendConsentConfirmationEmailAsync(request: carriers.Person_SendConsentConfirmationEmailRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1397
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1398
+ base.WebApiBase.SetPending(options);
1399
+ return new Promise< void >(async (resolve, reject) => {
1400
+ try {
1401
+ config.baseURL = this._options.baseUrl;
1402
+ const response = await this._axios.post("SendConsentConfirmationEmail", request , config);
1403
+ base.WebApiBase.SetCompleted(options);
1404
+ const res = response.data;
1405
+ resolve(res);
1406
+ }
1407
+ catch( err ) {
1408
+ base.WebApiBase.HandleError(options, config, err);
1409
+ reject(err);
1410
+ }
1411
+ });
1412
+ }
1413
+
1414
+
1415
+
1416
+ /**
1417
+ * Send confirmation email to the provided person, email address (id), using the document template
1418
+ * @param request - PersonId, EmailAddress, EmailTemplateId, CultureLcidId, Subject
1419
+ * @returns
1420
+ */
1421
+ public async sendConsentConfirmationEmailAsync(request: carriers.Person_SendConsentConfirmationEmailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1422
+
1423
+ /**
1424
+ * Send confirmation email to the provided person, email address (id), using the document template
1425
+ * @param personId - The person id
1426
+ * @param emailAddress - The email address to send to.
1427
+ * @param emailTemplateId - The id of the email template (doctmpl_id)
1428
+ * @param cultureLcidId - The id of the culture (LCID)
1429
+ * @param subject - Optional email subject
1430
+ * @returns
1431
+ */
1432
+ public async sendConsentConfirmationEmailAsync(personId: number, emailAddress: string, emailTemplateId: number, cultureLcidId: number, subject: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1433
+
1434
+ public async sendConsentConfirmationEmailAsync(personId:number|carriers.Person_SendConsentConfirmationEmailRequest, emailAddress?:string|base.WebApiRequestOptions, emailTemplateId?:number, cultureLcidId?:number, subject?:string, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1435
+ let _request : carriers.Person_SendConsentConfirmationEmailRequest = null;
1436
+ let _options : base.WebApiRequestOptions = null;
1437
+ const first : any = personId;
1438
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.emailAddress)!='undefined' || typeof(first.emailTemplateId)!='undefined' || typeof(first.cultureLcidId)!='undefined' || typeof(first.subject)!='undefined' ) )
1439
+ {
1440
+ _request = personId as carriers.Person_SendConsentConfirmationEmailRequest;
1441
+ _options = emailAddress as base.WebApiRequestOptions;
1442
+ }
1443
+ else
1444
+ {
1445
+ _request = {
1446
+ personId: personId as number,
1447
+ emailAddress: emailAddress as string,
1448
+ emailTemplateId: emailTemplateId as number,
1449
+ cultureLcidId: cultureLcidId as number,
1450
+ subject: subject as string,
1451
+ };
1452
+ _options = webapi_options;
1453
+ }
1454
+ return this._sendConsentConfirmationEmailAsync( _request, _options );
1455
+ }
1456
+
1457
+
1458
+ private async _resolvePersonFromInfoAsync(request: carriers.Person_ResolvePersonFromInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson > {
1459
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1460
+ base.WebApiBase.SetPending(options);
1461
+ return new Promise< carriers.ResolvedPerson >(async (resolve, reject) => {
1462
+ try {
1463
+ config.baseURL = this._options.baseUrl;
1464
+ const response = await this._axios.post("ResolvePersonFromInfo", request , config);
1465
+ base.WebApiBase.SetCompleted(options);
1466
+ const res : carriers.ResolvedPerson = converters.Create_ResolvedPerson_From( response.data );
1467
+ resolve(res);
1468
+ }
1469
+ catch( err ) {
1470
+ base.WebApiBase.HandleError(options, config, err);
1471
+ reject(err);
1472
+ }
1473
+ });
1474
+ }
1475
+
1476
+
1477
+
1478
+ /**
1479
+ * Get a person from the provided information. If the person does not exist, it will be created on demand.
1480
+ * @param request - ContactId, PersonName, PhoneNumbers, Emails
1481
+ * @returns The results of the resolve-operation.
1482
+ */
1483
+ public async resolvePersonFromInfoAsync(request: carriers.Person_ResolvePersonFromInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson >;
1484
+
1485
+ /**
1486
+ * Get a person from the provided information. If the person does not exist, it will be created on demand.
1487
+ * @param contactId - The contact Id of the contact which the person belongs to. Cannot be 0.
1488
+ * @param personName - The full name of the person to be resolved. Optional.
1489
+ * @param phoneNumbers - Phone numbers registered on the person. Optional.
1490
+ * @param emails - Email-addresses registered on the person. Optional.
1491
+ * @returns The results of the resolve-operation.
1492
+ */
1493
+ public async resolvePersonFromInfoAsync(contactId: number, personName: string, phoneNumbers: string[], emails: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson >;
1494
+
1495
+ public async resolvePersonFromInfoAsync(contactId:number|carriers.Person_ResolvePersonFromInfoRequest, personName?:string|base.WebApiRequestOptions, phoneNumbers?:string[], emails?:string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ResolvedPerson > {
1496
+ let _request : carriers.Person_ResolvePersonFromInfoRequest = null;
1497
+ let _options : base.WebApiRequestOptions = null;
1498
+ const first : any = contactId;
1499
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' || typeof(first.personName)!='undefined' || typeof(first.phoneNumbers)!='undefined' || typeof(first.emails)!='undefined' ) )
1500
+ {
1501
+ _request = contactId as carriers.Person_ResolvePersonFromInfoRequest;
1502
+ _options = personName as base.WebApiRequestOptions;
1503
+ }
1504
+ else
1505
+ {
1506
+ _request = {
1507
+ contactId: contactId as number,
1508
+ personName: personName as string,
1509
+ phoneNumbers: phoneNumbers as string[],
1510
+ emails: emails as string[],
1511
+ };
1512
+ _options = webapi_options;
1513
+ }
1514
+ return this._resolvePersonFromInfoAsync( _request, _options );
1515
+ }
1516
+
1517
+
1518
+ private async _addEmailAddressToPersonAsync(request: carriers.Person_AddEmailAddressToPersonRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1519
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1520
+ base.WebApiBase.SetPending(options);
1521
+ return new Promise< void >(async (resolve, reject) => {
1522
+ try {
1523
+ config.baseURL = this._options.baseUrl;
1524
+ const response = await this._axios.post("AddEmailAddressToPerson", request , config);
1525
+ base.WebApiBase.SetCompleted(options);
1526
+ const res = response.data;
1527
+ resolve(res);
1528
+ }
1529
+ catch( err ) {
1530
+ base.WebApiBase.HandleError(options, config, err);
1531
+ reject(err);
1532
+ }
1533
+ });
1534
+ }
1535
+
1536
+
1537
+
1538
+ /**
1539
+ * Sets the primary email address on person, possibly re-ranking email addresses accordingly.
1540
+ * @param request - PersonId, EmailAddress, SetAsPrimaryEmail
1541
+ * @returns
1542
+ */
1543
+ public async addEmailAddressToPersonAsync(request: carriers.Person_AddEmailAddressToPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1544
+
1545
+ /**
1546
+ * Sets the primary email address on person, possibly re-ranking email addresses accordingly.
1547
+ * @param personId - Person id of the person
1548
+ * @param emailAddress - The email address to set as primary email address
1549
+ * @param setAsPrimaryEmail - True if the address shall be primary email address (have rank == 1)
1550
+ * @returns
1551
+ */
1552
+ public async addEmailAddressToPersonAsync(personId: number, emailAddress: string, setAsPrimaryEmail: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1553
+
1554
+ public async addEmailAddressToPersonAsync(personId:number|carriers.Person_AddEmailAddressToPersonRequest, emailAddress?:string|base.WebApiRequestOptions, setAsPrimaryEmail?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1555
+ let _request : carriers.Person_AddEmailAddressToPersonRequest = null;
1556
+ let _options : base.WebApiRequestOptions = null;
1557
+ const first : any = personId;
1558
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.emailAddress)!='undefined' || typeof(first.setAsPrimaryEmail)!='undefined' ) )
1559
+ {
1560
+ _request = personId as carriers.Person_AddEmailAddressToPersonRequest;
1561
+ _options = emailAddress as base.WebApiRequestOptions;
1562
+ }
1563
+ else
1564
+ {
1565
+ _request = {
1566
+ personId: personId as number,
1567
+ emailAddress: emailAddress as string,
1568
+ setAsPrimaryEmail: setAsPrimaryEmail as boolean,
1569
+ };
1570
+ _options = webapi_options;
1571
+ }
1572
+ return this._addEmailAddressToPersonAsync( _request, _options );
1573
+ }
1574
+
1575
+
1576
+ private async _createTemporaryKeyAsync(request: carriers.Person_CreateTemporaryKeyRequest, options?:base.WebApiRequestOptions) : Promise< string > {
1577
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1578
+ base.WebApiBase.SetPending(options);
1579
+ return new Promise< string >(async (resolve, reject) => {
1580
+ try {
1581
+ config.baseURL = this._options.baseUrl;
1582
+ const response = await this._axios.post("CreateTemporaryKey", request , config);
1583
+ base.WebApiBase.SetCompleted(options);
1584
+ const res : string = response.data as string;
1585
+ resolve(res);
1586
+ }
1587
+ catch( err ) {
1588
+ base.WebApiBase.HandleError(options, config, err);
1589
+ reject(err);
1590
+ }
1591
+ });
1592
+ }
1593
+
1594
+
1595
+
1596
+ /**
1597
+ * Create a temporary key in the database from the given parameters and return the key string. Used for temporary keys for accessing customer centric functionality, such as UpdateSubscriptions.
1598
+ * @param request - Domain, TargetId, PersonId, Expires
1599
+ * @returns The key as base64, ready to be used e.g. in a URL
1600
+ */
1601
+ public async createTemporaryKeyAsync(request: carriers.Person_CreateTemporaryKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
1602
+
1603
+ /**
1604
+ * Create a temporary key in the database from the given parameters and return the key string. Used for temporary keys for accessing customer centric functionality, such as UpdateSubscriptions.
1605
+ * @param domain - The domain this key is for
1606
+ * @param targetId - The primary key of the entity this is for. Depends on domain.
1607
+ * @param personId - The person this key is for. May be null.
1608
+ * @param expires - When the key will expire (servers local time)
1609
+ * @returns The key as base64, ready to be used e.g. in a URL
1610
+ */
1611
+ public async createTemporaryKeyAsync(domain: enums.TemporaryKeyDomain, targetId: number, personId: number, expires: Date, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
1612
+
1613
+ public async createTemporaryKeyAsync(domain:enums.TemporaryKeyDomain|carriers.Person_CreateTemporaryKeyRequest, targetId?:number|base.WebApiRequestOptions, personId?:number, expires?:Date, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
1614
+ let _request : carriers.Person_CreateTemporaryKeyRequest = null;
1615
+ let _options : base.WebApiRequestOptions = null;
1616
+ const first : any = domain;
1617
+ if( typeof( first ) === "object" && first && ( typeof(first.domain)!='undefined' || typeof(first.targetId)!='undefined' || typeof(first.personId)!='undefined' || typeof(first.expires)!='undefined' ) )
1618
+ {
1619
+ _request = domain as carriers.Person_CreateTemporaryKeyRequest;
1620
+ _options = targetId as base.WebApiRequestOptions;
1621
+ }
1622
+ else
1623
+ {
1624
+ _request = {
1625
+ domain: domain as enums.TemporaryKeyDomain,
1626
+ targetId: targetId as number,
1627
+ personId: personId as number,
1628
+ expires: expires as Date,
1629
+ };
1630
+ _options = webapi_options;
1631
+ }
1632
+ return this._createTemporaryKeyAsync( _request, _options );
1633
+ }
1634
+
1635
+
1636
+ private async _checkTemporaryKeyAsync(request: carriers.Person_CheckTemporaryKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo > {
1637
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1638
+ base.WebApiBase.SetPending(options);
1639
+ return new Promise< carriers.TemporaryKeyInfo >(async (resolve, reject) => {
1640
+ try {
1641
+ config.baseURL = this._options.baseUrl;
1642
+ const response = await this._axios.post("CheckTemporaryKey", request , config);
1643
+ base.WebApiBase.SetCompleted(options);
1644
+ const res : carriers.TemporaryKeyInfo = converters.Create_TemporaryKeyInfo_From( response.data );
1645
+ resolve(res);
1646
+ }
1647
+ catch( err ) {
1648
+ base.WebApiBase.HandleError(options, config, err);
1649
+ reject(err);
1650
+ }
1651
+ });
1652
+ }
1653
+
1654
+
1655
+
1656
+ /**
1657
+ * Check a temporary key for validity, and in case it is valid, return its domain, targetId and personId
1658
+ * @param request - TemporaryKey
1659
+ * @returns The info about the temporary key. Domain will be Unknown if key is not valid.
1660
+ */
1661
+ public async checkTemporaryKeyAsync(request: carriers.Person_CheckTemporaryKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo >;
1662
+
1663
+ /**
1664
+ * Check a temporary key for validity, and in case it is valid, return its domain, targetId and personId
1665
+ * @param temporaryKey - The base64 encoded key value, as returned by CreateTemporaryKey
1666
+ * @returns The info about the temporary key. Domain will be Unknown if key is not valid.
1667
+ */
1668
+ public async checkTemporaryKeyAsync(temporaryKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo >;
1669
+
1670
+ public async checkTemporaryKeyAsync(temporaryKey:string|carriers.Person_CheckTemporaryKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TemporaryKeyInfo > {
1671
+ let _request : carriers.Person_CheckTemporaryKeyRequest = null;
1672
+ let _options : base.WebApiRequestOptions = null;
1673
+ const first : any = temporaryKey;
1674
+ if( typeof( first ) === "object" && first && ( typeof(first.temporaryKey)!='undefined' ) )
1675
+ {
1676
+ _request = temporaryKey as carriers.Person_CheckTemporaryKeyRequest;
1677
+ _options = webapi_options as base.WebApiRequestOptions;
1678
+ }
1679
+ else
1680
+ {
1681
+ _request = {
1682
+ temporaryKey: temporaryKey as string,
1683
+ };
1684
+ _options = webapi_options;
1685
+ }
1686
+ return this._checkTemporaryKeyAsync( _request, _options );
1687
+ }
1688
+
1689
+
1690
+ private async _deleteTemporaryKeysOfDomainAsync(request: carriers.Person_DeleteTemporaryKeysOfDomainRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1691
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1692
+ base.WebApiBase.SetPending(options);
1693
+ return new Promise< void >(async (resolve, reject) => {
1694
+ try {
1695
+ config.baseURL = this._options.baseUrl;
1696
+ const response = await this._axios.post("DeleteTemporaryKeysOfDomain", request , config);
1697
+ base.WebApiBase.SetCompleted(options);
1698
+ const res = response.data;
1699
+ resolve(res);
1700
+ }
1701
+ catch( err ) {
1702
+ base.WebApiBase.HandleError(options, config, err);
1703
+ reject(err);
1704
+ }
1705
+ });
1706
+ }
1707
+
1708
+
1709
+
1710
+ /**
1711
+ * Delete all temporary keys for a given domain and person
1712
+ * @param request - Domain, PersonId
1713
+ * @returns
1714
+ */
1715
+ public async deleteTemporaryKeysOfDomainAsync(request: carriers.Person_DeleteTemporaryKeysOfDomainRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1716
+
1717
+ /**
1718
+ * Delete all temporary keys for a given domain and person
1719
+ * @param domain - The domain type to delete
1720
+ * @param personId - The person for which to delete the keys
1721
+ * @returns
1722
+ */
1723
+ public async deleteTemporaryKeysOfDomainAsync(domain: enums.TemporaryKeyDomain, personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1724
+
1725
+ public async deleteTemporaryKeysOfDomainAsync(domain:enums.TemporaryKeyDomain|carriers.Person_DeleteTemporaryKeysOfDomainRequest, personId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1726
+ let _request : carriers.Person_DeleteTemporaryKeysOfDomainRequest = null;
1727
+ let _options : base.WebApiRequestOptions = null;
1728
+ const first : any = domain;
1729
+ if( typeof( first ) === "object" && first && ( typeof(first.domain)!='undefined' || typeof(first.personId)!='undefined' ) )
1730
+ {
1731
+ _request = domain as carriers.Person_DeleteTemporaryKeysOfDomainRequest;
1732
+ _options = personId as base.WebApiRequestOptions;
1733
+ }
1734
+ else
1735
+ {
1736
+ _request = {
1737
+ domain: domain as enums.TemporaryKeyDomain,
1738
+ personId: personId as number,
1739
+ };
1740
+ _options = webapi_options;
1741
+ }
1742
+ return this._deleteTemporaryKeysOfDomainAsync( _request, _options );
1743
+ }
1744
+
1745
+
1746
+ private async _deleteExpiredAsync( options?:base.WebApiRequestOptions) : Promise< void > {
1747
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1748
+ base.WebApiBase.SetPending(options);
1749
+ return new Promise< void >(async (resolve, reject) => {
1750
+ try {
1751
+ config.baseURL = this._options.baseUrl;
1752
+ const response = await this._axios.post("DeleteExpired", undefined , config);
1753
+ base.WebApiBase.SetCompleted(options);
1754
+ const res = response.data;
1755
+ resolve(res);
1756
+ }
1757
+ catch( err ) {
1758
+ base.WebApiBase.HandleError(options, config, err);
1759
+ reject(err);
1760
+ }
1761
+ });
1762
+ }
1763
+
1764
+
1765
+ /**
1766
+ * Trigger deletion of persons that has been (soft) deleted and have timed out the expiry period (the SoftDeleteRetention preference).
1767
+ * @returns
1768
+ */
1769
+ public async deleteExpiredAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
1770
+ {
1771
+ return this._deleteExpiredAsync(webapi_options);
1772
+ }
1773
+
1774
+
1775
+ private async _getPersonSummaryAsync(request: carriers.Person_GetPersonSummaryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary > {
1776
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1777
+ base.WebApiBase.SetPending(options);
1778
+ return new Promise< carriers.PersonSummary >(async (resolve, reject) => {
1779
+ try {
1780
+ config.baseURL = this._options.baseUrl;
1781
+ const response = await this._axios.post("GetPersonSummary", request , config);
1782
+ base.WebApiBase.SetCompleted(options);
1783
+ const res : carriers.PersonSummary = converters.Create_PersonSummary_From( response.data );
1784
+ resolve(res);
1785
+ }
1786
+ catch( err ) {
1787
+ base.WebApiBase.HandleError(options, config, err);
1788
+ reject(err);
1789
+ }
1790
+ });
1791
+ }
1792
+
1793
+
1794
+
1795
+ /**
1796
+ * Get summary of person and recent activity.
1797
+ * @param request - PersonId, Limit
1798
+ * @returns Summary of person, with recent requests, sales, follow-ups, chats.
1799
+ */
1800
+ public async getPersonSummaryAsync(request: carriers.Person_GetPersonSummaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary >;
1801
+
1802
+ /**
1803
+ * Get summary of person and recent activity.
1804
+ * @param personId - The person id to summarize.
1805
+ * @param limit - Max number of items to include in summary lists.
1806
+ * @returns Summary of person, with recent requests, sales, follow-ups, chats.
1807
+ */
1808
+ public async getPersonSummaryAsync(personId: number, limit: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary >;
1809
+
1810
+ public async getPersonSummaryAsync(personId:number|carriers.Person_GetPersonSummaryRequest, limit?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonSummary > {
1811
+ let _request : carriers.Person_GetPersonSummaryRequest = null;
1812
+ let _options : base.WebApiRequestOptions = null;
1813
+ const first : any = personId;
1814
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.limit)!='undefined' ) )
1815
+ {
1816
+ _request = personId as carriers.Person_GetPersonSummaryRequest;
1817
+ _options = limit as base.WebApiRequestOptions;
1818
+ }
1819
+ else
1820
+ {
1821
+ _request = {
1822
+ personId: personId as number,
1823
+ limit: limit as number,
1824
+ };
1825
+ _options = webapi_options;
1826
+ }
1827
+ return this._getPersonSummaryAsync( _request, _options );
1828
+ }
1829
+
1830
+
1831
+ private async _addBounceAsync(request: carriers.Person_AddBounceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1832
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1833
+ base.WebApiBase.SetPending(options);
1834
+ return new Promise< void >(async (resolve, reject) => {
1835
+ try {
1836
+ config.baseURL = this._options.baseUrl;
1837
+ const response = await this._axios.post("AddBounce", request , config);
1838
+ base.WebApiBase.SetCompleted(options);
1839
+ const res = response.data;
1840
+ resolve(res);
1841
+ }
1842
+ catch( err ) {
1843
+ base.WebApiBase.HandleError(options, config, err);
1844
+ reject(err);
1845
+ }
1846
+ });
1847
+ }
1848
+
1849
+
1850
+
1851
+ /**
1852
+ * Add a bounce count on the email address if it exists
1853
+ * @param request - EmailAddress
1854
+ * @returns
1855
+ */
1856
+ public async addBounceAsync(request: carriers.Person_AddBounceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1857
+
1858
+ /**
1859
+ * Add a bounce count on the email address if it exists
1860
+ * @param emailAddress - The email address which we want to add a bounce count to
1861
+ * @returns
1862
+ */
1863
+ public async addBounceAsync(emailAddress: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1864
+
1865
+ public async addBounceAsync(emailAddress:string|carriers.Person_AddBounceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1866
+ let _request : carriers.Person_AddBounceRequest = null;
1867
+ let _options : base.WebApiRequestOptions = null;
1868
+ const first : any = emailAddress;
1869
+ if( typeof( first ) === "object" && first && ( typeof(first.emailAddress)!='undefined' ) )
1870
+ {
1871
+ _request = emailAddress as carriers.Person_AddBounceRequest;
1872
+ _options = webapi_options as base.WebApiRequestOptions;
1873
+ }
1874
+ else
1875
+ {
1876
+ _request = {
1877
+ emailAddress: emailAddress as string,
1878
+ };
1879
+ _options = webapi_options;
1880
+ }
1881
+ return this._addBounceAsync( _request, _options );
1882
+ }
1883
+
1884
+
1885
+ private async _validatePersonEntityAsync(request: carriers.Person_ValidatePersonEntityRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1886
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1887
+ base.WebApiBase.SetPending(options);
1888
+ return new Promise< carriers.StringDictionary >(async (resolve, reject) => {
1889
+ try {
1890
+ config.baseURL = this._options.baseUrl;
1891
+ const response = await this._axios.post("ValidatePersonEntity", request , config);
1892
+ base.WebApiBase.SetCompleted(options);
1893
+ const res : carriers.StringDictionary = converters.Create_StringDictionary_From( response.data );
1894
+ resolve(res);
1895
+ }
1896
+ catch( err ) {
1897
+ base.WebApiBase.HandleError(options, config, err);
1898
+ reject(err);
1899
+ }
1900
+ });
1901
+ }
1902
+
1903
+
1904
+
1905
+ /**
1906
+ * Check that entity is ready for saving, return error messages by field.
1907
+ * @param request - PersonEntity
1908
+ * @returns Error messages tagged by field.
1909
+ */
1910
+ public async validatePersonEntityAsync(request: carriers.Person_ValidatePersonEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1911
+
1912
+ /**
1913
+ * Check that entity is ready for saving, return error messages by field.
1914
+ * @param personEntity - Entity to be checked for errors.
1915
+ * @returns Error messages tagged by field.
1916
+ */
1917
+ public async validatePersonEntityAsync(personEntity: carriers.PersonEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
1918
+
1919
+ public async validatePersonEntityAsync(personEntity:carriers.PersonEntity|carriers.Person_ValidatePersonEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary > {
1920
+ let _request : carriers.Person_ValidatePersonEntityRequest = null;
1921
+ let _options : base.WebApiRequestOptions = null;
1922
+ const first : any = personEntity;
1923
+ if( typeof( first ) === "object" && first && ( typeof(first.personEntity)!='undefined' ) )
1924
+ {
1925
+ _request = personEntity as carriers.Person_ValidatePersonEntityRequest;
1926
+ _options = webapi_options as base.WebApiRequestOptions;
1927
+ }
1928
+ else
1929
+ {
1930
+ _request = {
1931
+ personEntity: personEntity as carriers.PersonEntity,
1932
+ };
1933
+ _options = webapi_options;
1934
+ }
1935
+ return this._validatePersonEntityAsync( _request, _options );
1936
+ }
1937
+
1938
+
1939
+ private async _addBounceWithCountAsync(request: carriers.Person_AddBounceWithCountRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1940
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1941
+ base.WebApiBase.SetPending(options);
1942
+ return new Promise< void >(async (resolve, reject) => {
1943
+ try {
1944
+ config.baseURL = this._options.baseUrl;
1945
+ const response = await this._axios.post("AddBounceWithCount", request , config);
1946
+ base.WebApiBase.SetCompleted(options);
1947
+ const res = response.data;
1948
+ resolve(res);
1949
+ }
1950
+ catch( err ) {
1951
+ base.WebApiBase.HandleError(options, config, err);
1952
+ reject(err);
1953
+ }
1954
+ });
1955
+ }
1956
+
1957
+
1958
+
1959
+ /**
1960
+ * Add a number of bounce counts on the email address if it exists
1961
+ * @param request - EmailAddress, Counts
1962
+ * @returns
1963
+ */
1964
+ public async addBounceWithCountAsync(request: carriers.Person_AddBounceWithCountRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1965
+
1966
+ /**
1967
+ * Add a number of bounce counts on the email address if it exists
1968
+ * @param emailAddress - The email address which we want to add bounce counts to
1969
+ * @param counts - The number of bounce counts to add
1970
+ * @returns
1971
+ */
1972
+ public async addBounceWithCountAsync(emailAddress: string, counts: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1973
+
1974
+ public async addBounceWithCountAsync(emailAddress:string|carriers.Person_AddBounceWithCountRequest, counts?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1975
+ let _request : carriers.Person_AddBounceWithCountRequest = null;
1976
+ let _options : base.WebApiRequestOptions = null;
1977
+ const first : any = emailAddress;
1978
+ if( typeof( first ) === "object" && first && ( typeof(first.emailAddress)!='undefined' || typeof(first.counts)!='undefined' ) )
1979
+ {
1980
+ _request = emailAddress as carriers.Person_AddBounceWithCountRequest;
1981
+ _options = counts as base.WebApiRequestOptions;
1982
+ }
1983
+ else
1984
+ {
1985
+ _request = {
1986
+ emailAddress: emailAddress as string,
1987
+ counts: counts as number,
1988
+ };
1989
+ _options = webapi_options;
1990
+ }
1991
+ return this._addBounceWithCountAsync( _request, _options );
1992
+ }
1993
+
1994
+
1995
+ private async _getBestSoLanguageForTemplateAsync(request: carriers.Person_GetBestSoLanguageForTemplateRequest, options?:base.WebApiRequestOptions) : Promise< string > {
1996
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1997
+ base.WebApiBase.SetPending(options);
1998
+ return new Promise< string >(async (resolve, reject) => {
1999
+ try {
2000
+ config.baseURL = this._options.baseUrl;
2001
+ const response = await this._axios.post("GetBestSoLanguageForTemplate", request , config);
2002
+ base.WebApiBase.SetCompleted(options);
2003
+ const res : string = response.data as string;
2004
+ resolve(res);
2005
+ }
2006
+ catch( err ) {
2007
+ base.WebApiBase.HandleError(options, config, err);
2008
+ reject(err);
2009
+ }
2010
+ });
2011
+ }
2012
+
2013
+
2014
+
2015
+ /**
2016
+ * Get the best language for this person on this template
2017
+ * @param request - PersonId, TemplateId
2018
+ * @returns The solang code for best language, empty string if no best language found
2019
+ */
2020
+ public async getBestSoLanguageForTemplateAsync(request: carriers.Person_GetBestSoLanguageForTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
2021
+
2022
+ /**
2023
+ * Get the best language for this person on this template
2024
+ * @param personId - The id of the person
2025
+ * @param templateId - The id of the template to find languages on
2026
+ * @returns The solang code for best language, empty string if no best language found
2027
+ */
2028
+ public async getBestSoLanguageForTemplateAsync(personId: number, templateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
2029
+
2030
+ public async getBestSoLanguageForTemplateAsync(personId:number|carriers.Person_GetBestSoLanguageForTemplateRequest, templateId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
2031
+ let _request : carriers.Person_GetBestSoLanguageForTemplateRequest = null;
2032
+ let _options : base.WebApiRequestOptions = null;
2033
+ const first : any = personId;
2034
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.templateId)!='undefined' ) )
2035
+ {
2036
+ _request = personId as carriers.Person_GetBestSoLanguageForTemplateRequest;
2037
+ _options = templateId as base.WebApiRequestOptions;
2038
+ }
2039
+ else
2040
+ {
2041
+ _request = {
2042
+ personId: personId as number,
2043
+ templateId: templateId as number,
2044
+ };
2045
+ _options = webapi_options;
2046
+ }
2047
+ return this._getBestSoLanguageForTemplateAsync( _request, _options );
2048
+ }
2049
+
2050
+
2051
+ private async _addBounceWithDetailsAsync(request: carriers.Person_AddBounceWithDetailsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
2052
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2053
+ base.WebApiBase.SetPending(options);
2054
+ return new Promise< void >(async (resolve, reject) => {
2055
+ try {
2056
+ config.baseURL = this._options.baseUrl;
2057
+ const response = await this._axios.post("AddBounceWithDetails", request , config);
2058
+ base.WebApiBase.SetCompleted(options);
2059
+ const res = response.data;
2060
+ resolve(res);
2061
+ }
2062
+ catch( err ) {
2063
+ base.WebApiBase.HandleError(options, config, err);
2064
+ reject(err);
2065
+ }
2066
+ });
2067
+ }
2068
+
2069
+
2070
+
2071
+ /**
2072
+ * Add a number of bounce counts on the email address if it exists, and with possible bounce code and reason
2073
+ * @param request - EmailAddress, Counts, Code, Reason
2074
+ * @returns
2075
+ */
2076
+ public async addBounceWithDetailsAsync(request: carriers.Person_AddBounceWithDetailsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2077
+
2078
+ /**
2079
+ * Add a number of bounce counts on the email address if it exists, and with possible bounce code and reason
2080
+ * @param emailAddress - The email address which we want to add bounce counts to
2081
+ * @param counts - The number of bounce counts to add
2082
+ * @param code - A numeric code representing the bounce reason
2083
+ * @param reason - A textual tag representing the bounce reason
2084
+ * @returns
2085
+ */
2086
+ public async addBounceWithDetailsAsync(emailAddress: string, counts: number, code: number, reason: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2087
+
2088
+ public async addBounceWithDetailsAsync(emailAddress:string|carriers.Person_AddBounceWithDetailsRequest, counts?:number|base.WebApiRequestOptions, code?:number, reason?:string, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
2089
+ let _request : carriers.Person_AddBounceWithDetailsRequest = null;
2090
+ let _options : base.WebApiRequestOptions = null;
2091
+ const first : any = emailAddress;
2092
+ if( typeof( first ) === "object" && first && ( typeof(first.emailAddress)!='undefined' || typeof(first.counts)!='undefined' || typeof(first.code)!='undefined' || typeof(first.reason)!='undefined' ) )
2093
+ {
2094
+ _request = emailAddress as carriers.Person_AddBounceWithDetailsRequest;
2095
+ _options = counts as base.WebApiRequestOptions;
2096
+ }
2097
+ else
2098
+ {
2099
+ _request = {
2100
+ emailAddress: emailAddress as string,
2101
+ counts: counts as number,
2102
+ code: code as number,
2103
+ reason: reason as string,
2104
+ };
2105
+ _options = webapi_options;
2106
+ }
2107
+ return this._addBounceWithDetailsAsync( _request, _options );
2108
+ }
2109
+
2110
+
2111
+ private async _getPersonImagesAsync(request: carriers.Person_GetPersonImagesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] > {
2112
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2113
+ base.WebApiBase.SetPending(options);
2114
+ return new Promise< carriers.PersonImage[] >(async (resolve, reject) => {
2115
+ try {
2116
+ config.baseURL = this._options.baseUrl;
2117
+ const response = await this._axios.post("GetPersonImages", request , config);
2118
+ base.WebApiBase.SetCompleted(options);
2119
+ const res : carriers.PersonImage[] = converters.Create_PersonImageArray_From( response.data );
2120
+ resolve(res);
2121
+ }
2122
+ catch( err ) {
2123
+ base.WebApiBase.HandleError(options, config, err);
2124
+ reject(err);
2125
+ }
2126
+ });
2127
+ }
2128
+
2129
+
2130
+
2131
+ /**
2132
+ * Get the image for a set of persons scaled to a specific size. Returned images are in PNG format.
2133
+ * @param request - PersonIds, ScaledWidth, ScaledHeight
2134
+ * @returns List of person images. Persons without an image are not present in this list.
2135
+ */
2136
+ public async getPersonImagesAsync(request: carriers.Person_GetPersonImagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] >;
2137
+
2138
+ /**
2139
+ * Get the image for a set of persons scaled to a specific size. Returned images are in PNG format.
2140
+ * @param personIds - List of persons to get images for.
2141
+ * @param scaledWidth - Returned images are scaled to this width
2142
+ * @param scaledHeight - Returned images are scaled to this height
2143
+ * @returns List of person images. Persons without an image are not present in this list.
2144
+ */
2145
+ public async getPersonImagesAsync(personIds: number[], scaledWidth: number, scaledHeight: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] >;
2146
+
2147
+ public async getPersonImagesAsync(personIds:number[]|carriers.Person_GetPersonImagesRequest, scaledWidth?:number|base.WebApiRequestOptions, scaledHeight?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PersonImage[] > {
2148
+ let _request : carriers.Person_GetPersonImagesRequest = null;
2149
+ let _options : base.WebApiRequestOptions = null;
2150
+ const first : any = personIds;
2151
+ if( typeof( first ) === "object" && first && ( typeof(first.personIds)!='undefined' || typeof(first.scaledWidth)!='undefined' || typeof(first.scaledHeight)!='undefined' ) )
2152
+ {
2153
+ _request = personIds as carriers.Person_GetPersonImagesRequest;
2154
+ _options = scaledWidth as base.WebApiRequestOptions;
2155
+ }
2156
+ else
2157
+ {
2158
+ _request = {
2159
+ personIds: personIds as number[],
2160
+ scaledWidth: scaledWidth as number,
2161
+ scaledHeight: scaledHeight as number,
2162
+ };
2163
+ _options = webapi_options;
2164
+ }
2165
+ return this._getPersonImagesAsync( _request, _options );
2166
+ }
2167
+
2168
+
2169
+ private async _createOrUpdateUserCandidateAsync(request: carriers.Person_CreateOrUpdateUserCandidateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate > {
2170
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2171
+ base.WebApiBase.SetPending(options);
2172
+ return new Promise< carriers.UserCandidate >(async (resolve, reject) => {
2173
+ try {
2174
+ config.baseURL = this._options.baseUrl;
2175
+ const response = await this._axios.post("CreateOrUpdateUserCandidate", request , config);
2176
+ base.WebApiBase.SetCompleted(options);
2177
+ const res : carriers.UserCandidate = converters.Create_UserCandidate_From( response.data );
2178
+ resolve(res);
2179
+ }
2180
+ catch( err ) {
2181
+ base.WebApiBase.HandleError(options, config, err);
2182
+ reject(err);
2183
+ }
2184
+ });
2185
+ }
2186
+
2187
+
2188
+
2189
+ /**
2190
+ * Creates a Customer Centre User (UserCandidate) for a given Contact (personId) with the supplied parameters. If the Customer Centre User already exists for a given Contact, the user is updated with the supplied parameters.
2191
+ * @param request - PersonId, Username, AccessAllRequests
2192
+ * @returns UserCandidate created or updated.
2193
+ */
2194
+ public async createOrUpdateUserCandidateAsync(request: carriers.Person_CreateOrUpdateUserCandidateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
2195
+
2196
+ /**
2197
+ * Creates a Customer Centre User (UserCandidate) for a given Contact (personId) with the supplied parameters. If the Customer Centre User already exists for a given Contact, the user is updated with the supplied parameters.
2198
+ * @param personId - Person to create UserCandidate for.
2199
+ * @param username - Desired username. Username must be unique. If the username is not unique, method will throw an error.
2200
+ * @param accessAllRequests - Determines if Custom Center User has access to all requests created for all Contacts in the company.
2201
+ * @returns UserCandidate created or updated.
2202
+ */
2203
+ public async createOrUpdateUserCandidateAsync(personId: number, username: string, accessAllRequests: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
2204
+
2205
+ public async createOrUpdateUserCandidateAsync(personId:number|carriers.Person_CreateOrUpdateUserCandidateRequest, username?:string|base.WebApiRequestOptions, accessAllRequests?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate > {
2206
+ let _request : carriers.Person_CreateOrUpdateUserCandidateRequest = null;
2207
+ let _options : base.WebApiRequestOptions = null;
2208
+ const first : any = personId;
2209
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.username)!='undefined' || typeof(first.accessAllRequests)!='undefined' ) )
2210
+ {
2211
+ _request = personId as carriers.Person_CreateOrUpdateUserCandidateRequest;
2212
+ _options = username as base.WebApiRequestOptions;
2213
+ }
2214
+ else
2215
+ {
2216
+ _request = {
2217
+ personId: personId as number,
2218
+ username: username as string,
2219
+ accessAllRequests: accessAllRequests as boolean,
2220
+ };
2221
+ _options = webapi_options;
2222
+ }
2223
+ return this._createOrUpdateUserCandidateAsync( _request, _options );
2224
+ }
2225
+
2226
+
2227
+ private async _getUserCandidateByPersonAsync(request: carriers.Person_GetUserCandidateByPersonRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate > {
2228
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2229
+ base.WebApiBase.SetPending(options);
2230
+ return new Promise< carriers.UserCandidate >(async (resolve, reject) => {
2231
+ try {
2232
+ config.baseURL = this._options.baseUrl;
2233
+ const response = await this._axios.post("GetUserCandidateByPerson", request , config);
2234
+ base.WebApiBase.SetCompleted(options);
2235
+ const res : carriers.UserCandidate = converters.Create_UserCandidate_From( response.data );
2236
+ resolve(res);
2237
+ }
2238
+ catch( err ) {
2239
+ base.WebApiBase.HandleError(options, config, err);
2240
+ reject(err);
2241
+ }
2242
+ });
2243
+ }
2244
+
2245
+
2246
+
2247
+ /**
2248
+ * Gets user candidate linked to a person.
2249
+ * @param request - PersonId
2250
+ * @returns UserCandidate linked to a person.
2251
+ */
2252
+ public async getUserCandidateByPersonAsync(request: carriers.Person_GetUserCandidateByPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
2253
+
2254
+ /**
2255
+ * Gets user candidate linked to a person.
2256
+ * @param personId - Person related to requested UserCandidate.
2257
+ * @returns UserCandidate linked to a person.
2258
+ */
2259
+ public async getUserCandidateByPersonAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate >;
2260
+
2261
+ public async getUserCandidateByPersonAsync(personId:number|carriers.Person_GetUserCandidateByPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserCandidate > {
2262
+ let _request : carriers.Person_GetUserCandidateByPersonRequest = null;
2263
+ let _options : base.WebApiRequestOptions = null;
2264
+ const first : any = personId;
2265
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
2266
+ {
2267
+ _request = personId as carriers.Person_GetUserCandidateByPersonRequest;
2268
+ _options = webapi_options as base.WebApiRequestOptions;
2269
+ }
2270
+ else
2271
+ {
2272
+ _request = {
2273
+ personId: personId as number,
2274
+ };
2275
+ _options = webapi_options;
2276
+ }
2277
+ return this._getUserCandidateByPersonAsync( _request, _options );
2278
+ }
2279
+
2280
+
2281
+ private async _getCustomerCentrePasswordReplyTemplateAsync(request: carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
2282
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2283
+ base.WebApiBase.SetPending(options);
2284
+ return new Promise< carriers.ReplyTemplateParsed >(async (resolve, reject) => {
2285
+ try {
2286
+ config.baseURL = this._options.baseUrl;
2287
+ const response = await this._axios.post("GetCustomerCentrePasswordReplyTemplate", request , config);
2288
+ base.WebApiBase.SetCompleted(options);
2289
+ const res : carriers.ReplyTemplateParsed = converters.Create_ReplyTemplateParsed_From( response.data );
2290
+ resolve(res);
2291
+ }
2292
+ catch( err ) {
2293
+ base.WebApiBase.HandleError(options, config, err);
2294
+ reject(err);
2295
+ }
2296
+ });
2297
+ }
2298
+
2299
+
2300
+
2301
+ /**
2302
+ * Gets a parsed Customer Centre password reply template for a particular customer
2303
+ * @param request - PersonId
2304
+ * @returns A parsed Customer Centre password reply template.
2305
+ */
2306
+ public async getCustomerCentrePasswordReplyTemplateAsync(request: carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
2307
+
2308
+ /**
2309
+ * Gets a parsed Customer Centre password reply template for a particular customer
2310
+ * @param personId - Person/customer id to get the template for.
2311
+ * @returns A parsed Customer Centre password reply template.
2312
+ */
2313
+ public async getCustomerCentrePasswordReplyTemplateAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
2314
+
2315
+ public async getCustomerCentrePasswordReplyTemplateAsync(personId:number|carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
2316
+ let _request : carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest = null;
2317
+ let _options : base.WebApiRequestOptions = null;
2318
+ const first : any = personId;
2319
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
2320
+ {
2321
+ _request = personId as carriers.Person_GetCustomerCentrePasswordReplyTemplateRequest;
2322
+ _options = webapi_options as base.WebApiRequestOptions;
2323
+ }
2324
+ else
2325
+ {
2326
+ _request = {
2327
+ personId: personId as number,
2328
+ };
2329
+ _options = webapi_options;
2330
+ }
2331
+ return this._getCustomerCentrePasswordReplyTemplateAsync( _request, _options );
2332
+ }
2333
+
2334
+
2335
+ private async _sendEmailAsync(request: carriers.Person_SendEmailRequest, options?:base.WebApiRequestOptions) : Promise< void > {
2336
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2337
+ base.WebApiBase.SetPending(options);
2338
+ return new Promise< void >(async (resolve, reject) => {
2339
+ try {
2340
+ config.baseURL = this._options.baseUrl;
2341
+ const response = await this._axios.post("SendEmail", request , config);
2342
+ base.WebApiBase.SetCompleted(options);
2343
+ const res = response.data;
2344
+ resolve(res);
2345
+ }
2346
+ catch( err ) {
2347
+ base.WebApiBase.HandleError(options, config, err);
2348
+ reject(err);
2349
+ }
2350
+ });
2351
+ }
2352
+
2353
+
2354
+
2355
+ /**
2356
+ * Inserts into outbox an email with specified details.
2357
+ * @param request - From, To, Subject, PlainBody, HtmlBody, AttachmentIds
2358
+ * @returns This method has no return value
2359
+ */
2360
+ public async sendEmailAsync(request: carriers.Person_SendEmailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2361
+
2362
+ /**
2363
+ * Inserts into outbox an email with specified details.
2364
+ * @param from - Sender's email address.
2365
+ * @param to - Recipient's email address.
2366
+ * @param subject - Email's subject.
2367
+ * @param plainBody - Email's plain body.
2368
+ * @param htmlBody - Email's html body.
2369
+ * @param attachmentIds - Ids of email's attachments.
2370
+ * @returns This method has no return value
2371
+ */
2372
+ public async sendEmailAsync(from: string, to: string, subject: string, plainBody: string, htmlBody: string, attachmentIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2373
+
2374
+ public async sendEmailAsync(from:string|carriers.Person_SendEmailRequest, to?:string|base.WebApiRequestOptions, subject?:string, plainBody?:string, htmlBody?:string, attachmentIds?:number[], webapi_options?:base.WebApiRequestOptions) : Promise< void > {
2375
+ let _request : carriers.Person_SendEmailRequest = null;
2376
+ let _options : base.WebApiRequestOptions = null;
2377
+ const first : any = from;
2378
+ if( typeof( first ) === "object" && first && ( typeof(first.from)!='undefined' || typeof(first.to)!='undefined' || typeof(first.subject)!='undefined' || typeof(first.plainBody)!='undefined' || typeof(first.htmlBody)!='undefined' || typeof(first.attachmentIds)!='undefined' ) )
2379
+ {
2380
+ _request = from as carriers.Person_SendEmailRequest;
2381
+ _options = to as base.WebApiRequestOptions;
2382
+ }
2383
+ else
2384
+ {
2385
+ _request = {
2386
+ from: from as string,
2387
+ to: to as string,
2388
+ subject: subject as string,
2389
+ plainBody: plainBody as string,
2390
+ htmlBody: htmlBody as string,
2391
+ attachmentIds: attachmentIds as number[],
2392
+ };
2393
+ _options = webapi_options;
2394
+ }
2395
+ return this._sendEmailAsync( _request, _options );
2396
+ }
2397
+
2398
+ /*
2399
+ * Gets an array of Person objects.
2400
+ * @param personIds - The primary keys.
2401
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
2402
+ * @returns An array of Person
2403
+ */
2404
+ public async getPersonListAsync(personIds: number[], options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2405
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2406
+ base.WebApiBase.SetPending(options);
2407
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2408
+ try {
2409
+ const response = await this._axios.post("GetPersonList", personIds, config);
2410
+ base.WebApiBase.SetCompleted(options);
2411
+ const res = converters.Create_PersonArray_From( response.data );
2412
+ resolve(res);
2413
+ }
2414
+ catch( err ) {
2415
+ base.WebApiBase.HandleError(options, config, err);
2416
+ reject(err);
2417
+ }
2418
+ });
2419
+ }
2420
+
2421
+
2422
+ private async _getPersonsFromContactAsync(request: carriers.Person_GetPersonsFromContactRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2423
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2424
+ base.WebApiBase.SetPending(options);
2425
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2426
+ try {
2427
+ config.baseURL = this._options.baseUrl;
2428
+ const response = await this._axios.post("GetPersonsFromContact", request , config);
2429
+ base.WebApiBase.SetCompleted(options);
2430
+ const res : carriers.Person[] = converters.Create_PersonArray_From( response.data );
2431
+ resolve(res);
2432
+ }
2433
+ catch( err ) {
2434
+ base.WebApiBase.HandleError(options, config, err);
2435
+ reject(err);
2436
+ }
2437
+ });
2438
+ }
2439
+
2440
+
2441
+
2442
+ /**
2443
+ * Returns all the persons belonging to a contact.
2444
+ * @param request - ContactId
2445
+ * @returns The persons belonging to a contact.
2446
+ */
2447
+ public async getPersonsFromContactAsync(request: carriers.Person_GetPersonsFromContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2448
+
2449
+ /**
2450
+ * Returns all the persons belonging to a contact.
2451
+ * @param contactId - The project id
2452
+ * @returns The persons belonging to a contact.
2453
+ */
2454
+ public async getPersonsFromContactAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2455
+
2456
+ public async getPersonsFromContactAsync(contactId:number|carriers.Person_GetPersonsFromContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2457
+ let _request : carriers.Person_GetPersonsFromContactRequest = null;
2458
+ let _options : base.WebApiRequestOptions = null;
2459
+ const first : any = contactId;
2460
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' ) )
2461
+ {
2462
+ _request = contactId as carriers.Person_GetPersonsFromContactRequest;
2463
+ _options = webapi_options as base.WebApiRequestOptions;
2464
+ }
2465
+ else
2466
+ {
2467
+ _request = {
2468
+ contactId: contactId as number,
2469
+ };
2470
+ _options = webapi_options;
2471
+ }
2472
+ return this._getPersonsFromContactAsync( _request, _options );
2473
+ }
2474
+
2475
+
2476
+ private async _getPersonsFromProjectAsync(request: carriers.Person_GetPersonsFromProjectRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2477
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2478
+ base.WebApiBase.SetPending(options);
2479
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2480
+ try {
2481
+ config.baseURL = this._options.baseUrl;
2482
+ const response = await this._axios.post("GetPersonsFromProject", request , config);
2483
+ base.WebApiBase.SetCompleted(options);
2484
+ const res : carriers.Person[] = converters.Create_PersonArray_From( response.data );
2485
+ resolve(res);
2486
+ }
2487
+ catch( err ) {
2488
+ base.WebApiBase.HandleError(options, config, err);
2489
+ reject(err);
2490
+ }
2491
+ });
2492
+ }
2493
+
2494
+
2495
+
2496
+ /**
2497
+ * Returns all the persons belonging to a project.
2498
+ * @param request - ProjectId
2499
+ * @returns The persons belonging to a project.
2500
+ */
2501
+ public async getPersonsFromProjectAsync(request: carriers.Person_GetPersonsFromProjectRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2502
+
2503
+ /**
2504
+ * Returns all the persons belonging to a project.
2505
+ * @param projectId - The project id
2506
+ * @returns The persons belonging to a project.
2507
+ */
2508
+ public async getPersonsFromProjectAsync(projectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2509
+
2510
+ public async getPersonsFromProjectAsync(projectId:number|carriers.Person_GetPersonsFromProjectRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2511
+ let _request : carriers.Person_GetPersonsFromProjectRequest = null;
2512
+ let _options : base.WebApiRequestOptions = null;
2513
+ const first : any = projectId;
2514
+ if( typeof( first ) === "object" && first && ( typeof(first.projectId)!='undefined' ) )
2515
+ {
2516
+ _request = projectId as carriers.Person_GetPersonsFromProjectRequest;
2517
+ _options = webapi_options as base.WebApiRequestOptions;
2518
+ }
2519
+ else
2520
+ {
2521
+ _request = {
2522
+ projectId: projectId as number,
2523
+ };
2524
+ _options = webapi_options;
2525
+ }
2526
+ return this._getPersonsFromProjectAsync( _request, _options );
2527
+ }
2528
+
2529
+
2530
+ private async _getColleaguesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2531
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2532
+ base.WebApiBase.SetPending(options);
2533
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2534
+ try {
2535
+ config.baseURL = this._options.baseUrl;
2536
+ const response = await this._axios.post("GetColleagues", undefined , config);
2537
+ base.WebApiBase.SetCompleted(options);
2538
+ const res : carriers.Person[] = converters.Create_PersonArray_From( response.data );
2539
+ resolve(res);
2540
+ }
2541
+ catch( err ) {
2542
+ base.WebApiBase.HandleError(options, config, err);
2543
+ reject(err);
2544
+ }
2545
+ });
2546
+ }
2547
+
2548
+
2549
+ /**
2550
+ * Gets the persons working in the same company as the logged on user.
2551
+ * @returns Colleagues.
2552
+ */
2553
+ public async getColleaguesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >
2554
+ {
2555
+ return this._getColleaguesAsync(webapi_options);
2556
+ }
2557
+
2558
+
2559
+ private async _getColleaguesByDepartmentAsync(request: carriers.Person_GetColleaguesByDepartmentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2560
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2561
+ base.WebApiBase.SetPending(options);
2562
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2563
+ try {
2564
+ config.baseURL = this._options.baseUrl;
2565
+ const response = await this._axios.post("GetColleaguesByDepartment", request , config);
2566
+ base.WebApiBase.SetCompleted(options);
2567
+ const res : carriers.Person[] = converters.Create_PersonArray_From( response.data );
2568
+ resolve(res);
2569
+ }
2570
+ catch( err ) {
2571
+ base.WebApiBase.HandleError(options, config, err);
2572
+ reject(err);
2573
+ }
2574
+ });
2575
+ }
2576
+
2577
+
2578
+
2579
+ /**
2580
+ * Gets the persons working in a specific department in the same company as the logged on user. Departments can be retrieved with the PhoneList.DepartmentList service.
2581
+ * @param request - DepartmentId
2582
+ * @returns PersonList with colleagues.
2583
+ */
2584
+ public async getColleaguesByDepartmentAsync(request: carriers.Person_GetColleaguesByDepartmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2585
+
2586
+ /**
2587
+ * Gets the persons working in a specific department in the same company as the logged on user. Departments can be retrieved with the PhoneList.DepartmentList service.
2588
+ * @param departmentId - The department id.
2589
+ * @returns PersonList with colleagues.
2590
+ */
2591
+ public async getColleaguesByDepartmentAsync(departmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2592
+
2593
+ public async getColleaguesByDepartmentAsync(departmentId:number|carriers.Person_GetColleaguesByDepartmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2594
+ let _request : carriers.Person_GetColleaguesByDepartmentRequest = null;
2595
+ let _options : base.WebApiRequestOptions = null;
2596
+ const first : any = departmentId;
2597
+ if( typeof( first ) === "object" && first && ( typeof(first.departmentId)!='undefined' ) )
2598
+ {
2599
+ _request = departmentId as carriers.Person_GetColleaguesByDepartmentRequest;
2600
+ _options = webapi_options as base.WebApiRequestOptions;
2601
+ }
2602
+ else
2603
+ {
2604
+ _request = {
2605
+ departmentId: departmentId as number,
2606
+ };
2607
+ _options = webapi_options;
2608
+ }
2609
+ return this._getColleaguesByDepartmentAsync( _request, _options );
2610
+ }
2611
+
2612
+
2613
+ private async _getColleaguesBySourceAsync(request: carriers.Person_GetColleaguesBySourceRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2614
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2615
+ base.WebApiBase.SetPending(options);
2616
+ return new Promise< carriers.Person[] >(async (resolve, reject) => {
2617
+ try {
2618
+ config.baseURL = this._options.baseUrl;
2619
+ const response = await this._axios.post("GetColleaguesBySource", request , config);
2620
+ base.WebApiBase.SetCompleted(options);
2621
+ const res : carriers.Person[] = converters.Create_PersonArray_From( response.data );
2622
+ resolve(res);
2623
+ }
2624
+ catch( err ) {
2625
+ base.WebApiBase.HandleError(options, config, err);
2626
+ reject(err);
2627
+ }
2628
+ });
2629
+ }
2630
+
2631
+
2632
+
2633
+ /**
2634
+ * Gets the persons working in the same company as the logged on user. The list of person could be retrieved from the history list, the diary view list, or from all sources.
2635
+ * @param request - SourceType, Count
2636
+ * @returns Colleagues.
2637
+ */
2638
+ public async getColleaguesBySourceAsync(request: carriers.Person_GetColleaguesBySourceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2639
+
2640
+ /**
2641
+ * Gets the persons working in the same company as the logged on user. The list of person could be retrieved from the history list, the diary view list, or from all sources.
2642
+ * @param sourceType - The “source” the colleagues should be retrieved from. <see cref="AssociateSourceType"/> for more information.
2643
+ * @param count -
2644
+ * @returns Colleagues.
2645
+ */
2646
+ public async getColleaguesBySourceAsync(sourceType: enums.AssociateSourceType, count: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] >;
2647
+
2648
+ public async getColleaguesBySourceAsync(sourceType:enums.AssociateSourceType|carriers.Person_GetColleaguesBySourceRequest, count?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person[] > {
2649
+ let _request : carriers.Person_GetColleaguesBySourceRequest = null;
2650
+ let _options : base.WebApiRequestOptions = null;
2651
+ const first : any = sourceType;
2652
+ if( typeof( first ) === "object" && first && ( typeof(first.sourceType)!='undefined' || typeof(first.count)!='undefined' ) )
2653
+ {
2654
+ _request = sourceType as carriers.Person_GetColleaguesBySourceRequest;
2655
+ _options = count as base.WebApiRequestOptions;
2656
+ }
2657
+ else
2658
+ {
2659
+ _request = {
2660
+ sourceType: sourceType as enums.AssociateSourceType,
2661
+ count: count as number,
2662
+ };
2663
+ _options = webapi_options;
2664
+ }
2665
+ return this._getColleaguesBySourceAsync( _request, _options );
2666
+ }
2667
+
2668
+
2669
+ private async _getMyOwnerAsync( options?:base.WebApiRequestOptions) : Promise< carriers.Person > {
2670
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2671
+ base.WebApiBase.SetPending(options);
2672
+ return new Promise< carriers.Person >(async (resolve, reject) => {
2673
+ try {
2674
+ config.baseURL = this._options.baseUrl;
2675
+ const response = await this._axios.post("GetMyOwner", undefined , config);
2676
+ base.WebApiBase.SetCompleted(options);
2677
+ const res : carriers.Person = converters.Create_Person_From( response.data );
2678
+ resolve(res);
2679
+ }
2680
+ catch( err ) {
2681
+ base.WebApiBase.HandleError(options, config, err);
2682
+ reject(err);
2683
+ }
2684
+ });
2685
+ }
2686
+
2687
+
2688
+ /**
2689
+ * Get the owner of the logged in person.
2690
+ * @returns Person
2691
+ */
2692
+ public async getMyOwnerAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >
2693
+ {
2694
+ return this._getMyOwnerAsync(webapi_options);
2695
+ }
2696
+
2697
+
2698
+ private async _getOwnerOnPersonIdAsync(request: carriers.Person_GetOwnerOnPersonIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Person > {
2699
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2700
+ base.WebApiBase.SetPending(options);
2701
+ return new Promise< carriers.Person >(async (resolve, reject) => {
2702
+ try {
2703
+ config.baseURL = this._options.baseUrl;
2704
+ const response = await this._axios.post("GetOwnerOnPersonId", request , config);
2705
+ base.WebApiBase.SetCompleted(options);
2706
+ const res : carriers.Person = converters.Create_Person_From( response.data );
2707
+ resolve(res);
2708
+ }
2709
+ catch( err ) {
2710
+ base.WebApiBase.HandleError(options, config, err);
2711
+ reject(err);
2712
+ }
2713
+ });
2714
+ }
2715
+
2716
+
2717
+
2718
+ /**
2719
+ * Get the owner of the person by id.
2720
+ * @param request - PersonId
2721
+ * @returns Person
2722
+ */
2723
+ public async getOwnerOnPersonIdAsync(request: carriers.Person_GetOwnerOnPersonIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >;
2724
+
2725
+ /**
2726
+ * Get the owner of the person by id.
2727
+ * @param personId -
2728
+ * @returns Person
2729
+ */
2730
+ public async getOwnerOnPersonIdAsync(personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person >;
2731
+
2732
+ public async getOwnerOnPersonIdAsync(personId:number|carriers.Person_GetOwnerOnPersonIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Person > {
2733
+ let _request : carriers.Person_GetOwnerOnPersonIdRequest = null;
2734
+ let _options : base.WebApiRequestOptions = null;
2735
+ const first : any = personId;
2736
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' ) )
2737
+ {
2738
+ _request = personId as carriers.Person_GetOwnerOnPersonIdRequest;
2739
+ _options = webapi_options as base.WebApiRequestOptions;
2740
+ }
2741
+ else
2742
+ {
2743
+ _request = {
2744
+ personId: personId as number,
2745
+ };
2746
+ _options = webapi_options;
2747
+ }
2748
+ return this._getOwnerOnPersonIdAsync( _request, _options );
2749
+ }
2750
+
2751
+
2752
+ private async _changePersonRankAsync(request: carriers.Person_ChangePersonRankRequest, options?:base.WebApiRequestOptions) : Promise< number > {
2753
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2754
+ base.WebApiBase.SetPending(options);
2755
+ return new Promise< number >(async (resolve, reject) => {
2756
+ try {
2757
+ config.baseURL = this._options.baseUrl;
2758
+ const response = await this._axios.post("ChangePersonRank", request , config);
2759
+ base.WebApiBase.SetCompleted(options);
2760
+ const res : number = response.data as number;
2761
+ resolve(res);
2762
+ }
2763
+ catch( err ) {
2764
+ base.WebApiBase.HandleError(options, config, err);
2765
+ reject(err);
2766
+ }
2767
+ });
2768
+ }
2769
+
2770
+
2771
+
2772
+ /**
2773
+ * Move one person up or down in the ranking in the Person Archive, if possible.&lt;para/&gt;The person record that has rank = 1 is the primary contact for a company, and is the one used in situations where no person has been explicitly chosen (such as in selections).&lt;para/&gt;This method corresponds to the move up/move down functions in the person archive in the contact panel.&lt;para/&gt;This method always affects two records.
2774
+ * @param request - PersonId, MoveUp
2775
+ * @returns If movement occurred, the return value will be the ID of the OTHER person that got moved. A GUI should switch the positions of the original person ID and this return value.<para/>If no movement occurred, for any reason, 0 is returned.
2776
+ */
2777
+ public async changePersonRankAsync(request: carriers.Person_ChangePersonRankRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
2778
+
2779
+ /**
2780
+ * Move one person up or down in the ranking in the Person Archive, if possible.&lt;para/&gt;The person record that has rank = 1 is the primary contact for a company, and is the one used in situations where no person has been explicitly chosen (such as in selections).&lt;para/&gt;This method corresponds to the move up/move down functions in the person archive in the contact panel.&lt;para/&gt;This method always affects two records.
2781
+ * @param personId - Primary key of person record to move up or down. You must have write access both to this record AND to whatever record is adjacent in the direction you want to move.
2782
+ * @param moveUp - If true, the given person is moved to an earlier rank (lower numeric rank value, down to a limit of 1; up in the GUI if sorted by ascending rank). If false, movement is to later priority (higher numeric rank value).
2783
+ * @returns If movement occurred, the return value will be the ID of the OTHER person that got moved. A GUI should switch the positions of the original person ID and this return value.<para/>If no movement occurred, for any reason, 0 is returned.
2784
+ */
2785
+ public async changePersonRankAsync(personId: number, moveUp: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
2786
+
2787
+ public async changePersonRankAsync(personId:number|carriers.Person_ChangePersonRankRequest, moveUp?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
2788
+ let _request : carriers.Person_ChangePersonRankRequest = null;
2789
+ let _options : base.WebApiRequestOptions = null;
2790
+ const first : any = personId;
2791
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.moveUp)!='undefined' ) )
2792
+ {
2793
+ _request = personId as carriers.Person_ChangePersonRankRequest;
2794
+ _options = moveUp as base.WebApiRequestOptions;
2795
+ }
2796
+ else
2797
+ {
2798
+ _request = {
2799
+ personId: personId as number,
2800
+ moveUp: moveUp as boolean,
2801
+ };
2802
+ _options = webapi_options;
2803
+ }
2804
+ return this._changePersonRankAsync( _request, _options );
2805
+ }
2806
+
2807
+
2808
+ private async _setPersonRankAsync(request: carriers.Person_SetPersonRankRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
2809
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2810
+ base.WebApiBase.SetPending(options);
2811
+ return new Promise< boolean >(async (resolve, reject) => {
2812
+ try {
2813
+ config.baseURL = this._options.baseUrl;
2814
+ const response = await this._axios.post("SetPersonRank", request , config);
2815
+ base.WebApiBase.SetCompleted(options);
2816
+ const res : boolean = response.data as boolean;
2817
+ resolve(res);
2818
+ }
2819
+ catch( err ) {
2820
+ base.WebApiBase.HandleError(options, config, err);
2821
+ reject(err);
2822
+ }
2823
+ });
2824
+ }
2825
+
2826
+
2827
+
2828
+ /**
2829
+ * Directly set the rank field of a person record, adjusting all other person records under the same contact as needed.&lt;para/&gt;This call may affect multiple records, potentially all person records belonging to one contact.&lt;para/&gt;You must have write access for to affected records for this method to succeed.
2830
+ * @param request - PersonId, DesiredRank
2831
+ * @returns If movement occurred, or the person already had exactly the desired rank value, then the return value will be true. If movement did not occur, for any other reason, the return value is false.
2832
+ */
2833
+ public async setPersonRankAsync(request: carriers.Person_SetPersonRankRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
2834
+
2835
+ /**
2836
+ * Directly set the rank field of a person record, adjusting all other person records under the same contact as needed.&lt;para/&gt;This call may affect multiple records, potentially all person records belonging to one contact.&lt;para/&gt;You must have write access for to affected records for this method to succeed.
2837
+ * @param personId - Id of person to change
2838
+ * @param desiredRank - Desired rank to set, legal values are from 1 to the number of person records on this contact. Out of range values will be moved to the closest valid value and processed.
2839
+ * @returns If movement occurred, or the person already had exactly the desired rank value, then the return value will be true. If movement did not occur, for any other reason, the return value is false.
2840
+ */
2841
+ public async setPersonRankAsync(personId: number, desiredRank: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
2842
+
2843
+ public async setPersonRankAsync(personId:number|carriers.Person_SetPersonRankRequest, desiredRank?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
2844
+ let _request : carriers.Person_SetPersonRankRequest = null;
2845
+ let _options : base.WebApiRequestOptions = null;
2846
+ const first : any = personId;
2847
+ if( typeof( first ) === "object" && first && ( typeof(first.personId)!='undefined' || typeof(first.desiredRank)!='undefined' ) )
2848
+ {
2849
+ _request = personId as carriers.Person_SetPersonRankRequest;
2850
+ _options = desiredRank as base.WebApiRequestOptions;
2851
+ }
2852
+ else
2853
+ {
2854
+ _request = {
2855
+ personId: personId as number,
2856
+ desiredRank: desiredRank as number,
2857
+ };
2858
+ _options = webapi_options;
2859
+ }
2860
+ return this._setPersonRankAsync( _request, _options );
2861
+ }
2862
+
2863
+
2864
+ private async _normalizeRanksAsync(request: carriers.Person_NormalizeRanksRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
2865
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2866
+ base.WebApiBase.SetPending(options);
2867
+ return new Promise< boolean >(async (resolve, reject) => {
2868
+ try {
2869
+ config.baseURL = this._options.baseUrl;
2870
+ const response = await this._axios.post("NormalizeRanks", request , config);
2871
+ base.WebApiBase.SetCompleted(options);
2872
+ const res : boolean = response.data as boolean;
2873
+ resolve(res);
2874
+ }
2875
+ catch( err ) {
2876
+ base.WebApiBase.HandleError(options, config, err);
2877
+ reject(err);
2878
+ }
2879
+ });
2880
+ }
2881
+
2882
+
2883
+
2884
+ /**
2885
+ * Nomralize the ranks for all persons that belong to a contact. This means that the persons will be sorted according to their current rank values, and the ranks will be made monotonically increasing from 1.
2886
+ * @param request - ContactId
2887
+ * @returns The reutrn value is true if the operation suceeded, either because all persons were already normalized, or because normalization was done. It is false if Sentry blocks any required changes.
2888
+ */
2889
+ public async normalizeRanksAsync(request: carriers.Person_NormalizeRanksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
2890
+
2891
+ /**
2892
+ * Nomralize the ranks for all persons that belong to a contact. This means that the persons will be sorted according to their current rank values, and the ranks will be made monotonically increasing from 1.
2893
+ * @param contactId - Id of contact whose persons are to be rank normalized
2894
+ * @returns The reutrn value is true if the operation suceeded, either because all persons were already normalized, or because normalization was done. It is false if Sentry blocks any required changes.
2895
+ */
2896
+ public async normalizeRanksAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
2897
+
2898
+ public async normalizeRanksAsync(contactId:number|carriers.Person_NormalizeRanksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
2899
+ let _request : carriers.Person_NormalizeRanksRequest = null;
2900
+ let _options : base.WebApiRequestOptions = null;
2901
+ const first : any = contactId;
2902
+ if( typeof( first ) === "object" && first && ( typeof(first.contactId)!='undefined' ) )
2903
+ {
2904
+ _request = contactId as carriers.Person_NormalizeRanksRequest;
2905
+ _options = webapi_options as base.WebApiRequestOptions;
2906
+ }
2907
+ else
2908
+ {
2909
+ _request = {
2910
+ contactId: contactId as number,
2911
+ };
2912
+ _options = webapi_options;
2913
+ }
2914
+ return this._normalizeRanksAsync( _request, _options );
2915
+ }
2916
+
2917
+ } // class v1PersonAgentController
2918
+
2919
+