pipedrive 24.2.0 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/esm/versions/v1/api/activities-api.d.ts +40 -40
  2. package/dist/esm/versions/v1/api/activities-api.js +40 -40
  3. package/dist/esm/versions/v1/api/deals-api.d.ts +413 -91
  4. package/dist/esm/versions/v1/api/deals-api.js +419 -90
  5. package/dist/esm/versions/v1/api/item-search-api.d.ts +8 -8
  6. package/dist/esm/versions/v1/api/item-search-api.js +8 -8
  7. package/dist/esm/versions/v1/api/leads-api.d.ts +100 -14
  8. package/dist/esm/versions/v1/api/leads-api.js +107 -14
  9. package/dist/esm/versions/v1/api/notes-api.d.ts +18 -2
  10. package/dist/esm/versions/v1/api/notes-api.js +15 -5
  11. package/dist/esm/versions/v1/api/organizations-api.d.ts +71 -71
  12. package/dist/esm/versions/v1/api/organizations-api.js +70 -70
  13. package/dist/esm/versions/v1/api/persons-api.d.ts +59 -59
  14. package/dist/esm/versions/v1/api/persons-api.js +58 -58
  15. package/dist/esm/versions/v1/api/pipelines-api.d.ts +28 -28
  16. package/dist/esm/versions/v1/api/pipelines-api.js +28 -28
  17. package/dist/esm/versions/v1/api/products-api.d.ts +24 -24
  18. package/dist/esm/versions/v1/api/products-api.js +24 -24
  19. package/dist/esm/versions/v1/api/stages-api.d.ts +36 -36
  20. package/dist/esm/versions/v1/api/stages-api.js +36 -36
  21. package/dist/esm/versions/v1/api/subscriptions-api.d.ts +36 -36
  22. package/dist/esm/versions/v1/api/subscriptions-api.js +36 -36
  23. package/dist/esm/versions/v1/api/webhooks-api.d.ts +4 -4
  24. package/dist/esm/versions/v1/api/webhooks-api.js +4 -4
  25. package/dist/esm/versions/v1/base.d.ts +2 -3
  26. package/dist/esm/versions/v1/configuration.d.ts +2 -2
  27. package/dist/esm/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  28. package/dist/esm/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  29. package/dist/esm/versions/v1/models/add-note-request-all-of1.js +4 -0
  30. package/dist/esm/versions/v1/models/add-webhook-request.d.ts +5 -6
  31. package/dist/esm/versions/v1/models/add-webhook-request.js +4 -5
  32. package/dist/esm/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  33. package/dist/esm/versions/v1/models/index.d.ts +1 -0
  34. package/dist/esm/versions/v1/models/index.js +1 -0
  35. package/dist/esm/versions/v1/models/note-project.d.ts +23 -0
  36. package/dist/esm/versions/v1/models/note-project.js +14 -0
  37. package/dist/esm/versions/v1/models/note-request-all-of1.d.ts +5 -0
  38. package/dist/esm/versions/v1/models/note.d.ts +16 -0
  39. package/dist/esm/versions/v1/models/user-access.d.ts +3 -2
  40. package/dist/esm/versions/v1/models/user-access.js +4 -3
  41. package/dist/esm/versions/v1/models/user-access1.d.ts +3 -2
  42. package/dist/esm/versions/v1/models/user-access1.js +4 -3
  43. package/dist/esm/versions/v2/api/activities-api.d.ts +15 -7
  44. package/dist/esm/versions/v2/api/activities-api.js +12 -7
  45. package/dist/esm/versions/v2/api/beta-api.d.ts +194 -2532
  46. package/dist/esm/versions/v2/api/beta-api.js +263 -2928
  47. package/dist/esm/versions/v2/api/deals-api.d.ts +509 -4
  48. package/dist/esm/versions/v2/api/deals-api.js +589 -4
  49. package/dist/esm/versions/v2/api/leads-api.d.ts +111 -0
  50. package/dist/esm/versions/v2/api/leads-api.js +146 -1
  51. package/dist/esm/versions/v2/api/organizations-api.d.ts +237 -0
  52. package/dist/esm/versions/v2/api/organizations-api.js +301 -0
  53. package/dist/esm/versions/v2/api/persons-api.d.ts +245 -8
  54. package/dist/esm/versions/v2/api/persons-api.js +309 -8
  55. package/dist/esm/versions/v2/api/products-api.d.ts +237 -0
  56. package/dist/esm/versions/v2/api/products-api.js +301 -0
  57. package/dist/esm/versions/v2/api/users-api.d.ts +103 -0
  58. package/dist/esm/versions/v2/api/users-api.js +140 -0
  59. package/dist/esm/versions/v2/api.d.ts +1 -0
  60. package/dist/esm/versions/v2/api.js +1 -0
  61. package/dist/esm/versions/v2/base.d.ts +2 -3
  62. package/dist/esm/versions/v2/configuration.d.ts +2 -2
  63. package/dist/esm/versions/v2/models/activity-item.d.ts +5 -0
  64. package/dist/esm/versions/v2/models/activity-item1.d.ts +5 -0
  65. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  66. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.js +14 -0
  67. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  68. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.js +14 -0
  69. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  70. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.js +14 -0
  71. package/dist/esm/versions/v2/models/add-deal-follower-request.d.ts +23 -0
  72. package/dist/esm/versions/v2/models/add-deal-follower-request.js +14 -0
  73. package/dist/esm/versions/v2/models/add-follower-response-all-of.d.ts +24 -0
  74. package/dist/esm/versions/v2/models/add-follower-response-all-of.js +14 -0
  75. package/dist/esm/versions/v2/models/add-follower-response.d.ts +18 -0
  76. package/dist/esm/versions/v2/models/add-follower-response.js +14 -0
  77. package/dist/esm/versions/v2/models/add-person-request.d.ts +12 -0
  78. package/dist/esm/versions/v2/models/add-person-request.js +6 -1
  79. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  80. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.js +14 -0
  81. package/dist/esm/versions/v2/models/deal-item.d.ts +5 -0
  82. package/dist/esm/versions/v2/models/deal-item1.d.ts +5 -0
  83. package/dist/esm/versions/v2/models/delete-follower-response-data.d.ts +23 -0
  84. package/dist/esm/versions/v2/models/delete-follower-response-data.js +14 -0
  85. package/dist/esm/versions/v2/models/delete-follower-response.d.ts +29 -0
  86. package/dist/esm/versions/v2/models/delete-follower-response.js +14 -0
  87. package/dist/esm/versions/v2/models/follower-changelog-item.d.ts +38 -0
  88. package/dist/esm/versions/v2/models/follower-changelog-item.js +14 -0
  89. package/dist/esm/versions/v2/models/follower-item.d.ts +28 -0
  90. package/dist/esm/versions/v2/models/follower-item.js +14 -0
  91. package/dist/esm/versions/v2/models/follower-item1.d.ts +28 -0
  92. package/dist/esm/versions/v2/models/follower-item1.js +14 -0
  93. package/dist/esm/versions/v2/models/get-convert-response.d.ts +43 -0
  94. package/dist/esm/versions/v2/models/get-convert-response.js +14 -0
  95. package/dist/esm/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  96. package/dist/esm/versions/v2/models/get-convert-response1-data.js +20 -0
  97. package/dist/esm/versions/v2/models/get-convert-response1.d.ts +34 -0
  98. package/dist/esm/versions/v2/models/get-convert-response1.js +14 -0
  99. package/dist/esm/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  100. package/dist/esm/versions/v2/models/get-follower-changelogs-response-all-of.d.ts +30 -0
  101. package/dist/esm/versions/v2/models/get-follower-changelogs-response-all-of.js +14 -0
  102. package/dist/esm/versions/v2/models/get-follower-changelogs-response.d.ts +18 -0
  103. package/dist/esm/versions/v2/models/get-follower-changelogs-response.js +14 -0
  104. package/dist/esm/versions/v2/models/get-followers-response-all-of.d.ts +30 -0
  105. package/dist/esm/versions/v2/models/get-followers-response-all-of.js +14 -0
  106. package/dist/esm/versions/v2/models/get-followers-response.d.ts +18 -0
  107. package/dist/esm/versions/v2/models/get-followers-response.js +14 -0
  108. package/dist/esm/versions/v2/models/index.d.ts +19 -0
  109. package/dist/esm/versions/v2/models/index.js +19 -0
  110. package/dist/esm/versions/v2/models/update-person-request.d.ts +12 -0
  111. package/dist/esm/versions/v2/models/update-person-request.js +6 -1
  112. package/dist/versions/v1/api/activities-api.d.ts +40 -40
  113. package/dist/versions/v1/api/activities-api.js +40 -40
  114. package/dist/versions/v1/api/deals-api.d.ts +413 -91
  115. package/dist/versions/v1/api/deals-api.js +419 -90
  116. package/dist/versions/v1/api/item-search-api.d.ts +8 -8
  117. package/dist/versions/v1/api/item-search-api.js +8 -8
  118. package/dist/versions/v1/api/leads-api.d.ts +100 -14
  119. package/dist/versions/v1/api/leads-api.js +107 -14
  120. package/dist/versions/v1/api/notes-api.d.ts +18 -2
  121. package/dist/versions/v1/api/notes-api.js +15 -5
  122. package/dist/versions/v1/api/organizations-api.d.ts +71 -71
  123. package/dist/versions/v1/api/organizations-api.js +70 -70
  124. package/dist/versions/v1/api/persons-api.d.ts +59 -59
  125. package/dist/versions/v1/api/persons-api.js +58 -58
  126. package/dist/versions/v1/api/pipelines-api.d.ts +28 -28
  127. package/dist/versions/v1/api/pipelines-api.js +28 -28
  128. package/dist/versions/v1/api/products-api.d.ts +24 -24
  129. package/dist/versions/v1/api/products-api.js +24 -24
  130. package/dist/versions/v1/api/stages-api.d.ts +36 -36
  131. package/dist/versions/v1/api/stages-api.js +36 -36
  132. package/dist/versions/v1/api/subscriptions-api.d.ts +36 -36
  133. package/dist/versions/v1/api/subscriptions-api.js +36 -36
  134. package/dist/versions/v1/api/webhooks-api.d.ts +4 -4
  135. package/dist/versions/v1/api/webhooks-api.js +4 -4
  136. package/dist/versions/v1/base.d.ts +2 -3
  137. package/dist/versions/v1/configuration.d.ts +2 -2
  138. package/dist/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  139. package/dist/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  140. package/dist/versions/v1/models/add-note-request-all-of1.js +5 -1
  141. package/dist/versions/v1/models/add-webhook-request.d.ts +5 -6
  142. package/dist/versions/v1/models/add-webhook-request.js +4 -5
  143. package/dist/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  144. package/dist/versions/v1/models/index.d.ts +1 -0
  145. package/dist/versions/v1/models/index.js +1 -0
  146. package/dist/versions/v1/models/note-project.d.ts +23 -0
  147. package/dist/versions/v1/models/note-project.js +15 -0
  148. package/dist/versions/v1/models/note-request-all-of1.d.ts +5 -0
  149. package/dist/versions/v1/models/note.d.ts +16 -0
  150. package/dist/versions/v1/models/user-access.d.ts +3 -2
  151. package/dist/versions/v1/models/user-access.js +4 -3
  152. package/dist/versions/v1/models/user-access1.d.ts +3 -2
  153. package/dist/versions/v1/models/user-access1.js +4 -3
  154. package/dist/versions/v2/api/activities-api.d.ts +15 -7
  155. package/dist/versions/v2/api/activities-api.js +12 -7
  156. package/dist/versions/v2/api/beta-api.d.ts +194 -2532
  157. package/dist/versions/v2/api/beta-api.js +265 -2930
  158. package/dist/versions/v2/api/deals-api.d.ts +509 -4
  159. package/dist/versions/v2/api/deals-api.js +589 -4
  160. package/dist/versions/v2/api/leads-api.d.ts +111 -0
  161. package/dist/versions/v2/api/leads-api.js +145 -0
  162. package/dist/versions/v2/api/organizations-api.d.ts +237 -0
  163. package/dist/versions/v2/api/organizations-api.js +301 -0
  164. package/dist/versions/v2/api/persons-api.d.ts +245 -8
  165. package/dist/versions/v2/api/persons-api.js +309 -8
  166. package/dist/versions/v2/api/products-api.d.ts +237 -0
  167. package/dist/versions/v2/api/products-api.js +301 -0
  168. package/dist/versions/v2/api/users-api.d.ts +103 -0
  169. package/dist/versions/v2/api/users-api.js +150 -0
  170. package/dist/versions/v2/api.d.ts +1 -0
  171. package/dist/versions/v2/api.js +1 -0
  172. package/dist/versions/v2/base.d.ts +2 -3
  173. package/dist/versions/v2/configuration.d.ts +2 -2
  174. package/dist/versions/v2/models/activity-item.d.ts +5 -0
  175. package/dist/versions/v2/models/activity-item1.d.ts +5 -0
  176. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  177. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.js +15 -0
  178. package/dist/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  179. package/dist/versions/v2/models/add-convert-deal-to-lead-response.js +15 -0
  180. package/dist/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  181. package/dist/versions/v2/models/add-convert-lead-to-deal-response.js +15 -0
  182. package/dist/versions/v2/models/add-deal-follower-request.d.ts +23 -0
  183. package/dist/versions/v2/models/add-deal-follower-request.js +15 -0
  184. package/dist/versions/v2/models/add-follower-response-all-of.d.ts +24 -0
  185. package/dist/versions/v2/models/add-follower-response-all-of.js +15 -0
  186. package/dist/versions/v2/models/add-follower-response.d.ts +18 -0
  187. package/dist/versions/v2/models/add-follower-response.js +15 -0
  188. package/dist/versions/v2/models/add-person-request.d.ts +12 -0
  189. package/dist/versions/v2/models/add-person-request.js +7 -0
  190. package/dist/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  191. package/dist/versions/v2/models/convert-lead-to-deal-request.js +15 -0
  192. package/dist/versions/v2/models/deal-item.d.ts +5 -0
  193. package/dist/versions/v2/models/deal-item1.d.ts +5 -0
  194. package/dist/versions/v2/models/delete-follower-response-data.d.ts +23 -0
  195. package/dist/versions/v2/models/delete-follower-response-data.js +15 -0
  196. package/dist/versions/v2/models/delete-follower-response.d.ts +29 -0
  197. package/dist/versions/v2/models/delete-follower-response.js +15 -0
  198. package/dist/versions/v2/models/follower-changelog-item.d.ts +38 -0
  199. package/dist/versions/v2/models/follower-changelog-item.js +15 -0
  200. package/dist/versions/v2/models/follower-item.d.ts +28 -0
  201. package/dist/versions/v2/models/follower-item.js +15 -0
  202. package/dist/versions/v2/models/follower-item1.d.ts +28 -0
  203. package/dist/versions/v2/models/follower-item1.js +15 -0
  204. package/dist/versions/v2/models/get-convert-response.d.ts +43 -0
  205. package/dist/versions/v2/models/get-convert-response.js +15 -0
  206. package/dist/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  207. package/dist/versions/v2/models/get-convert-response1-data.js +23 -0
  208. package/dist/versions/v2/models/get-convert-response1.d.ts +34 -0
  209. package/dist/versions/v2/models/get-convert-response1.js +15 -0
  210. package/dist/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  211. package/dist/versions/v2/models/get-follower-changelogs-response-all-of.d.ts +30 -0
  212. package/dist/versions/v2/models/get-follower-changelogs-response-all-of.js +15 -0
  213. package/dist/versions/v2/models/get-follower-changelogs-response.d.ts +18 -0
  214. package/dist/versions/v2/models/get-follower-changelogs-response.js +15 -0
  215. package/dist/versions/v2/models/get-followers-response-all-of.d.ts +30 -0
  216. package/dist/versions/v2/models/get-followers-response-all-of.js +15 -0
  217. package/dist/versions/v2/models/get-followers-response.d.ts +18 -0
  218. package/dist/versions/v2/models/get-followers-response.js +15 -0
  219. package/dist/versions/v2/models/index.d.ts +19 -0
  220. package/dist/versions/v2/models/index.js +19 -0
  221. package/dist/versions/v2/models/update-person-request.d.ts +12 -0
  222. package/dist/versions/v2/models/update-person-request.js +7 -0
  223. package/package.json +1 -1
@@ -12,12 +12,33 @@
12
12
  import type { Configuration } from '../configuration';
13
13
  import type { AxiosInstance } from 'axios';
14
14
  import { RequestArgs, BaseAPI } from '../base';
15
+ import { AddConvertLeadToDealResponse } from '../models';
16
+ import { ConvertLeadToDealRequest } from '../models';
17
+ import { GetConvertResponse1 } from '../models';
15
18
  import { GetLeadSearchResponse } from '../models';
16
19
  /**
17
20
  * LeadsApi - axios parameter creator
18
21
  * @export
19
22
  */
20
23
  export declare const LeadsApiAxiosParamCreator: (configuration?: Configuration) => {
24
+ /**
25
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
26
+ * @summary Convert a lead to a deal (BETA)
27
+ * @param {string} id The ID of the lead to convert
28
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
29
+
30
+ * @throws {RequiredError}
31
+ */
32
+ convertLeadToDeal: (id: string, ConvertLeadToDealRequest?: ConvertLeadToDealRequest) => Promise<RequestArgs>;
33
+ /**
34
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
35
+ * @summary Get Lead conversion status (BETA)
36
+ * @param {string} id The ID of a lead
37
+ * @param {string} conversion_id The ID of the conversion
38
+
39
+ * @throws {RequiredError}
40
+ */
41
+ getLeadConversionStatus: (id: string, conversion_id: string) => Promise<RequestArgs>;
21
42
  /**
22
43
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
23
44
  * @summary Search leads
@@ -39,6 +60,24 @@ export declare const LeadsApiAxiosParamCreator: (configuration?: Configuration)
39
60
  * @export
40
61
  */
41
62
  export declare const LeadsApiFp: (configuration?: Configuration) => {
63
+ /**
64
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
65
+ * @summary Convert a lead to a deal (BETA)
66
+ * @param {string} id The ID of the lead to convert
67
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
68
+
69
+ * @throws {RequiredError}
70
+ */
71
+ convertLeadToDeal(id: string, ConvertLeadToDealRequest?: ConvertLeadToDealRequest): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AddConvertLeadToDealResponse>>;
72
+ /**
73
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
74
+ * @summary Get Lead conversion status (BETA)
75
+ * @param {string} id The ID of a lead
76
+ * @param {string} conversion_id The ID of the conversion
77
+
78
+ * @throws {RequiredError}
79
+ */
80
+ getLeadConversionStatus(id: string, conversion_id: string): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetConvertResponse1>>;
42
81
  /**
43
82
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
44
83
  * @summary Search leads
@@ -60,6 +99,22 @@ export declare const LeadsApiFp: (configuration?: Configuration) => {
60
99
  * @export
61
100
  */
62
101
  export declare const LeadsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
102
+ /**
103
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
104
+ * @summary Convert a lead to a deal (BETA)
105
+ * @param {LeadsApiConvertLeadToDealRequest} requestParameters Request parameters.
106
+
107
+ * @throws {RequiredError}
108
+ */
109
+ convertLeadToDeal(requestParameters: LeadsApiConvertLeadToDealRequest): Promise<AddConvertLeadToDealResponse>;
110
+ /**
111
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
112
+ * @summary Get Lead conversion status (BETA)
113
+ * @param {LeadsApiGetLeadConversionStatusRequest} requestParameters Request parameters.
114
+
115
+ * @throws {RequiredError}
116
+ */
117
+ getLeadConversionStatus(requestParameters: LeadsApiGetLeadConversionStatusRequest): Promise<GetConvertResponse1>;
63
118
  /**
64
119
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
65
120
  * @summary Search leads
@@ -69,6 +124,44 @@ export declare const LeadsApiFactory: (configuration?: Configuration, basePath?:
69
124
  */
70
125
  searchLeads(requestParameters: LeadsApiSearchLeadsRequest): Promise<GetLeadSearchResponse>;
71
126
  };
127
+ /**
128
+ * Request parameters for convertLeadToDeal operation in LeadsApi.
129
+ * @export
130
+ * @interface LeadsApiConvertLeadToDealRequest
131
+ */
132
+ export interface LeadsApiConvertLeadToDealRequest {
133
+ /**
134
+ * The ID of the lead to convert
135
+ * @type {string}
136
+ * @memberof LeadsApiConvertLeadToDeal
137
+ */
138
+ readonly id: string;
139
+ /**
140
+ *
141
+ * @type {ConvertLeadToDealRequest}
142
+ * @memberof LeadsApiConvertLeadToDeal
143
+ */
144
+ readonly ConvertLeadToDealRequest?: ConvertLeadToDealRequest;
145
+ }
146
+ /**
147
+ * Request parameters for getLeadConversionStatus operation in LeadsApi.
148
+ * @export
149
+ * @interface LeadsApiGetLeadConversionStatusRequest
150
+ */
151
+ export interface LeadsApiGetLeadConversionStatusRequest {
152
+ /**
153
+ * The ID of a lead
154
+ * @type {string}
155
+ * @memberof LeadsApiGetLeadConversionStatus
156
+ */
157
+ readonly id: string;
158
+ /**
159
+ * The ID of the conversion
160
+ * @type {string}
161
+ * @memberof LeadsApiGetLeadConversionStatus
162
+ */
163
+ readonly conversion_id: string;
164
+ }
72
165
  /**
73
166
  * Request parameters for searchLeads operation in LeadsApi.
74
167
  * @export
@@ -131,6 +224,24 @@ export interface LeadsApiSearchLeadsRequest {
131
224
  * @extends {BaseAPI}
132
225
  */
133
226
  export declare class LeadsApi extends BaseAPI {
227
+ /**
228
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
229
+ * @summary Convert a lead to a deal (BETA)
230
+ * @param {LeadsApiConvertLeadToDealRequest} requestParameters Request parameters.
231
+
232
+ * @throws {RequiredError}
233
+ * @memberof LeadsApi
234
+ */
235
+ convertLeadToDeal(requestParameters: LeadsApiConvertLeadToDealRequest): Promise<AddConvertLeadToDealResponse>;
236
+ /**
237
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
238
+ * @summary Get Lead conversion status (BETA)
239
+ * @param {LeadsApiGetLeadConversionStatusRequest} requestParameters Request parameters.
240
+
241
+ * @throws {RequiredError}
242
+ * @memberof LeadsApi
243
+ */
244
+ getLeadConversionStatus(requestParameters: LeadsApiGetLeadConversionStatusRequest): Promise<GetConvertResponse1>;
134
245
  /**
135
246
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
136
247
  * @summary Search leads
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  import globalAxios from 'axios';
24
24
  // Some imports not used depending on template conditions
25
25
  // @ts-ignore
26
- import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common';
26
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
27
27
  // @ts-ignore
28
28
  import { BASE_PATH, BaseAPI } from '../base';
29
29
  /**
@@ -32,6 +32,81 @@ import { BASE_PATH, BaseAPI } from '../base';
32
32
  */
33
33
  export const LeadsApiAxiosParamCreator = function (configuration) {
34
34
  return {
35
+ /**
36
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
37
+ * @summary Convert a lead to a deal (BETA)
38
+ * @param {string} id The ID of the lead to convert
39
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
40
+
41
+ * @throws {RequiredError}
42
+ */
43
+ convertLeadToDeal: (id, ConvertLeadToDealRequest) => __awaiter(this, void 0, void 0, function* () {
44
+ // verify required parameter 'id' is not null or undefined
45
+ assertParamExists('convertLeadToDeal', 'id', id);
46
+ const localVarPath = `/leads/{id}/convert/deal`
47
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
48
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
49
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
50
+ let baseOptions;
51
+ if (configuration) {
52
+ baseOptions = configuration.baseOptions;
53
+ }
54
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
55
+ const localVarHeaderParameter = {};
56
+ const localVarQueryParameter = {};
57
+ // authentication api_key required
58
+ yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
59
+ // authentication oauth2 required
60
+ // oauth required
61
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
62
+ localVarHeaderParameter['Content-Type'] = 'application/json';
63
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
64
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
65
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
66
+ localVarRequestOptions.data = serializeDataIfNeeded(ConvertLeadToDealRequest, localVarRequestOptions, configuration);
67
+ return {
68
+ url: toPathString(localVarUrlObj),
69
+ options: localVarRequestOptions,
70
+ };
71
+ }),
72
+ /**
73
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
74
+ * @summary Get Lead conversion status (BETA)
75
+ * @param {string} id The ID of a lead
76
+ * @param {string} conversion_id The ID of the conversion
77
+
78
+ * @throws {RequiredError}
79
+ */
80
+ getLeadConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
81
+ // verify required parameter 'id' is not null or undefined
82
+ assertParamExists('getLeadConversionStatus', 'id', id);
83
+ // verify required parameter 'conversion_id' is not null or undefined
84
+ assertParamExists('getLeadConversionStatus', 'conversion_id', conversion_id);
85
+ const localVarPath = `/leads/{id}/convert/status/{conversion_id}`
86
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
87
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
88
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
89
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
90
+ let baseOptions;
91
+ if (configuration) {
92
+ baseOptions = configuration.baseOptions;
93
+ }
94
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
95
+ const localVarHeaderParameter = {};
96
+ const localVarQueryParameter = {};
97
+ // authentication api_key required
98
+ yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
99
+ // authentication oauth2 required
100
+ // oauth required
101
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read"], configuration);
102
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
103
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
104
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
105
+ return {
106
+ url: toPathString(localVarUrlObj),
107
+ options: localVarRequestOptions,
108
+ };
109
+ }),
35
110
  /**
36
111
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
37
112
  * @summary Search leads
@@ -105,6 +180,34 @@ export const LeadsApiAxiosParamCreator = function (configuration) {
105
180
  export const LeadsApiFp = function (configuration) {
106
181
  const localVarAxiosParamCreator = LeadsApiAxiosParamCreator(configuration);
107
182
  return {
183
+ /**
184
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
185
+ * @summary Convert a lead to a deal (BETA)
186
+ * @param {string} id The ID of the lead to convert
187
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
188
+
189
+ * @throws {RequiredError}
190
+ */
191
+ convertLeadToDeal(id, ConvertLeadToDealRequest) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest);
194
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
195
+ });
196
+ },
197
+ /**
198
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
199
+ * @summary Get Lead conversion status (BETA)
200
+ * @param {string} id The ID of a lead
201
+ * @param {string} conversion_id The ID of the conversion
202
+
203
+ * @throws {RequiredError}
204
+ */
205
+ getLeadConversionStatus(id, conversion_id) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id);
208
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
209
+ });
210
+ },
108
211
  /**
109
212
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
110
213
  * @summary Search leads
@@ -134,6 +237,26 @@ export const LeadsApiFp = function (configuration) {
134
237
  export const LeadsApiFactory = function (configuration, basePath, axios) {
135
238
  const localVarFp = LeadsApiFp(configuration);
136
239
  return {
240
+ /**
241
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
242
+ * @summary Convert a lead to a deal (BETA)
243
+ * @param {LeadsApiConvertLeadToDealRequest} requestParameters Request parameters.
244
+
245
+ * @throws {RequiredError}
246
+ */
247
+ convertLeadToDeal(requestParameters) {
248
+ return localVarFp.convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(axios, basePath));
249
+ },
250
+ /**
251
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
252
+ * @summary Get Lead conversion status (BETA)
253
+ * @param {LeadsApiGetLeadConversionStatusRequest} requestParameters Request parameters.
254
+
255
+ * @throws {RequiredError}
256
+ */
257
+ getLeadConversionStatus(requestParameters) {
258
+ return localVarFp.getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
259
+ },
137
260
  /**
138
261
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
139
262
  * @summary Search leads
@@ -153,6 +276,28 @@ export const LeadsApiFactory = function (configuration, basePath, axios) {
153
276
  * @extends {BaseAPI}
154
277
  */
155
278
  export class LeadsApi extends BaseAPI {
279
+ /**
280
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
281
+ * @summary Convert a lead to a deal (BETA)
282
+ * @param {LeadsApiConvertLeadToDealRequest} requestParameters Request parameters.
283
+
284
+ * @throws {RequiredError}
285
+ * @memberof LeadsApi
286
+ */
287
+ convertLeadToDeal(requestParameters) {
288
+ return LeadsApiFp(this.configuration).convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(this.axios, this.basePath));
289
+ }
290
+ /**
291
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
292
+ * @summary Get Lead conversion status (BETA)
293
+ * @param {LeadsApiGetLeadConversionStatusRequest} requestParameters Request parameters.
294
+
295
+ * @throws {RequiredError}
296
+ * @memberof LeadsApi
297
+ */
298
+ getLeadConversionStatus(requestParameters) {
299
+ return LeadsApiFp(this.configuration).getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
300
+ }
156
301
  /**
157
302
  * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
158
303
  * @summary Search leads