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
@@ -39,14 +39,17 @@ const base_1 = require("../base");
39
39
  const BetaApiAxiosParamCreator = function (configuration) {
40
40
  return {
41
41
  /**
42
- * Adds a new activity.
43
- * @summary Add a new activity
44
- * @param {AddActivityRequest} [AddActivityRequest]
42
+ * Initiates a conversion of a deal to a lead. 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. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal 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/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
43
+ * @summary Convert a deal to a lead (BETA)
44
+ * @param {number} id The ID of the deal to convert
45
45
 
46
46
  * @throws {RequiredError}
47
47
  */
48
- addActivity: (AddActivityRequest) => __awaiter(this, void 0, void 0, function* () {
49
- const localVarPath = `/activities`;
48
+ convertDealToLead: (id) => __awaiter(this, void 0, void 0, function* () {
49
+ // verify required parameter 'id' is not null or undefined
50
+ (0, common_1.assertParamExists)('convertDealToLead', 'id', id);
51
+ const localVarPath = `/deals/{id}/convert/lead`
52
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
50
53
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
54
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
52
55
  let baseOptions;
@@ -60,26 +63,28 @@ const BetaApiAxiosParamCreator = function (configuration) {
60
63
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
61
64
  // authentication oauth2 required
62
65
  // oauth required
63
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
64
- localVarHeaderParameter['Content-Type'] = 'application/json';
66
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
65
67
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
66
68
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
67
69
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
68
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddActivityRequest, localVarRequestOptions, configuration);
69
70
  return {
70
71
  url: (0, common_1.toPathString)(localVarUrlObj),
71
72
  options: localVarRequestOptions,
72
73
  };
73
74
  }),
74
75
  /**
75
- * Adds a new deal.
76
- * @summary Add a new deal
77
- * @param {AddDealRequest} [AddDealRequest]
76
+ * 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.
77
+ * @summary Convert a lead to a deal (BETA)
78
+ * @param {string} id The ID of the lead to convert
79
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
78
80
 
79
81
  * @throws {RequiredError}
80
82
  */
81
- addDeal: (AddDealRequest) => __awaiter(this, void 0, void 0, function* () {
82
- const localVarPath = `/deals`;
83
+ convertLeadToDeal: (id, ConvertLeadToDealRequest) => __awaiter(this, void 0, void 0, function* () {
84
+ // verify required parameter 'id' is not null or undefined
85
+ (0, common_1.assertParamExists)('convertLeadToDeal', 'id', id);
86
+ const localVarPath = `/leads/{id}/convert/deal`
87
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
83
88
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
84
89
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
85
90
  let baseOptions;
@@ -93,146 +98,175 @@ const BetaApiAxiosParamCreator = function (configuration) {
93
98
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
94
99
  // authentication oauth2 required
95
100
  // oauth required
96
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
101
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
97
102
  localVarHeaderParameter['Content-Type'] = 'application/json';
98
103
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
99
104
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
100
105
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
101
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddDealRequest, localVarRequestOptions, configuration);
106
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(ConvertLeadToDealRequest, localVarRequestOptions, configuration);
102
107
  return {
103
108
  url: (0, common_1.toPathString)(localVarUrlObj),
104
109
  options: localVarRequestOptions,
105
110
  };
106
111
  }),
107
112
  /**
108
- * Adds a product to a deal, creating a new item called a deal-product.
109
- * @summary Add a product to a deal
113
+ * Removes an installment from a deal. Only available in Advanced and above plans.
114
+ * @summary Delete an installment from a deal
110
115
  * @param {number} id The ID of the deal
111
- * @param {AddDealProductRequest} [AddDealProductRequest]
116
+ * @param {number} installment_id The ID of the installment
112
117
 
113
118
  * @throws {RequiredError}
114
119
  */
115
- addDealProduct: (id, AddDealProductRequest) => __awaiter(this, void 0, void 0, function* () {
120
+ deleteInstallment: (id, installment_id) => __awaiter(this, void 0, void 0, function* () {
116
121
  // verify required parameter 'id' is not null or undefined
117
- (0, common_1.assertParamExists)('addDealProduct', 'id', id);
118
- const localVarPath = `/deals/{id}/products`
119
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
122
+ (0, common_1.assertParamExists)('deleteInstallment', 'id', id);
123
+ // verify required parameter 'installment_id' is not null or undefined
124
+ (0, common_1.assertParamExists)('deleteInstallment', 'installment_id', installment_id);
125
+ const localVarPath = `/deals/{id}/installments/{installment_id}`
126
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
127
+ .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
120
128
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
121
129
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
122
130
  let baseOptions;
123
131
  if (configuration) {
124
132
  baseOptions = configuration.baseOptions;
125
133
  }
126
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
134
+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
127
135
  const localVarHeaderParameter = {};
128
136
  const localVarQueryParameter = {};
129
137
  // authentication api_key required
130
138
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
131
139
  // authentication oauth2 required
132
140
  // oauth required
133
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
134
- localVarHeaderParameter['Content-Type'] = 'application/json';
141
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
135
142
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
143
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
144
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
138
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddDealProductRequest, localVarRequestOptions, configuration);
139
145
  return {
140
146
  url: (0, common_1.toPathString)(localVarUrlObj),
141
147
  options: localVarRequestOptions,
142
148
  };
143
149
  }),
144
150
  /**
145
- * Adds a new organization.
146
- * @summary Add a new organization
147
- * @param {AddOrganizationRequest} [AddOrganizationRequest]
151
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
152
+ * @summary Get Deal conversion status (BETA)
153
+ * @param {number} id The ID of a deal
154
+ * @param {string} conversion_id The ID of the conversion
148
155
 
149
156
  * @throws {RequiredError}
150
157
  */
151
- addOrganization: (AddOrganizationRequest) => __awaiter(this, void 0, void 0, function* () {
152
- const localVarPath = `/organizations`;
158
+ getDealConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
159
+ // verify required parameter 'id' is not null or undefined
160
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'id', id);
161
+ // verify required parameter 'conversion_id' is not null or undefined
162
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'conversion_id', conversion_id);
163
+ const localVarPath = `/deals/{id}/convert/status/{conversion_id}`
164
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
165
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
153
166
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
154
167
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
155
168
  let baseOptions;
156
169
  if (configuration) {
157
170
  baseOptions = configuration.baseOptions;
158
171
  }
159
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
172
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
160
173
  const localVarHeaderParameter = {};
161
174
  const localVarQueryParameter = {};
162
175
  // authentication api_key required
163
176
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
164
177
  // authentication oauth2 required
165
178
  // oauth required
166
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
167
- localVarHeaderParameter['Content-Type'] = 'application/json';
179
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read"], configuration);
168
180
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
169
181
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
170
182
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
171
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddOrganizationRequest, localVarRequestOptions, configuration);
172
183
  return {
173
184
  url: (0, common_1.toPathString)(localVarUrlObj),
174
185
  options: localVarRequestOptions,
175
186
  };
176
187
  }),
177
188
  /**
178
- * Adds a new person.
179
- * @summary Add a new person
180
- * @param {AddPersonRequest} [AddPersonRequest]
189
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
190
+ * @summary List installments added to a list of deals
191
+ * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
192
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
193
+ * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
194
+ * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
195
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
181
196
 
182
197
  * @throws {RequiredError}
183
198
  */
184
- addPerson: (AddPersonRequest) => __awaiter(this, void 0, void 0, function* () {
185
- const localVarPath = `/persons`;
199
+ getInstallments: (deal_ids, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
200
+ // verify required parameter 'deal_ids' is not null or undefined
201
+ (0, common_1.assertParamExists)('getInstallments', 'deal_ids', deal_ids);
202
+ const localVarPath = `/deals/installments`;
186
203
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
187
204
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
188
205
  let baseOptions;
189
206
  if (configuration) {
190
207
  baseOptions = configuration.baseOptions;
191
208
  }
192
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
209
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
193
210
  const localVarHeaderParameter = {};
194
211
  const localVarQueryParameter = {};
195
212
  // authentication api_key required
196
213
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
197
214
  // authentication oauth2 required
198
215
  // oauth required
199
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
200
- localVarHeaderParameter['Content-Type'] = 'application/json';
216
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
217
+ if (deal_ids) {
218
+ localVarQueryParameter['deal_ids'] = deal_ids;
219
+ }
220
+ if (cursor !== undefined) {
221
+ localVarQueryParameter['cursor'] = cursor;
222
+ }
223
+ if (limit !== undefined) {
224
+ localVarQueryParameter['limit'] = limit;
225
+ }
226
+ if (sort_by !== undefined) {
227
+ localVarQueryParameter['sort_by'] = sort_by;
228
+ }
229
+ if (sort_direction !== undefined) {
230
+ localVarQueryParameter['sort_direction'] = sort_direction;
231
+ }
201
232
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
202
233
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
203
234
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
204
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddPersonRequest, localVarRequestOptions, configuration);
205
235
  return {
206
236
  url: (0, common_1.toPathString)(localVarUrlObj),
207
237
  options: localVarRequestOptions,
208
238
  };
209
239
  }),
210
240
  /**
211
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
212
- * @summary Delete an activity
213
- * @param {number} id The ID of the activity
241
+ * 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.
242
+ * @summary Get Lead conversion status (BETA)
243
+ * @param {string} id The ID of a lead
244
+ * @param {string} conversion_id The ID of the conversion
214
245
 
215
246
  * @throws {RequiredError}
216
247
  */
217
- deleteActivity: (id) => __awaiter(this, void 0, void 0, function* () {
248
+ getLeadConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
218
249
  // verify required parameter 'id' is not null or undefined
219
- (0, common_1.assertParamExists)('deleteActivity', 'id', id);
220
- const localVarPath = `/activities/{id}`
221
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
250
+ (0, common_1.assertParamExists)('getLeadConversionStatus', 'id', id);
251
+ // verify required parameter 'conversion_id' is not null or undefined
252
+ (0, common_1.assertParamExists)('getLeadConversionStatus', 'conversion_id', conversion_id);
253
+ const localVarPath = `/leads/{id}/convert/status/{conversion_id}`
254
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
255
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
222
256
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
223
257
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
224
258
  let baseOptions;
225
259
  if (configuration) {
226
260
  baseOptions = configuration.baseOptions;
227
261
  }
228
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
262
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
229
263
  const localVarHeaderParameter = {};
230
264
  const localVarQueryParameter = {};
231
265
  // authentication api_key required
232
266
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
233
267
  // authentication oauth2 required
234
268
  // oauth required
235
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
269
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["leads:read"], configuration);
236
270
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
237
271
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
238
272
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
@@ -242,28 +276,25 @@ const BetaApiAxiosParamCreator = function (configuration) {
242
276
  };
243
277
  }),
244
278
  /**
245
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
246
- * @summary Delete a discount from a deal
279
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
280
+ * @summary Add an installment to a deal
247
281
  * @param {number} id The ID of the deal
248
- * @param {number} discount_id The ID of the discount
282
+ * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
249
283
 
250
284
  * @throws {RequiredError}
251
285
  */
252
- deleteAdditionalDiscount: (id, discount_id) => __awaiter(this, void 0, void 0, function* () {
286
+ postInstallment: (id, AddInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
253
287
  // verify required parameter 'id' is not null or undefined
254
- (0, common_1.assertParamExists)('deleteAdditionalDiscount', 'id', id);
255
- // verify required parameter 'discount_id' is not null or undefined
256
- (0, common_1.assertParamExists)('deleteAdditionalDiscount', 'discount_id', discount_id);
257
- const localVarPath = `/deals/{id}/discounts/{discount_id}`
258
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
259
- .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id)));
288
+ (0, common_1.assertParamExists)('postInstallment', 'id', id);
289
+ const localVarPath = `/deals/{id}/installments`
290
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
260
291
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
261
292
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
262
293
  let baseOptions;
263
294
  if (configuration) {
264
295
  baseOptions = configuration.baseOptions;
265
296
  }
266
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
297
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
267
298
  const localVarHeaderParameter = {};
268
299
  const localVarQueryParameter = {};
269
300
  // authentication api_key required
@@ -271,86 +302,94 @@ const BetaApiAxiosParamCreator = function (configuration) {
271
302
  // authentication oauth2 required
272
303
  // oauth required
273
304
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
305
+ localVarHeaderParameter['Content-Type'] = 'application/json';
274
306
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
275
307
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
276
308
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
309
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddInstallmentRequestBody, localVarRequestOptions, configuration);
277
310
  return {
278
311
  url: (0, common_1.toPathString)(localVarUrlObj),
279
312
  options: localVarRequestOptions,
280
313
  };
281
314
  }),
282
315
  /**
283
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
284
- * @summary Delete a deal
316
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
317
+ * @summary Update an installment added to a deal
285
318
  * @param {number} id The ID of the deal
319
+ * @param {number} installment_id The ID of the installment
320
+ * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
286
321
 
287
322
  * @throws {RequiredError}
288
323
  */
289
- deleteDeal: (id) => __awaiter(this, void 0, void 0, function* () {
324
+ updateInstallment: (id, installment_id, UpdateInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
290
325
  // verify required parameter 'id' is not null or undefined
291
- (0, common_1.assertParamExists)('deleteDeal', 'id', id);
292
- const localVarPath = `/deals/{id}`
293
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
326
+ (0, common_1.assertParamExists)('updateInstallment', 'id', id);
327
+ // verify required parameter 'installment_id' is not null or undefined
328
+ (0, common_1.assertParamExists)('updateInstallment', 'installment_id', installment_id);
329
+ const localVarPath = `/deals/{id}/installments/{installment_id}`
330
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
331
+ .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
294
332
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
295
333
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
296
334
  let baseOptions;
297
335
  if (configuration) {
298
336
  baseOptions = configuration.baseOptions;
299
337
  }
300
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
338
+ const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
301
339
  const localVarHeaderParameter = {};
302
340
  const localVarQueryParameter = {};
303
341
  // authentication api_key required
304
342
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
305
343
  // authentication oauth2 required
306
344
  // oauth required
307
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
345
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
346
+ localVarHeaderParameter['Content-Type'] = 'application/json';
308
347
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
309
348
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
310
349
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
350
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateInstallmentRequestBody, localVarRequestOptions, configuration);
311
351
  return {
312
352
  url: (0, common_1.toPathString)(localVarUrlObj),
313
353
  options: localVarRequestOptions,
314
354
  };
315
355
  }),
356
+ };
357
+ };
358
+ exports.BetaApiAxiosParamCreator = BetaApiAxiosParamCreator;
359
+ /**
360
+ * BetaApi - functional programming interface
361
+ * @export
362
+ */
363
+ const BetaApiFp = function (configuration) {
364
+ const localVarAxiosParamCreator = (0, exports.BetaApiAxiosParamCreator)(configuration);
365
+ return {
316
366
  /**
317
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
318
- * @summary Delete an attached product from a deal
319
- * @param {number} id The ID of the deal
320
- * @param {number} product_attachment_id The product attachment ID
367
+ * Initiates a conversion of a deal to a lead. 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. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal 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/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
368
+ * @summary Convert a deal to a lead (BETA)
369
+ * @param {number} id The ID of the deal to convert
321
370
 
322
371
  * @throws {RequiredError}
323
372
  */
324
- deleteDealProduct: (id, product_attachment_id) => __awaiter(this, void 0, void 0, function* () {
325
- // verify required parameter 'id' is not null or undefined
326
- (0, common_1.assertParamExists)('deleteDealProduct', 'id', id);
327
- // verify required parameter 'product_attachment_id' is not null or undefined
328
- (0, common_1.assertParamExists)('deleteDealProduct', 'product_attachment_id', product_attachment_id);
329
- const localVarPath = `/deals/{id}/products/{product_attachment_id}`
330
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
331
- .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id)));
332
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
333
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
334
- let baseOptions;
335
- if (configuration) {
336
- baseOptions = configuration.baseOptions;
337
- }
338
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
339
- const localVarHeaderParameter = {};
340
- const localVarQueryParameter = {};
341
- // authentication api_key required
342
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
343
- // authentication oauth2 required
344
- // oauth required
345
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "products:full"], configuration);
346
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
347
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
348
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
349
- return {
350
- url: (0, common_1.toPathString)(localVarUrlObj),
351
- options: localVarRequestOptions,
352
- };
353
- }),
373
+ convertDealToLead(id) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertDealToLead(id);
376
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
377
+ });
378
+ },
379
+ /**
380
+ * 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.
381
+ * @summary Convert a lead to a deal (BETA)
382
+ * @param {string} id The ID of the lead to convert
383
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
384
+
385
+ * @throws {RequiredError}
386
+ */
387
+ convertLeadToDeal(id, ConvertLeadToDealRequest) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest);
390
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
391
+ });
392
+ },
354
393
  /**
355
394
  * Removes an installment from a deal. Only available in Advanced and above plans.
356
395
  * @summary Delete an installment from a deal
@@ -359,2508 +398,165 @@ const BetaApiAxiosParamCreator = function (configuration) {
359
398
 
360
399
  * @throws {RequiredError}
361
400
  */
362
- deleteInstallment: (id, installment_id) => __awaiter(this, void 0, void 0, function* () {
363
- // verify required parameter 'id' is not null or undefined
364
- (0, common_1.assertParamExists)('deleteInstallment', 'id', id);
365
- // verify required parameter 'installment_id' is not null or undefined
366
- (0, common_1.assertParamExists)('deleteInstallment', 'installment_id', installment_id);
367
- const localVarPath = `/deals/{id}/installments/{installment_id}`
368
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
369
- .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
370
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
371
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
372
- let baseOptions;
373
- if (configuration) {
374
- baseOptions = configuration.baseOptions;
375
- }
376
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
377
- const localVarHeaderParameter = {};
378
- const localVarQueryParameter = {};
379
- // authentication api_key required
380
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
381
- // authentication oauth2 required
382
- // oauth required
383
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
384
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
385
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
386
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
387
- return {
388
- url: (0, common_1.toPathString)(localVarUrlObj),
389
- options: localVarRequestOptions,
390
- };
391
- }),
401
+ deleteInstallment(id, installment_id) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInstallment(id, installment_id);
404
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
405
+ });
406
+ },
392
407
  /**
393
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
394
- * @summary Delete a organization
395
- * @param {number} id The ID of the organization
408
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
409
+ * @summary Get Deal conversion status (BETA)
410
+ * @param {number} id The ID of a deal
411
+ * @param {string} conversion_id The ID of the conversion
396
412
 
397
413
  * @throws {RequiredError}
398
414
  */
399
- deleteOrganization: (id) => __awaiter(this, void 0, void 0, function* () {
400
- // verify required parameter 'id' is not null or undefined
401
- (0, common_1.assertParamExists)('deleteOrganization', 'id', id);
402
- const localVarPath = `/organizations/{id}`
403
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
404
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
405
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
406
- let baseOptions;
407
- if (configuration) {
408
- baseOptions = configuration.baseOptions;
409
- }
410
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
411
- const localVarHeaderParameter = {};
412
- const localVarQueryParameter = {};
413
- // authentication api_key required
414
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
415
- // authentication oauth2 required
416
- // oauth required
417
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
418
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
419
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
420
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
421
- return {
422
- url: (0, common_1.toPathString)(localVarUrlObj),
423
- options: localVarRequestOptions,
424
- };
425
- }),
415
+ getDealConversionStatus(id, conversion_id) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id);
418
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
419
+ });
420
+ },
426
421
  /**
427
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
428
- * @summary Delete a person
429
- * @param {number} id The ID of the person
422
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
423
+ * @summary List installments added to a list of deals
424
+ * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
425
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
426
+ * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
427
+ * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
428
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
430
429
 
431
430
  * @throws {RequiredError}
432
431
  */
433
- deletePerson: (id) => __awaiter(this, void 0, void 0, function* () {
434
- // verify required parameter 'id' is not null or undefined
435
- (0, common_1.assertParamExists)('deletePerson', 'id', id);
436
- const localVarPath = `/persons/{id}`
437
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
438
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
439
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
440
- let baseOptions;
441
- if (configuration) {
442
- baseOptions = configuration.baseOptions;
443
- }
444
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
445
- const localVarHeaderParameter = {};
446
- const localVarQueryParameter = {};
447
- // authentication api_key required
448
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
449
- // authentication oauth2 required
450
- // oauth required
451
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
452
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
453
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
454
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
455
- return {
456
- url: (0, common_1.toPathString)(localVarUrlObj),
457
- options: localVarRequestOptions,
458
- };
459
- }),
432
+ getInstallments(deal_ids, cursor, limit, sort_by, sort_direction) {
433
+ return __awaiter(this, void 0, void 0, function* () {
434
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction);
435
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
436
+ });
437
+ },
460
438
  /**
461
- * Returns data about all activities.
462
- * @summary Get all activities
463
- * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned
464
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
465
- * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored.
466
- * @param {number} [deal_id] If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored.
467
- * @param {string} [lead_id] If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored.
468
- * @param {number} [person_id] If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored.
469
- * @param {number} [org_id] If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored.
470
- * @param {string} [updated_since] If set, only activities with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
471
- * @param {string} [updated_until] If set, only activities with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
472
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
473
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
474
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
475
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
476
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
439
+ * 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.
440
+ * @summary Get Lead conversion status (BETA)
441
+ * @param {string} id The ID of a lead
442
+ * @param {string} conversion_id The ID of the conversion
477
443
 
478
444
  * @throws {RequiredError}
479
445
  */
480
- getActivities: (filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
481
- const localVarPath = `/activities`;
482
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
483
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
484
- let baseOptions;
485
- if (configuration) {
486
- baseOptions = configuration.baseOptions;
487
- }
488
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
489
- const localVarHeaderParameter = {};
490
- const localVarQueryParameter = {};
491
- // authentication api_key required
492
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
493
- // authentication oauth2 required
494
- // oauth required
495
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration);
496
- if (filter_id !== undefined) {
497
- localVarQueryParameter['filter_id'] = filter_id;
498
- }
499
- if (ids !== undefined) {
500
- localVarQueryParameter['ids'] = ids;
501
- }
502
- if (owner_id !== undefined) {
503
- localVarQueryParameter['owner_id'] = owner_id;
504
- }
505
- if (deal_id !== undefined) {
506
- localVarQueryParameter['deal_id'] = deal_id;
507
- }
508
- if (lead_id !== undefined) {
509
- localVarQueryParameter['lead_id'] = lead_id;
510
- }
511
- if (person_id !== undefined) {
512
- localVarQueryParameter['person_id'] = person_id;
513
- }
514
- if (org_id !== undefined) {
515
- localVarQueryParameter['org_id'] = org_id;
516
- }
517
- if (updated_since !== undefined) {
518
- localVarQueryParameter['updated_since'] = updated_since;
519
- }
520
- if (updated_until !== undefined) {
521
- localVarQueryParameter['updated_until'] = updated_until;
522
- }
523
- if (sort_by !== undefined) {
524
- localVarQueryParameter['sort_by'] = sort_by;
525
- }
526
- if (sort_direction !== undefined) {
527
- localVarQueryParameter['sort_direction'] = sort_direction;
528
- }
529
- if (include_fields !== undefined) {
530
- localVarQueryParameter['include_fields'] = include_fields;
531
- }
532
- if (limit !== undefined) {
533
- localVarQueryParameter['limit'] = limit;
534
- }
535
- if (cursor !== undefined) {
536
- localVarQueryParameter['cursor'] = cursor;
537
- }
538
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
539
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
540
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
541
- return {
542
- url: (0, common_1.toPathString)(localVarUrlObj),
543
- options: localVarRequestOptions,
544
- };
545
- }),
546
- /**
547
- * Returns the details of a specific activity.
548
- * @summary Get details of an activity
549
- * @param {number} id The ID of the activity
550
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
551
-
552
- * @throws {RequiredError}
553
- */
554
- getActivity: (id, include_fields) => __awaiter(this, void 0, void 0, function* () {
555
- // verify required parameter 'id' is not null or undefined
556
- (0, common_1.assertParamExists)('getActivity', 'id', id);
557
- const localVarPath = `/activities/{id}`
558
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
559
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
560
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
561
- let baseOptions;
562
- if (configuration) {
563
- baseOptions = configuration.baseOptions;
564
- }
565
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
566
- const localVarHeaderParameter = {};
567
- const localVarQueryParameter = {};
568
- // authentication api_key required
569
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
570
- // authentication oauth2 required
571
- // oauth required
572
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration);
573
- if (include_fields !== undefined) {
574
- localVarQueryParameter['include_fields'] = include_fields;
575
- }
576
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
577
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
578
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
579
- return {
580
- url: (0, common_1.toPathString)(localVarUrlObj),
581
- options: localVarRequestOptions,
582
- };
583
- }),
584
- /**
585
- * Lists discounts attached to a deal.
586
- * @summary List discounts added to a deal
587
- * @param {number} id The ID of the deal
588
-
589
- * @throws {RequiredError}
590
- */
591
- getAdditionalDiscounts: (id) => __awaiter(this, void 0, void 0, function* () {
592
- // verify required parameter 'id' is not null or undefined
593
- (0, common_1.assertParamExists)('getAdditionalDiscounts', 'id', id);
594
- const localVarPath = `/deals/{id}/discounts`
595
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
596
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
597
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
598
- let baseOptions;
599
- if (configuration) {
600
- baseOptions = configuration.baseOptions;
601
- }
602
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
603
- const localVarHeaderParameter = {};
604
- const localVarQueryParameter = {};
605
- // authentication api_key required
606
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
607
- // authentication oauth2 required
608
- // oauth required
609
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
610
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
611
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
612
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
613
- return {
614
- url: (0, common_1.toPathString)(localVarUrlObj),
615
- options: localVarRequestOptions,
616
- };
617
- }),
618
- /**
619
- * Returns the details of a specific deal.
620
- * @summary Get details of a deal
621
- * @param {number} id The ID of the deal
622
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
623
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
624
-
625
- * @throws {RequiredError}
626
- */
627
- getDeal: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
628
- // verify required parameter 'id' is not null or undefined
629
- (0, common_1.assertParamExists)('getDeal', 'id', id);
630
- const localVarPath = `/deals/{id}`
631
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
632
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
633
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
634
- let baseOptions;
635
- if (configuration) {
636
- baseOptions = configuration.baseOptions;
637
- }
638
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
639
- const localVarHeaderParameter = {};
640
- const localVarQueryParameter = {};
641
- // authentication api_key required
642
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
643
- // authentication oauth2 required
644
- // oauth required
645
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
646
- if (include_fields !== undefined) {
647
- localVarQueryParameter['include_fields'] = include_fields;
648
- }
649
- if (custom_fields !== undefined) {
650
- localVarQueryParameter['custom_fields'] = custom_fields;
651
- }
652
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
653
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
654
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
655
- return {
656
- url: (0, common_1.toPathString)(localVarUrlObj),
657
- options: localVarRequestOptions,
658
- };
659
- }),
660
- /**
661
- * Lists products attached to a deal.
662
- * @summary List products attached to a deal
663
- * @param {number} id The ID of the deal
664
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
665
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
666
- * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
667
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
668
-
669
- * @throws {RequiredError}
670
- */
671
- getDealProducts: (id, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
672
- // verify required parameter 'id' is not null or undefined
673
- (0, common_1.assertParamExists)('getDealProducts', 'id', id);
674
- const localVarPath = `/deals/{id}/products`
675
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
676
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
677
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
678
- let baseOptions;
679
- if (configuration) {
680
- baseOptions = configuration.baseOptions;
681
- }
682
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
683
- const localVarHeaderParameter = {};
684
- const localVarQueryParameter = {};
685
- // authentication api_key required
686
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
687
- // authentication oauth2 required
688
- // oauth required
689
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
690
- if (cursor !== undefined) {
691
- localVarQueryParameter['cursor'] = cursor;
692
- }
693
- if (limit !== undefined) {
694
- localVarQueryParameter['limit'] = limit;
695
- }
696
- if (sort_by !== undefined) {
697
- localVarQueryParameter['sort_by'] = sort_by;
698
- }
699
- if (sort_direction !== undefined) {
700
- localVarQueryParameter['sort_direction'] = sort_direction;
701
- }
702
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
703
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
704
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
705
- return {
706
- url: (0, common_1.toPathString)(localVarUrlObj),
707
- options: localVarRequestOptions,
708
- };
709
- }),
710
- /**
711
- * Returns data about all deals.
712
- * @summary Get all deals
713
- * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
714
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
715
- * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
716
- * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
717
- * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
718
- * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
719
- * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
720
- * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.
721
- * @param {string} [updated_since] If set, only deals with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
722
- * @param {string} [updated_until] If set, only deals with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
723
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
724
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
725
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
726
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
727
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
728
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
729
-
730
- * @throws {RequiredError}
731
- */
732
- getDeals: (filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
733
- const localVarPath = `/deals`;
734
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
735
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
736
- let baseOptions;
737
- if (configuration) {
738
- baseOptions = configuration.baseOptions;
739
- }
740
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
741
- const localVarHeaderParameter = {};
742
- const localVarQueryParameter = {};
743
- // authentication api_key required
744
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
745
- // authentication oauth2 required
746
- // oauth required
747
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
748
- if (filter_id !== undefined) {
749
- localVarQueryParameter['filter_id'] = filter_id;
750
- }
751
- if (ids !== undefined) {
752
- localVarQueryParameter['ids'] = ids;
753
- }
754
- if (owner_id !== undefined) {
755
- localVarQueryParameter['owner_id'] = owner_id;
756
- }
757
- if (person_id !== undefined) {
758
- localVarQueryParameter['person_id'] = person_id;
759
- }
760
- if (org_id !== undefined) {
761
- localVarQueryParameter['org_id'] = org_id;
762
- }
763
- if (pipeline_id !== undefined) {
764
- localVarQueryParameter['pipeline_id'] = pipeline_id;
765
- }
766
- if (stage_id !== undefined) {
767
- localVarQueryParameter['stage_id'] = stage_id;
768
- }
769
- if (status !== undefined) {
770
- localVarQueryParameter['status'] = status;
771
- }
772
- if (updated_since !== undefined) {
773
- localVarQueryParameter['updated_since'] = updated_since;
774
- }
775
- if (updated_until !== undefined) {
776
- localVarQueryParameter['updated_until'] = updated_until;
777
- }
778
- if (sort_by !== undefined) {
779
- localVarQueryParameter['sort_by'] = sort_by;
780
- }
781
- if (sort_direction !== undefined) {
782
- localVarQueryParameter['sort_direction'] = sort_direction;
783
- }
784
- if (include_fields !== undefined) {
785
- localVarQueryParameter['include_fields'] = include_fields;
786
- }
787
- if (custom_fields !== undefined) {
788
- localVarQueryParameter['custom_fields'] = custom_fields;
789
- }
790
- if (limit !== undefined) {
791
- localVarQueryParameter['limit'] = limit;
792
- }
793
- if (cursor !== undefined) {
794
- localVarQueryParameter['cursor'] = cursor;
795
- }
796
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
797
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
798
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
799
- return {
800
- url: (0, common_1.toPathString)(localVarUrlObj),
801
- options: localVarRequestOptions,
802
- };
803
- }),
804
- /**
805
- * Returns data about products attached to deals
806
- * @summary Get deal products of several deals
807
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided.
808
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
809
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
810
- * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;deal_id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
811
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
812
-
813
- * @throws {RequiredError}
814
- */
815
- getDealsProducts: (deal_ids, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
816
- // verify required parameter 'deal_ids' is not null or undefined
817
- (0, common_1.assertParamExists)('getDealsProducts', 'deal_ids', deal_ids);
818
- const localVarPath = `/deals/products`;
819
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
820
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
821
- let baseOptions;
822
- if (configuration) {
823
- baseOptions = configuration.baseOptions;
824
- }
825
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
826
- const localVarHeaderParameter = {};
827
- const localVarQueryParameter = {};
828
- // authentication api_key required
829
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
830
- // authentication oauth2 required
831
- // oauth required
832
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
833
- if (deal_ids) {
834
- localVarQueryParameter['deal_ids'] = deal_ids;
835
- }
836
- if (cursor !== undefined) {
837
- localVarQueryParameter['cursor'] = cursor;
838
- }
839
- if (limit !== undefined) {
840
- localVarQueryParameter['limit'] = limit;
841
- }
842
- if (sort_by !== undefined) {
843
- localVarQueryParameter['sort_by'] = sort_by;
844
- }
845
- if (sort_direction !== undefined) {
846
- localVarQueryParameter['sort_direction'] = sort_direction;
847
- }
848
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
849
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
850
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
851
- return {
852
- url: (0, common_1.toPathString)(localVarUrlObj),
853
- options: localVarRequestOptions,
854
- };
855
- }),
856
- /**
857
- * Lists installments attached to a list of deals. Only available in Advanced and above plans.
858
- * @summary List installments added to a list of deals
859
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
860
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
861
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
862
- * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
863
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
864
-
865
- * @throws {RequiredError}
866
- */
867
- getInstallments: (deal_ids, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
868
- // verify required parameter 'deal_ids' is not null or undefined
869
- (0, common_1.assertParamExists)('getInstallments', 'deal_ids', deal_ids);
870
- const localVarPath = `/deals/installments`;
871
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
872
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
873
- let baseOptions;
874
- if (configuration) {
875
- baseOptions = configuration.baseOptions;
876
- }
877
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
878
- const localVarHeaderParameter = {};
879
- const localVarQueryParameter = {};
880
- // authentication api_key required
881
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
882
- // authentication oauth2 required
883
- // oauth required
884
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
885
- if (deal_ids) {
886
- localVarQueryParameter['deal_ids'] = deal_ids;
887
- }
888
- if (cursor !== undefined) {
889
- localVarQueryParameter['cursor'] = cursor;
890
- }
891
- if (limit !== undefined) {
892
- localVarQueryParameter['limit'] = limit;
893
- }
894
- if (sort_by !== undefined) {
895
- localVarQueryParameter['sort_by'] = sort_by;
896
- }
897
- if (sort_direction !== undefined) {
898
- localVarQueryParameter['sort_direction'] = sort_direction;
899
- }
900
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
901
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
902
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
903
- return {
904
- url: (0, common_1.toPathString)(localVarUrlObj),
905
- options: localVarRequestOptions,
906
- };
907
- }),
908
- /**
909
- * Returns the details of a specific organization.
910
- * @summary Get details of a organization
911
- * @param {number} id The ID of the organization
912
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
913
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
914
-
915
- * @throws {RequiredError}
916
- */
917
- getOrganization: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
918
- // verify required parameter 'id' is not null or undefined
919
- (0, common_1.assertParamExists)('getOrganization', 'id', id);
920
- const localVarPath = `/organizations/{id}`
921
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
922
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
923
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
924
- let baseOptions;
925
- if (configuration) {
926
- baseOptions = configuration.baseOptions;
927
- }
928
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
929
- const localVarHeaderParameter = {};
930
- const localVarQueryParameter = {};
931
- // authentication api_key required
932
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
933
- // authentication oauth2 required
934
- // oauth required
935
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
936
- if (include_fields !== undefined) {
937
- localVarQueryParameter['include_fields'] = include_fields;
938
- }
939
- if (custom_fields !== undefined) {
940
- localVarQueryParameter['custom_fields'] = custom_fields;
941
- }
942
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
943
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
944
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
945
- return {
946
- url: (0, common_1.toPathString)(localVarUrlObj),
947
- options: localVarRequestOptions,
948
- };
949
- }),
950
- /**
951
- * Returns data about all organizations.
952
- * @summary Get all organizations
953
- * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned
954
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
955
- * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored.
956
- * @param {string} [updated_since] If set, only organizations with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
957
- * @param {string} [updated_until] If set, only organizations with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
958
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
959
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
960
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
961
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
962
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
963
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
964
-
965
- * @throws {RequiredError}
966
- */
967
- getOrganizations: (filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
968
- const localVarPath = `/organizations`;
969
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
970
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
971
- let baseOptions;
972
- if (configuration) {
973
- baseOptions = configuration.baseOptions;
974
- }
975
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
976
- const localVarHeaderParameter = {};
977
- const localVarQueryParameter = {};
978
- // authentication api_key required
979
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
980
- // authentication oauth2 required
981
- // oauth required
982
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
983
- if (filter_id !== undefined) {
984
- localVarQueryParameter['filter_id'] = filter_id;
985
- }
986
- if (ids !== undefined) {
987
- localVarQueryParameter['ids'] = ids;
988
- }
989
- if (owner_id !== undefined) {
990
- localVarQueryParameter['owner_id'] = owner_id;
991
- }
992
- if (updated_since !== undefined) {
993
- localVarQueryParameter['updated_since'] = updated_since;
994
- }
995
- if (updated_until !== undefined) {
996
- localVarQueryParameter['updated_until'] = updated_until;
997
- }
998
- if (sort_by !== undefined) {
999
- localVarQueryParameter['sort_by'] = sort_by;
1000
- }
1001
- if (sort_direction !== undefined) {
1002
- localVarQueryParameter['sort_direction'] = sort_direction;
1003
- }
1004
- if (include_fields !== undefined) {
1005
- localVarQueryParameter['include_fields'] = include_fields;
1006
- }
1007
- if (custom_fields !== undefined) {
1008
- localVarQueryParameter['custom_fields'] = custom_fields;
1009
- }
1010
- if (limit !== undefined) {
1011
- localVarQueryParameter['limit'] = limit;
1012
- }
1013
- if (cursor !== undefined) {
1014
- localVarQueryParameter['cursor'] = cursor;
1015
- }
1016
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1017
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1018
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1019
- return {
1020
- url: (0, common_1.toPathString)(localVarUrlObj),
1021
- options: localVarRequestOptions,
1022
- };
1023
- }),
1024
- /**
1025
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
1026
- * @summary Get details of a person
1027
- * @param {number} id The ID of the person
1028
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
1029
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1030
-
1031
- * @throws {RequiredError}
1032
- */
1033
- getPerson: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
1034
- // verify required parameter 'id' is not null or undefined
1035
- (0, common_1.assertParamExists)('getPerson', 'id', id);
1036
- const localVarPath = `/persons/{id}`
1037
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1038
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1039
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1040
- let baseOptions;
1041
- if (configuration) {
1042
- baseOptions = configuration.baseOptions;
1043
- }
1044
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1045
- const localVarHeaderParameter = {};
1046
- const localVarQueryParameter = {};
1047
- // authentication api_key required
1048
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1049
- // authentication oauth2 required
1050
- // oauth required
1051
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
1052
- if (include_fields !== undefined) {
1053
- localVarQueryParameter['include_fields'] = include_fields;
1054
- }
1055
- if (custom_fields !== undefined) {
1056
- localVarQueryParameter['custom_fields'] = custom_fields;
1057
- }
1058
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1059
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1060
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1061
- return {
1062
- url: (0, common_1.toPathString)(localVarUrlObj),
1063
- options: localVarRequestOptions,
1064
- };
1065
- }),
1066
- /**
1067
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
1068
- * @summary Get all persons
1069
- * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned
1070
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
1071
- * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
1072
- * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
1073
- * @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1074
- * @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1075
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
1076
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1077
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
1078
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1079
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1080
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1081
-
1082
- * @throws {RequiredError}
1083
- */
1084
- getPersons: (filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1085
- const localVarPath = `/persons`;
1086
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1087
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1088
- let baseOptions;
1089
- if (configuration) {
1090
- baseOptions = configuration.baseOptions;
1091
- }
1092
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1093
- const localVarHeaderParameter = {};
1094
- const localVarQueryParameter = {};
1095
- // authentication api_key required
1096
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1097
- // authentication oauth2 required
1098
- // oauth required
1099
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
1100
- if (filter_id !== undefined) {
1101
- localVarQueryParameter['filter_id'] = filter_id;
1102
- }
1103
- if (ids !== undefined) {
1104
- localVarQueryParameter['ids'] = ids;
1105
- }
1106
- if (owner_id !== undefined) {
1107
- localVarQueryParameter['owner_id'] = owner_id;
1108
- }
1109
- if (org_id !== undefined) {
1110
- localVarQueryParameter['org_id'] = org_id;
1111
- }
1112
- if (updated_since !== undefined) {
1113
- localVarQueryParameter['updated_since'] = updated_since;
1114
- }
1115
- if (updated_until !== undefined) {
1116
- localVarQueryParameter['updated_until'] = updated_until;
1117
- }
1118
- if (sort_by !== undefined) {
1119
- localVarQueryParameter['sort_by'] = sort_by;
1120
- }
1121
- if (sort_direction !== undefined) {
1122
- localVarQueryParameter['sort_direction'] = sort_direction;
1123
- }
1124
- if (include_fields !== undefined) {
1125
- localVarQueryParameter['include_fields'] = include_fields;
1126
- }
1127
- if (custom_fields !== undefined) {
1128
- localVarQueryParameter['custom_fields'] = custom_fields;
1129
- }
1130
- if (limit !== undefined) {
1131
- localVarQueryParameter['limit'] = limit;
1132
- }
1133
- if (cursor !== undefined) {
1134
- localVarQueryParameter['cursor'] = cursor;
1135
- }
1136
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1137
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1138
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1139
- return {
1140
- url: (0, common_1.toPathString)(localVarUrlObj),
1141
- options: localVarRequestOptions,
1142
- };
1143
- }),
1144
- /**
1145
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
1146
- * @summary Add a discount to a deal
1147
- * @param {number} id The ID of the deal
1148
- * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody]
1149
-
1150
- * @throws {RequiredError}
1151
- */
1152
- postAdditionalDiscount: (id, AddAdditionalDiscountRequestBody) => __awaiter(this, void 0, void 0, function* () {
1153
- // verify required parameter 'id' is not null or undefined
1154
- (0, common_1.assertParamExists)('postAdditionalDiscount', 'id', id);
1155
- const localVarPath = `/deals/{id}/discounts`
1156
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1157
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1158
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1159
- let baseOptions;
1160
- if (configuration) {
1161
- baseOptions = configuration.baseOptions;
1162
- }
1163
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
1164
- const localVarHeaderParameter = {};
1165
- const localVarQueryParameter = {};
1166
- // authentication api_key required
1167
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1168
- // authentication oauth2 required
1169
- // oauth required
1170
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1171
- localVarHeaderParameter['Content-Type'] = 'application/json';
1172
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1173
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1174
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1175
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddAdditionalDiscountRequestBody, localVarRequestOptions, configuration);
1176
- return {
1177
- url: (0, common_1.toPathString)(localVarUrlObj),
1178
- options: localVarRequestOptions,
1179
- };
1180
- }),
1181
- /**
1182
- * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
1183
- * @summary Add an installment to a deal
1184
- * @param {number} id The ID of the deal
1185
- * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
1186
-
1187
- * @throws {RequiredError}
1188
- */
1189
- postInstallment: (id, AddInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
1190
- // verify required parameter 'id' is not null or undefined
1191
- (0, common_1.assertParamExists)('postInstallment', 'id', id);
1192
- const localVarPath = `/deals/{id}/installments`
1193
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1194
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1195
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1196
- let baseOptions;
1197
- if (configuration) {
1198
- baseOptions = configuration.baseOptions;
1199
- }
1200
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
1201
- const localVarHeaderParameter = {};
1202
- const localVarQueryParameter = {};
1203
- // authentication api_key required
1204
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1205
- // authentication oauth2 required
1206
- // oauth required
1207
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1208
- localVarHeaderParameter['Content-Type'] = 'application/json';
1209
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1210
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1211
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1212
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddInstallmentRequestBody, localVarRequestOptions, configuration);
1213
- return {
1214
- url: (0, common_1.toPathString)(localVarUrlObj),
1215
- options: localVarRequestOptions,
1216
- };
1217
- }),
1218
- /**
1219
- * Searches all deals 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 deals can be filtered by the person ID and the organization ID.
1220
- * @summary Search deals
1221
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1222
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1223
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1224
- * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000.
1225
- * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000.
1226
- * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open &#x3D; Open, won &#x3D; Won, lost &#x3D; Lost. The upper limit of found deals associated with the status is 2000.
1227
- * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default
1228
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1229
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1230
-
1231
- * @throws {RequiredError}
1232
- */
1233
- searchDeals: (term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1234
- // verify required parameter 'term' is not null or undefined
1235
- (0, common_1.assertParamExists)('searchDeals', 'term', term);
1236
- const localVarPath = `/deals/search`;
1237
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1238
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1239
- let baseOptions;
1240
- if (configuration) {
1241
- baseOptions = configuration.baseOptions;
1242
- }
1243
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1244
- const localVarHeaderParameter = {};
1245
- const localVarQueryParameter = {};
1246
- // authentication api_key required
1247
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1248
- // authentication oauth2 required
1249
- // oauth required
1250
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full", "search:read"], configuration);
1251
- if (term !== undefined) {
1252
- localVarQueryParameter['term'] = term;
1253
- }
1254
- if (fields !== undefined) {
1255
- localVarQueryParameter['fields'] = fields;
1256
- }
1257
- if (exact_match !== undefined) {
1258
- localVarQueryParameter['exact_match'] = exact_match;
1259
- }
1260
- if (person_id !== undefined) {
1261
- localVarQueryParameter['person_id'] = person_id;
1262
- }
1263
- if (organization_id !== undefined) {
1264
- localVarQueryParameter['organization_id'] = organization_id;
1265
- }
1266
- if (status !== undefined) {
1267
- localVarQueryParameter['status'] = status;
1268
- }
1269
- if (include_fields !== undefined) {
1270
- localVarQueryParameter['include_fields'] = include_fields;
1271
- }
1272
- if (limit !== undefined) {
1273
- localVarQueryParameter['limit'] = limit;
1274
- }
1275
- if (cursor !== undefined) {
1276
- localVarQueryParameter['cursor'] = cursor;
1277
- }
1278
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1279
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1280
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1281
- return {
1282
- url: (0, common_1.toPathString)(localVarUrlObj),
1283
- options: localVarRequestOptions,
1284
- };
1285
- }),
1286
- /**
1287
- * Performs a search from your choice of item types and fields.
1288
- * @summary Perform a search from multiple item types
1289
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1290
- * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all.
1291
- * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:&lt;br&gt; &lt;table&gt; &lt;tr&gt;&lt;th&gt;&lt;b&gt;Item type&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Field&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Deal&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Person&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;email&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;, &#x60;phone&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Organization&lt;/td&gt;&lt;td&gt;&#x60;address&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;&#x60;code&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Lead&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;email&#x60;, &#x60;organization_name&#x60;, &#x60;person_name&#x60;, &#x60;phone&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;File&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Mail attachment&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Project&lt;/td&gt;&lt;td&gt; &#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;, &#x60;description&#x60; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;br&gt; Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.&lt;br/&gt; When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use &#x60;search_for_related_items&#x60;.
1292
- * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization
1293
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1294
- * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default.
1295
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1296
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1297
-
1298
- * @throws {RequiredError}
1299
- */
1300
- searchItem: (term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1301
- // verify required parameter 'term' is not null or undefined
1302
- (0, common_1.assertParamExists)('searchItem', 'term', term);
1303
- const localVarPath = `/itemSearch`;
1304
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1305
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1306
- let baseOptions;
1307
- if (configuration) {
1308
- baseOptions = configuration.baseOptions;
1309
- }
1310
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1311
- const localVarHeaderParameter = {};
1312
- const localVarQueryParameter = {};
1313
- // authentication api_key required
1314
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1315
- // authentication oauth2 required
1316
- // oauth required
1317
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);
1318
- if (term !== undefined) {
1319
- localVarQueryParameter['term'] = term;
1320
- }
1321
- if (item_types !== undefined) {
1322
- localVarQueryParameter['item_types'] = item_types;
1323
- }
1324
- if (fields !== undefined) {
1325
- localVarQueryParameter['fields'] = fields;
1326
- }
1327
- if (search_for_related_items !== undefined) {
1328
- localVarQueryParameter['search_for_related_items'] = search_for_related_items;
1329
- }
1330
- if (exact_match !== undefined) {
1331
- localVarQueryParameter['exact_match'] = exact_match;
1332
- }
1333
- if (include_fields !== undefined) {
1334
- localVarQueryParameter['include_fields'] = include_fields;
1335
- }
1336
- if (limit !== undefined) {
1337
- localVarQueryParameter['limit'] = limit;
1338
- }
1339
- if (cursor !== undefined) {
1340
- localVarQueryParameter['cursor'] = cursor;
1341
- }
1342
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1343
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1344
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1345
- return {
1346
- url: (0, common_1.toPathString)(localVarUrlObj),
1347
- options: localVarRequestOptions,
1348
- };
1349
- }),
1350
- /**
1351
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
1352
- * @summary Perform a search using a specific field from an item type
1353
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if &#x60;match&#x60; is &#x60;exact&#x60;). Please note that the search term has to be URL encoded.
1354
- * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from
1355
- * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\&#39; API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1356
- * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search &lt;b&gt;is&lt;/b&gt; case sensitive.&lt;br/&gt;&lt;br/&gt; E.g. in case of searching for a value &#x60;monkey&#x60;, &lt;ul&gt; &lt;li&gt;with &#x60;exact&#x60; match, you will only find it if term is &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;beginning&#x60; match, you will only find it if the term matches the beginning or the whole string, e.g. &#x60;monk&#x60; and &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;middle&#x60; match, you will find the it if the term matches any substring of the value, e.g. &#x60;onk&#x60; and &#x60;ke&#x60;&lt;/li&gt; &lt;/ul&gt;.
1357
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1358
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1359
-
1360
- * @throws {RequiredError}
1361
- */
1362
- searchItemByField: (term, entity_type, field, match, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1363
- // verify required parameter 'term' is not null or undefined
1364
- (0, common_1.assertParamExists)('searchItemByField', 'term', term);
1365
- // verify required parameter 'entity_type' is not null or undefined
1366
- (0, common_1.assertParamExists)('searchItemByField', 'entity_type', entity_type);
1367
- // verify required parameter 'field' is not null or undefined
1368
- (0, common_1.assertParamExists)('searchItemByField', 'field', field);
1369
- const localVarPath = `/itemSearch/field`;
1370
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1371
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1372
- let baseOptions;
1373
- if (configuration) {
1374
- baseOptions = configuration.baseOptions;
1375
- }
1376
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1377
- const localVarHeaderParameter = {};
1378
- const localVarQueryParameter = {};
1379
- // authentication api_key required
1380
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1381
- // authentication oauth2 required
1382
- // oauth required
1383
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);
1384
- if (term !== undefined) {
1385
- localVarQueryParameter['term'] = term;
1386
- }
1387
- if (entity_type !== undefined) {
1388
- localVarQueryParameter['entity_type'] = entity_type;
1389
- }
1390
- if (match !== undefined) {
1391
- localVarQueryParameter['match'] = match;
1392
- }
1393
- if (field !== undefined) {
1394
- localVarQueryParameter['field'] = field;
1395
- }
1396
- if (limit !== undefined) {
1397
- localVarQueryParameter['limit'] = limit;
1398
- }
1399
- if (cursor !== undefined) {
1400
- localVarQueryParameter['cursor'] = cursor;
1401
- }
1402
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1403
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1404
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1405
- return {
1406
- url: (0, common_1.toPathString)(localVarUrlObj),
1407
- options: localVarRequestOptions,
1408
- };
1409
- }),
1410
- /**
1411
- * 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.
1412
- * @summary Search leads
1413
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1414
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them.
1415
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1416
- * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000.
1417
- * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000.
1418
- * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default
1419
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1420
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1421
-
1422
- * @throws {RequiredError}
1423
- */
1424
- searchLeads: (term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1425
- // verify required parameter 'term' is not null or undefined
1426
- (0, common_1.assertParamExists)('searchLeads', 'term', term);
1427
- const localVarPath = `/leads/search`;
1428
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1429
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1430
- let baseOptions;
1431
- if (configuration) {
1432
- baseOptions = configuration.baseOptions;
1433
- }
1434
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1435
- const localVarHeaderParameter = {};
1436
- const localVarQueryParameter = {};
1437
- // authentication api_key required
1438
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1439
- // authentication oauth2 required
1440
- // oauth required
1441
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "search:read"], configuration);
1442
- if (term !== undefined) {
1443
- localVarQueryParameter['term'] = term;
1444
- }
1445
- if (fields !== undefined) {
1446
- localVarQueryParameter['fields'] = fields;
1447
- }
1448
- if (exact_match !== undefined) {
1449
- localVarQueryParameter['exact_match'] = exact_match;
1450
- }
1451
- if (person_id !== undefined) {
1452
- localVarQueryParameter['person_id'] = person_id;
1453
- }
1454
- if (organization_id !== undefined) {
1455
- localVarQueryParameter['organization_id'] = organization_id;
1456
- }
1457
- if (include_fields !== undefined) {
1458
- localVarQueryParameter['include_fields'] = include_fields;
1459
- }
1460
- if (limit !== undefined) {
1461
- localVarQueryParameter['limit'] = limit;
1462
- }
1463
- if (cursor !== undefined) {
1464
- localVarQueryParameter['cursor'] = cursor;
1465
- }
1466
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1467
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1468
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1469
- return {
1470
- url: (0, common_1.toPathString)(localVarUrlObj),
1471
- options: localVarRequestOptions,
1472
- };
1473
- }),
1474
- /**
1475
- * Searches all organizations by name, address, 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.
1476
- * @summary Search organizations
1477
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1478
- * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1479
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1480
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1481
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1482
-
1483
- * @throws {RequiredError}
1484
- */
1485
- searchOrganization: (term, fields, exact_match, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1486
- // verify required parameter 'term' is not null or undefined
1487
- (0, common_1.assertParamExists)('searchOrganization', 'term', term);
1488
- const localVarPath = `/organizations/search`;
1489
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1490
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1491
- let baseOptions;
1492
- if (configuration) {
1493
- baseOptions = configuration.baseOptions;
1494
- }
1495
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1496
- const localVarHeaderParameter = {};
1497
- const localVarQueryParameter = {};
1498
- // authentication api_key required
1499
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1500
- // authentication oauth2 required
1501
- // oauth required
1502
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration);
1503
- if (term !== undefined) {
1504
- localVarQueryParameter['term'] = term;
1505
- }
1506
- if (fields !== undefined) {
1507
- localVarQueryParameter['fields'] = fields;
1508
- }
1509
- if (exact_match !== undefined) {
1510
- localVarQueryParameter['exact_match'] = exact_match;
1511
- }
1512
- if (limit !== undefined) {
1513
- localVarQueryParameter['limit'] = limit;
1514
- }
1515
- if (cursor !== undefined) {
1516
- localVarQueryParameter['cursor'] = cursor;
1517
- }
1518
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1519
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1520
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1521
- return {
1522
- url: (0, common_1.toPathString)(localVarUrlObj),
1523
- options: localVarRequestOptions,
1524
- };
1525
- }),
1526
- /**
1527
- * Searches all persons by name, email, phone, 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 persons can be filtered by organization ID.
1528
- * @summary Search persons
1529
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1530
- * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1531
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1532
- * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000.
1533
- * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default
1534
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1535
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1536
-
1537
- * @throws {RequiredError}
1538
- */
1539
- searchPersons: (term, fields, exact_match, organization_id, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1540
- // verify required parameter 'term' is not null or undefined
1541
- (0, common_1.assertParamExists)('searchPersons', 'term', term);
1542
- const localVarPath = `/persons/search`;
1543
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1544
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1545
- let baseOptions;
1546
- if (configuration) {
1547
- baseOptions = configuration.baseOptions;
1548
- }
1549
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1550
- const localVarHeaderParameter = {};
1551
- const localVarQueryParameter = {};
1552
- // authentication api_key required
1553
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1554
- // authentication oauth2 required
1555
- // oauth required
1556
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration);
1557
- if (term !== undefined) {
1558
- localVarQueryParameter['term'] = term;
1559
- }
1560
- if (fields !== undefined) {
1561
- localVarQueryParameter['fields'] = fields;
1562
- }
1563
- if (exact_match !== undefined) {
1564
- localVarQueryParameter['exact_match'] = exact_match;
1565
- }
1566
- if (organization_id !== undefined) {
1567
- localVarQueryParameter['organization_id'] = organization_id;
1568
- }
1569
- if (include_fields !== undefined) {
1570
- localVarQueryParameter['include_fields'] = include_fields;
1571
- }
1572
- if (limit !== undefined) {
1573
- localVarQueryParameter['limit'] = limit;
1574
- }
1575
- if (cursor !== undefined) {
1576
- localVarQueryParameter['cursor'] = cursor;
1577
- }
1578
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1579
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1580
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1581
- return {
1582
- url: (0, common_1.toPathString)(localVarUrlObj),
1583
- options: localVarRequestOptions,
1584
- };
1585
- }),
1586
- /**
1587
- * Updates the properties of an activity.
1588
- * @summary Update an activity
1589
- * @param {number} id The ID of the activity
1590
- * @param {AddActivityRequest} [AddActivityRequest]
1591
-
1592
- * @throws {RequiredError}
1593
- */
1594
- updateActivity: (id, AddActivityRequest) => __awaiter(this, void 0, void 0, function* () {
1595
- // verify required parameter 'id' is not null or undefined
1596
- (0, common_1.assertParamExists)('updateActivity', 'id', id);
1597
- const localVarPath = `/activities/{id}`
1598
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1599
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1600
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1601
- let baseOptions;
1602
- if (configuration) {
1603
- baseOptions = configuration.baseOptions;
1604
- }
1605
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1606
- const localVarHeaderParameter = {};
1607
- const localVarQueryParameter = {};
1608
- // authentication api_key required
1609
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1610
- // authentication oauth2 required
1611
- // oauth required
1612
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
1613
- localVarHeaderParameter['Content-Type'] = 'application/json';
1614
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1615
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1616
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1617
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddActivityRequest, localVarRequestOptions, configuration);
1618
- return {
1619
- url: (0, common_1.toPathString)(localVarUrlObj),
1620
- options: localVarRequestOptions,
1621
- };
1622
- }),
1623
- /**
1624
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
1625
- * @summary Update a discount added to a deal
1626
- * @param {number} id The ID of the deal
1627
- * @param {number} discount_id The ID of the discount
1628
- * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody]
1629
-
1630
- * @throws {RequiredError}
1631
- */
1632
- updateAdditionalDiscount: (id, discount_id, UpdateAdditionalDiscountRequestBody) => __awaiter(this, void 0, void 0, function* () {
1633
- // verify required parameter 'id' is not null or undefined
1634
- (0, common_1.assertParamExists)('updateAdditionalDiscount', 'id', id);
1635
- // verify required parameter 'discount_id' is not null or undefined
1636
- (0, common_1.assertParamExists)('updateAdditionalDiscount', 'discount_id', discount_id);
1637
- const localVarPath = `/deals/{id}/discounts/{discount_id}`
1638
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
1639
- .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id)));
1640
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1641
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1642
- let baseOptions;
1643
- if (configuration) {
1644
- baseOptions = configuration.baseOptions;
1645
- }
1646
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1647
- const localVarHeaderParameter = {};
1648
- const localVarQueryParameter = {};
1649
- // authentication api_key required
1650
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1651
- // authentication oauth2 required
1652
- // oauth required
1653
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1654
- localVarHeaderParameter['Content-Type'] = 'application/json';
1655
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1656
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1657
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1658
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateAdditionalDiscountRequestBody, localVarRequestOptions, configuration);
1659
- return {
1660
- url: (0, common_1.toPathString)(localVarUrlObj),
1661
- options: localVarRequestOptions,
1662
- };
1663
- }),
1664
- /**
1665
- * Updates the properties of a deal.
1666
- * @summary Update a deal
1667
- * @param {number} id The ID of the deal
1668
- * @param {UpdateDealRequest} [UpdateDealRequest]
1669
-
1670
- * @throws {RequiredError}
1671
- */
1672
- updateDeal: (id, UpdateDealRequest) => __awaiter(this, void 0, void 0, function* () {
1673
- // verify required parameter 'id' is not null or undefined
1674
- (0, common_1.assertParamExists)('updateDeal', 'id', id);
1675
- const localVarPath = `/deals/{id}`
1676
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1677
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1678
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1679
- let baseOptions;
1680
- if (configuration) {
1681
- baseOptions = configuration.baseOptions;
1682
- }
1683
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1684
- const localVarHeaderParameter = {};
1685
- const localVarQueryParameter = {};
1686
- // authentication api_key required
1687
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1688
- // authentication oauth2 required
1689
- // oauth required
1690
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
1691
- localVarHeaderParameter['Content-Type'] = 'application/json';
1692
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1693
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1694
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1695
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateDealRequest, localVarRequestOptions, configuration);
1696
- return {
1697
- url: (0, common_1.toPathString)(localVarUrlObj),
1698
- options: localVarRequestOptions,
1699
- };
1700
- }),
1701
- /**
1702
- * Updates the details of the product that has been attached to a deal.
1703
- * @summary Update the product attached to a deal
1704
- * @param {number} id The ID of the deal
1705
- * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal)
1706
- * @param {UpdateDealProductRequest} [UpdateDealProductRequest]
1707
-
1708
- * @throws {RequiredError}
1709
- */
1710
- updateDealProduct: (id, product_attachment_id, UpdateDealProductRequest) => __awaiter(this, void 0, void 0, function* () {
1711
- // verify required parameter 'id' is not null or undefined
1712
- (0, common_1.assertParamExists)('updateDealProduct', 'id', id);
1713
- // verify required parameter 'product_attachment_id' is not null or undefined
1714
- (0, common_1.assertParamExists)('updateDealProduct', 'product_attachment_id', product_attachment_id);
1715
- const localVarPath = `/deals/{id}/products/{product_attachment_id}`
1716
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
1717
- .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id)));
1718
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1719
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1720
- let baseOptions;
1721
- if (configuration) {
1722
- baseOptions = configuration.baseOptions;
1723
- }
1724
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1725
- const localVarHeaderParameter = {};
1726
- const localVarQueryParameter = {};
1727
- // authentication api_key required
1728
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1729
- // authentication oauth2 required
1730
- // oauth required
1731
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
1732
- localVarHeaderParameter['Content-Type'] = 'application/json';
1733
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1734
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1735
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1736
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateDealProductRequest, localVarRequestOptions, configuration);
1737
- return {
1738
- url: (0, common_1.toPathString)(localVarUrlObj),
1739
- options: localVarRequestOptions,
1740
- };
1741
- }),
1742
- /**
1743
- * Edits an installment added to a deal. Only available in Advanced and above plans.
1744
- * @summary Update an installment added to a deal
1745
- * @param {number} id The ID of the deal
1746
- * @param {number} installment_id The ID of the installment
1747
- * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
1748
-
1749
- * @throws {RequiredError}
1750
- */
1751
- updateInstallment: (id, installment_id, UpdateInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
1752
- // verify required parameter 'id' is not null or undefined
1753
- (0, common_1.assertParamExists)('updateInstallment', 'id', id);
1754
- // verify required parameter 'installment_id' is not null or undefined
1755
- (0, common_1.assertParamExists)('updateInstallment', 'installment_id', installment_id);
1756
- const localVarPath = `/deals/{id}/installments/{installment_id}`
1757
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
1758
- .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
1759
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1760
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1761
- let baseOptions;
1762
- if (configuration) {
1763
- baseOptions = configuration.baseOptions;
1764
- }
1765
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1766
- const localVarHeaderParameter = {};
1767
- const localVarQueryParameter = {};
1768
- // authentication api_key required
1769
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1770
- // authentication oauth2 required
1771
- // oauth required
1772
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1773
- localVarHeaderParameter['Content-Type'] = 'application/json';
1774
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1775
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1776
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1777
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateInstallmentRequestBody, localVarRequestOptions, configuration);
1778
- return {
1779
- url: (0, common_1.toPathString)(localVarUrlObj),
1780
- options: localVarRequestOptions,
1781
- };
1782
- }),
1783
- /**
1784
- * Updates the properties of a organization.
1785
- * @summary Update a organization
1786
- * @param {number} id The ID of the organization
1787
- * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest]
1788
-
1789
- * @throws {RequiredError}
1790
- */
1791
- updateOrganization: (id, UpdateOrganizationRequest) => __awaiter(this, void 0, void 0, function* () {
1792
- // verify required parameter 'id' is not null or undefined
1793
- (0, common_1.assertParamExists)('updateOrganization', 'id', id);
1794
- const localVarPath = `/organizations/{id}`
1795
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1796
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1797
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1798
- let baseOptions;
1799
- if (configuration) {
1800
- baseOptions = configuration.baseOptions;
1801
- }
1802
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1803
- const localVarHeaderParameter = {};
1804
- const localVarQueryParameter = {};
1805
- // authentication api_key required
1806
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1807
- // authentication oauth2 required
1808
- // oauth required
1809
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
1810
- localVarHeaderParameter['Content-Type'] = 'application/json';
1811
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1812
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1813
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1814
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateOrganizationRequest, localVarRequestOptions, configuration);
1815
- return {
1816
- url: (0, common_1.toPathString)(localVarUrlObj),
1817
- options: localVarRequestOptions,
1818
- };
1819
- }),
1820
- /**
1821
- * Updates the properties of a person.
1822
- * @summary Update a person
1823
- * @param {number} id The ID of the person
1824
- * @param {UpdatePersonRequest} [UpdatePersonRequest]
1825
-
1826
- * @throws {RequiredError}
1827
- */
1828
- updatePerson: (id, UpdatePersonRequest) => __awaiter(this, void 0, void 0, function* () {
1829
- // verify required parameter 'id' is not null or undefined
1830
- (0, common_1.assertParamExists)('updatePerson', 'id', id);
1831
- const localVarPath = `/persons/{id}`
1832
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1833
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1834
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1835
- let baseOptions;
1836
- if (configuration) {
1837
- baseOptions = configuration.baseOptions;
1838
- }
1839
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1840
- const localVarHeaderParameter = {};
1841
- const localVarQueryParameter = {};
1842
- // authentication api_key required
1843
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1844
- // authentication oauth2 required
1845
- // oauth required
1846
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
1847
- localVarHeaderParameter['Content-Type'] = 'application/json';
1848
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1849
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1850
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1851
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdatePersonRequest, localVarRequestOptions, configuration);
1852
- return {
1853
- url: (0, common_1.toPathString)(localVarUrlObj),
1854
- options: localVarRequestOptions,
1855
- };
1856
- }),
1857
- };
1858
- };
1859
- exports.BetaApiAxiosParamCreator = BetaApiAxiosParamCreator;
1860
- /**
1861
- * BetaApi - functional programming interface
1862
- * @export
1863
- */
1864
- const BetaApiFp = function (configuration) {
1865
- const localVarAxiosParamCreator = (0, exports.BetaApiAxiosParamCreator)(configuration);
1866
- return {
1867
- /**
1868
- * Adds a new activity.
1869
- * @summary Add a new activity
1870
- * @param {AddActivityRequest} [AddActivityRequest]
1871
-
1872
- * @throws {RequiredError}
1873
- */
1874
- addActivity(AddActivityRequest) {
1875
- return __awaiter(this, void 0, void 0, function* () {
1876
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addActivity(AddActivityRequest);
1877
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1878
- });
1879
- },
1880
- /**
1881
- * Adds a new deal.
1882
- * @summary Add a new deal
1883
- * @param {AddDealRequest} [AddDealRequest]
1884
-
1885
- * @throws {RequiredError}
1886
- */
1887
- addDeal(AddDealRequest) {
1888
- return __awaiter(this, void 0, void 0, function* () {
1889
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addDeal(AddDealRequest);
1890
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1891
- });
1892
- },
1893
- /**
1894
- * Adds a product to a deal, creating a new item called a deal-product.
1895
- * @summary Add a product to a deal
1896
- * @param {number} id The ID of the deal
1897
- * @param {AddDealProductRequest} [AddDealProductRequest]
1898
-
1899
- * @throws {RequiredError}
1900
- */
1901
- addDealProduct(id, AddDealProductRequest) {
1902
- return __awaiter(this, void 0, void 0, function* () {
1903
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest);
1904
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1905
- });
1906
- },
1907
- /**
1908
- * Adds a new organization.
1909
- * @summary Add a new organization
1910
- * @param {AddOrganizationRequest} [AddOrganizationRequest]
1911
-
1912
- * @throws {RequiredError}
1913
- */
1914
- addOrganization(AddOrganizationRequest) {
1915
- return __awaiter(this, void 0, void 0, function* () {
1916
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addOrganization(AddOrganizationRequest);
1917
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1918
- });
1919
- },
1920
- /**
1921
- * Adds a new person.
1922
- * @summary Add a new person
1923
- * @param {AddPersonRequest} [AddPersonRequest]
1924
-
1925
- * @throws {RequiredError}
1926
- */
1927
- addPerson(AddPersonRequest) {
1928
- return __awaiter(this, void 0, void 0, function* () {
1929
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addPerson(AddPersonRequest);
1930
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1931
- });
1932
- },
1933
- /**
1934
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
1935
- * @summary Delete an activity
1936
- * @param {number} id The ID of the activity
1937
-
1938
- * @throws {RequiredError}
1939
- */
1940
- deleteActivity(id) {
1941
- return __awaiter(this, void 0, void 0, function* () {
1942
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteActivity(id);
1943
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1944
- });
1945
- },
1946
- /**
1947
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
1948
- * @summary Delete a discount from a deal
1949
- * @param {number} id The ID of the deal
1950
- * @param {number} discount_id The ID of the discount
1951
-
1952
- * @throws {RequiredError}
1953
- */
1954
- deleteAdditionalDiscount(id, discount_id) {
1955
- return __awaiter(this, void 0, void 0, function* () {
1956
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id);
1957
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1958
- });
1959
- },
1960
- /**
1961
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
1962
- * @summary Delete a deal
1963
- * @param {number} id The ID of the deal
1964
-
1965
- * @throws {RequiredError}
1966
- */
1967
- deleteDeal(id) {
1968
- return __awaiter(this, void 0, void 0, function* () {
1969
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDeal(id);
1970
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1971
- });
1972
- },
1973
- /**
1974
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
1975
- * @summary Delete an attached product from a deal
1976
- * @param {number} id The ID of the deal
1977
- * @param {number} product_attachment_id The product attachment ID
1978
-
1979
- * @throws {RequiredError}
1980
- */
1981
- deleteDealProduct(id, product_attachment_id) {
1982
- return __awaiter(this, void 0, void 0, function* () {
1983
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDealProduct(id, product_attachment_id);
1984
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1985
- });
1986
- },
1987
- /**
1988
- * Removes an installment from a deal. Only available in Advanced and above plans.
1989
- * @summary Delete an installment from a deal
1990
- * @param {number} id The ID of the deal
1991
- * @param {number} installment_id The ID of the installment
1992
-
1993
- * @throws {RequiredError}
1994
- */
1995
- deleteInstallment(id, installment_id) {
1996
- return __awaiter(this, void 0, void 0, function* () {
1997
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInstallment(id, installment_id);
1998
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1999
- });
2000
- },
2001
- /**
2002
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
2003
- * @summary Delete a organization
2004
- * @param {number} id The ID of the organization
2005
-
2006
- * @throws {RequiredError}
2007
- */
2008
- deleteOrganization(id) {
2009
- return __awaiter(this, void 0, void 0, function* () {
2010
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteOrganization(id);
2011
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2012
- });
2013
- },
2014
- /**
2015
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
2016
- * @summary Delete a person
2017
- * @param {number} id The ID of the person
2018
-
2019
- * @throws {RequiredError}
2020
- */
2021
- deletePerson(id) {
2022
- return __awaiter(this, void 0, void 0, function* () {
2023
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePerson(id);
2024
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2025
- });
2026
- },
2027
- /**
2028
- * Returns data about all activities.
2029
- * @summary Get all activities
2030
- * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned
2031
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
2032
- * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored.
2033
- * @param {number} [deal_id] If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored.
2034
- * @param {string} [lead_id] If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored.
2035
- * @param {number} [person_id] If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored.
2036
- * @param {number} [org_id] If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored.
2037
- * @param {string} [updated_since] If set, only activities with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2038
- * @param {string} [updated_until] If set, only activities with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2039
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
2040
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2041
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
2042
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2043
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2044
-
2045
- * @throws {RequiredError}
2046
- */
2047
- getActivities(filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor) {
2048
- return __awaiter(this, void 0, void 0, function* () {
2049
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getActivities(filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor);
2050
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2051
- });
2052
- },
2053
- /**
2054
- * Returns the details of a specific activity.
2055
- * @summary Get details of an activity
2056
- * @param {number} id The ID of the activity
2057
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
2058
-
2059
- * @throws {RequiredError}
2060
- */
2061
- getActivity(id, include_fields) {
2062
- return __awaiter(this, void 0, void 0, function* () {
2063
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getActivity(id, include_fields);
2064
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2065
- });
2066
- },
2067
- /**
2068
- * Lists discounts attached to a deal.
2069
- * @summary List discounts added to a deal
2070
- * @param {number} id The ID of the deal
2071
-
2072
- * @throws {RequiredError}
2073
- */
2074
- getAdditionalDiscounts(id) {
2075
- return __awaiter(this, void 0, void 0, function* () {
2076
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getAdditionalDiscounts(id);
2077
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2078
- });
2079
- },
2080
- /**
2081
- * Returns the details of a specific deal.
2082
- * @summary Get details of a deal
2083
- * @param {number} id The ID of the deal
2084
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
2085
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2086
-
2087
- * @throws {RequiredError}
2088
- */
2089
- getDeal(id, include_fields, custom_fields) {
2090
- return __awaiter(this, void 0, void 0, function* () {
2091
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields);
2092
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2093
- });
2094
- },
2095
- /**
2096
- * Lists products attached to a deal.
2097
- * @summary List products attached to a deal
2098
- * @param {number} id The ID of the deal
2099
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2100
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2101
- * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
2102
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2103
-
2104
- * @throws {RequiredError}
2105
- */
2106
- getDealProducts(id, cursor, limit, sort_by, sort_direction) {
2107
- return __awaiter(this, void 0, void 0, function* () {
2108
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealProducts(id, cursor, limit, sort_by, sort_direction);
2109
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2110
- });
2111
- },
2112
- /**
2113
- * Returns data about all deals.
2114
- * @summary Get all deals
2115
- * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
2116
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
2117
- * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
2118
- * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
2119
- * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
2120
- * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
2121
- * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
2122
- * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.
2123
- * @param {string} [updated_since] If set, only deals with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2124
- * @param {string} [updated_until] If set, only deals with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2125
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
2126
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2127
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
2128
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2129
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2130
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2131
-
2132
- * @throws {RequiredError}
2133
- */
2134
- getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
2135
- return __awaiter(this, void 0, void 0, function* () {
2136
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
2137
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2138
- });
2139
- },
2140
- /**
2141
- * Returns data about products attached to deals
2142
- * @summary Get deal products of several deals
2143
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided.
2144
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2145
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2146
- * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;deal_id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
2147
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2148
-
2149
- * @throws {RequiredError}
2150
- */
2151
- getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction) {
2152
- return __awaiter(this, void 0, void 0, function* () {
2153
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction);
2154
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2155
- });
2156
- },
2157
- /**
2158
- * Lists installments attached to a list of deals. Only available in Advanced and above plans.
2159
- * @summary List installments added to a list of deals
2160
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
2161
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2162
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2163
- * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
2164
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2165
-
2166
- * @throws {RequiredError}
2167
- */
2168
- getInstallments(deal_ids, cursor, limit, sort_by, sort_direction) {
2169
- return __awaiter(this, void 0, void 0, function* () {
2170
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction);
2171
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2172
- });
2173
- },
2174
- /**
2175
- * Returns the details of a specific organization.
2176
- * @summary Get details of a organization
2177
- * @param {number} id The ID of the organization
2178
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
2179
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2180
-
2181
- * @throws {RequiredError}
2182
- */
2183
- getOrganization(id, include_fields, custom_fields) {
2184
- return __awaiter(this, void 0, void 0, function* () {
2185
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields);
2186
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2187
- });
2188
- },
2189
- /**
2190
- * Returns data about all organizations.
2191
- * @summary Get all organizations
2192
- * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned
2193
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
2194
- * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored.
2195
- * @param {string} [updated_since] If set, only organizations with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2196
- * @param {string} [updated_until] If set, only organizations with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2197
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
2198
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2199
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
2200
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2201
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2202
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2203
-
2204
- * @throws {RequiredError}
2205
- */
2206
- getOrganizations(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
2207
- return __awaiter(this, void 0, void 0, function* () {
2208
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganizations(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
2209
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2210
- });
2211
- },
2212
- /**
2213
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2214
- * @summary Get details of a person
2215
- * @param {number} id The ID of the person
2216
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
2217
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2218
-
2219
- * @throws {RequiredError}
2220
- */
2221
- getPerson(id, include_fields, custom_fields) {
2222
- return __awaiter(this, void 0, void 0, function* () {
2223
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields);
2224
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2225
- });
2226
- },
2227
- /**
2228
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2229
- * @summary Get all persons
2230
- * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned
2231
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
2232
- * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
2233
- * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
2234
- * @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2235
- * @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2236
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
2237
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2238
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
2239
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2240
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2241
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2242
-
2243
- * @throws {RequiredError}
2244
- */
2245
- getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
2246
- return __awaiter(this, void 0, void 0, function* () {
2247
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
2248
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2249
- });
2250
- },
2251
- /**
2252
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
2253
- * @summary Add a discount to a deal
2254
- * @param {number} id The ID of the deal
2255
- * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody]
2256
-
2257
- * @throws {RequiredError}
2258
- */
2259
- postAdditionalDiscount(id, AddAdditionalDiscountRequestBody) {
2260
- return __awaiter(this, void 0, void 0, function* () {
2261
- const localVarAxiosArgs = yield localVarAxiosParamCreator.postAdditionalDiscount(id, AddAdditionalDiscountRequestBody);
2262
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2263
- });
2264
- },
2265
- /**
2266
- * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
2267
- * @summary Add an installment to a deal
2268
- * @param {number} id The ID of the deal
2269
- * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
2270
-
2271
- * @throws {RequiredError}
2272
- */
2273
- postInstallment(id, AddInstallmentRequestBody) {
2274
- return __awaiter(this, void 0, void 0, function* () {
2275
- const localVarAxiosArgs = yield localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody);
2276
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2277
- });
2278
- },
2279
- /**
2280
- * Searches all deals 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 deals can be filtered by the person ID and the organization ID.
2281
- * @summary Search deals
2282
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2283
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2284
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2285
- * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000.
2286
- * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000.
2287
- * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open &#x3D; Open, won &#x3D; Won, lost &#x3D; Lost. The upper limit of found deals associated with the status is 2000.
2288
- * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default
2289
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2290
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2291
-
2292
- * @throws {RequiredError}
2293
- */
2294
- searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor) {
2295
- return __awaiter(this, void 0, void 0, function* () {
2296
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor);
2297
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2298
- });
2299
- },
2300
- /**
2301
- * Performs a search from your choice of item types and fields.
2302
- * @summary Perform a search from multiple item types
2303
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2304
- * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all.
2305
- * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:&lt;br&gt; &lt;table&gt; &lt;tr&gt;&lt;th&gt;&lt;b&gt;Item type&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Field&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Deal&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Person&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;email&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;, &#x60;phone&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Organization&lt;/td&gt;&lt;td&gt;&#x60;address&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;&#x60;code&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Lead&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;email&#x60;, &#x60;organization_name&#x60;, &#x60;person_name&#x60;, &#x60;phone&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;File&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Mail attachment&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Project&lt;/td&gt;&lt;td&gt; &#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;, &#x60;description&#x60; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;br&gt; Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.&lt;br/&gt; When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use &#x60;search_for_related_items&#x60;.
2306
- * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization
2307
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2308
- * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default.
2309
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2310
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2311
-
2312
- * @throws {RequiredError}
2313
- */
2314
- searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor) {
2315
- return __awaiter(this, void 0, void 0, function* () {
2316
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor);
2317
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2318
- });
2319
- },
2320
- /**
2321
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
2322
- * @summary Perform a search using a specific field from an item type
2323
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if &#x60;match&#x60; is &#x60;exact&#x60;). Please note that the search term has to be URL encoded.
2324
- * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from
2325
- * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\&#39; API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2326
- * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search &lt;b&gt;is&lt;/b&gt; case sensitive.&lt;br/&gt;&lt;br/&gt; E.g. in case of searching for a value &#x60;monkey&#x60;, &lt;ul&gt; &lt;li&gt;with &#x60;exact&#x60; match, you will only find it if term is &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;beginning&#x60; match, you will only find it if the term matches the beginning or the whole string, e.g. &#x60;monk&#x60; and &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;middle&#x60; match, you will find the it if the term matches any substring of the value, e.g. &#x60;onk&#x60; and &#x60;ke&#x60;&lt;/li&gt; &lt;/ul&gt;.
2327
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2328
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2329
-
2330
- * @throws {RequiredError}
2331
- */
2332
- searchItemByField(term, entity_type, field, match, limit, cursor) {
2333
- return __awaiter(this, void 0, void 0, function* () {
2334
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchItemByField(term, entity_type, field, match, limit, cursor);
2335
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2336
- });
2337
- },
2338
- /**
2339
- * 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.
2340
- * @summary Search leads
2341
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2342
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them.
2343
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2344
- * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000.
2345
- * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000.
2346
- * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default
2347
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2348
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2349
-
2350
- * @throws {RequiredError}
2351
- */
2352
- searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor) {
2353
- return __awaiter(this, void 0, void 0, function* () {
2354
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor);
2355
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2356
- });
2357
- },
2358
- /**
2359
- * Searches all organizations by name, address, 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.
2360
- * @summary Search organizations
2361
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2362
- * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2363
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2364
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2365
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2366
-
2367
- * @throws {RequiredError}
2368
- */
2369
- searchOrganization(term, fields, exact_match, limit, cursor) {
2370
- return __awaiter(this, void 0, void 0, function* () {
2371
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor);
2372
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2373
- });
2374
- },
2375
- /**
2376
- * Searches all persons by name, email, phone, 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 persons can be filtered by organization ID.
2377
- * @summary Search persons
2378
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2379
- * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2380
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2381
- * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000.
2382
- * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default
2383
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2384
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2385
-
2386
- * @throws {RequiredError}
2387
- */
2388
- searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor) {
2389
- return __awaiter(this, void 0, void 0, function* () {
2390
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor);
2391
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2392
- });
2393
- },
2394
- /**
2395
- * Updates the properties of an activity.
2396
- * @summary Update an activity
2397
- * @param {number} id The ID of the activity
2398
- * @param {AddActivityRequest} [AddActivityRequest]
2399
-
2400
- * @throws {RequiredError}
2401
- */
2402
- updateActivity(id, AddActivityRequest) {
2403
- return __awaiter(this, void 0, void 0, function* () {
2404
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateActivity(id, AddActivityRequest);
2405
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2406
- });
2407
- },
2408
- /**
2409
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
2410
- * @summary Update a discount added to a deal
2411
- * @param {number} id The ID of the deal
2412
- * @param {number} discount_id The ID of the discount
2413
- * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody]
2414
-
2415
- * @throws {RequiredError}
2416
- */
2417
- updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody) {
2418
- return __awaiter(this, void 0, void 0, function* () {
2419
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody);
2420
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2421
- });
2422
- },
2423
- /**
2424
- * Updates the properties of a deal.
2425
- * @summary Update a deal
2426
- * @param {number} id The ID of the deal
2427
- * @param {UpdateDealRequest} [UpdateDealRequest]
2428
-
2429
- * @throws {RequiredError}
2430
- */
2431
- updateDeal(id, UpdateDealRequest) {
2432
- return __awaiter(this, void 0, void 0, function* () {
2433
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDeal(id, UpdateDealRequest);
2434
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2435
- });
2436
- },
2437
- /**
2438
- * Updates the details of the product that has been attached to a deal.
2439
- * @summary Update the product attached to a deal
2440
- * @param {number} id The ID of the deal
2441
- * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal)
2442
- * @param {UpdateDealProductRequest} [UpdateDealProductRequest]
2443
-
2444
- * @throws {RequiredError}
2445
- */
2446
- updateDealProduct(id, product_attachment_id, UpdateDealProductRequest) {
2447
- return __awaiter(this, void 0, void 0, function* () {
2448
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDealProduct(id, product_attachment_id, UpdateDealProductRequest);
2449
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2450
- });
2451
- },
2452
- /**
2453
- * Edits an installment added to a deal. Only available in Advanced and above plans.
2454
- * @summary Update an installment added to a deal
2455
- * @param {number} id The ID of the deal
2456
- * @param {number} installment_id The ID of the installment
2457
- * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
2458
-
2459
- * @throws {RequiredError}
2460
- */
2461
- updateInstallment(id, installment_id, UpdateInstallmentRequestBody) {
2462
- return __awaiter(this, void 0, void 0, function* () {
2463
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody);
2464
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2465
- });
2466
- },
2467
- /**
2468
- * Updates the properties of a organization.
2469
- * @summary Update a organization
2470
- * @param {number} id The ID of the organization
2471
- * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest]
2472
-
2473
- * @throws {RequiredError}
2474
- */
2475
- updateOrganization(id, UpdateOrganizationRequest) {
2476
- return __awaiter(this, void 0, void 0, function* () {
2477
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateOrganization(id, UpdateOrganizationRequest);
2478
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2479
- });
2480
- },
2481
- /**
2482
- * Updates the properties of a person.
2483
- * @summary Update a person
2484
- * @param {number} id The ID of the person
2485
- * @param {UpdatePersonRequest} [UpdatePersonRequest]
2486
-
2487
- * @throws {RequiredError}
2488
- */
2489
- updatePerson(id, UpdatePersonRequest) {
2490
- return __awaiter(this, void 0, void 0, function* () {
2491
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updatePerson(id, UpdatePersonRequest);
2492
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2493
- });
2494
- },
2495
- };
2496
- };
2497
- exports.BetaApiFp = BetaApiFp;
2498
- /**
2499
- * BetaApi - factory interface
2500
- * @export
2501
- */
2502
- const BetaApiFactory = function (configuration, basePath, axios) {
2503
- const localVarFp = (0, exports.BetaApiFp)(configuration);
2504
- return {
2505
- /**
2506
- * Adds a new activity.
2507
- * @summary Add a new activity
2508
- * @param {BetaApiAddActivityRequest} requestParameters Request parameters.
2509
-
2510
- * @throws {RequiredError}
2511
- */
2512
- addActivity(requestParameters = {}) {
2513
- return localVarFp.addActivity(requestParameters.AddActivityRequest).then((request) => request(axios, basePath));
2514
- },
2515
- /**
2516
- * Adds a new deal.
2517
- * @summary Add a new deal
2518
- * @param {BetaApiAddDealRequest} requestParameters Request parameters.
2519
-
2520
- * @throws {RequiredError}
2521
- */
2522
- addDeal(requestParameters = {}) {
2523
- return localVarFp.addDeal(requestParameters.AddDealRequest).then((request) => request(axios, basePath));
2524
- },
2525
- /**
2526
- * Adds a product to a deal, creating a new item called a deal-product.
2527
- * @summary Add a product to a deal
2528
- * @param {BetaApiAddDealProductRequest} requestParameters Request parameters.
2529
-
2530
- * @throws {RequiredError}
2531
- */
2532
- addDealProduct(requestParameters) {
2533
- return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(axios, basePath));
2534
- },
2535
- /**
2536
- * Adds a new organization.
2537
- * @summary Add a new organization
2538
- * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters.
2539
-
2540
- * @throws {RequiredError}
2541
- */
2542
- addOrganization(requestParameters = {}) {
2543
- return localVarFp.addOrganization(requestParameters.AddOrganizationRequest).then((request) => request(axios, basePath));
2544
- },
2545
- /**
2546
- * Adds a new person.
2547
- * @summary Add a new person
2548
- * @param {BetaApiAddPersonRequest} requestParameters Request parameters.
2549
-
2550
- * @throws {RequiredError}
2551
- */
2552
- addPerson(requestParameters = {}) {
2553
- return localVarFp.addPerson(requestParameters.AddPersonRequest).then((request) => request(axios, basePath));
2554
- },
2555
- /**
2556
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
2557
- * @summary Delete an activity
2558
- * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters.
2559
-
2560
- * @throws {RequiredError}
2561
- */
2562
- deleteActivity(requestParameters) {
2563
- return localVarFp.deleteActivity(requestParameters.id).then((request) => request(axios, basePath));
2564
- },
2565
- /**
2566
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
2567
- * @summary Delete a discount from a deal
2568
- * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters.
2569
-
2570
- * @throws {RequiredError}
2571
- */
2572
- deleteAdditionalDiscount(requestParameters) {
2573
- return localVarFp.deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id).then((request) => request(axios, basePath));
2574
- },
2575
- /**
2576
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
2577
- * @summary Delete a deal
2578
- * @param {BetaApiDeleteDealRequest} requestParameters Request parameters.
2579
-
2580
- * @throws {RequiredError}
2581
- */
2582
- deleteDeal(requestParameters) {
2583
- return localVarFp.deleteDeal(requestParameters.id).then((request) => request(axios, basePath));
2584
- },
2585
- /**
2586
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
2587
- * @summary Delete an attached product from a deal
2588
- * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters.
2589
-
2590
- * @throws {RequiredError}
2591
- */
2592
- deleteDealProduct(requestParameters) {
2593
- return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id).then((request) => request(axios, basePath));
2594
- },
2595
- /**
2596
- * Removes an installment from a deal. Only available in Advanced and above plans.
2597
- * @summary Delete an installment from a deal
2598
- * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters.
2599
-
2600
- * @throws {RequiredError}
2601
- */
2602
- deleteInstallment(requestParameters) {
2603
- return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(axios, basePath));
2604
- },
2605
- /**
2606
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
2607
- * @summary Delete a organization
2608
- * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters.
2609
-
2610
- * @throws {RequiredError}
2611
- */
2612
- deleteOrganization(requestParameters) {
2613
- return localVarFp.deleteOrganization(requestParameters.id).then((request) => request(axios, basePath));
2614
- },
2615
- /**
2616
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
2617
- * @summary Delete a person
2618
- * @param {BetaApiDeletePersonRequest} requestParameters Request parameters.
2619
-
2620
- * @throws {RequiredError}
2621
- */
2622
- deletePerson(requestParameters) {
2623
- return localVarFp.deletePerson(requestParameters.id).then((request) => request(axios, basePath));
2624
- },
2625
- /**
2626
- * Returns data about all activities.
2627
- * @summary Get all activities
2628
- * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters.
2629
-
2630
- * @throws {RequiredError}
2631
- */
2632
- getActivities(requestParameters = {}) {
2633
- return localVarFp.getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2634
- },
2635
- /**
2636
- * Returns the details of a specific activity.
2637
- * @summary Get details of an activity
2638
- * @param {BetaApiGetActivityRequest} requestParameters Request parameters.
2639
-
2640
- * @throws {RequiredError}
2641
- */
2642
- getActivity(requestParameters) {
2643
- return localVarFp.getActivity(requestParameters.id, requestParameters.include_fields).then((request) => request(axios, basePath));
2644
- },
2645
- /**
2646
- * Lists discounts attached to a deal.
2647
- * @summary List discounts added to a deal
2648
- * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters.
2649
-
2650
- * @throws {RequiredError}
2651
- */
2652
- getAdditionalDiscounts(requestParameters) {
2653
- return localVarFp.getAdditionalDiscounts(requestParameters.id).then((request) => request(axios, basePath));
2654
- },
2655
- /**
2656
- * Returns the details of a specific deal.
2657
- * @summary Get details of a deal
2658
- * @param {BetaApiGetDealRequest} requestParameters Request parameters.
2659
-
2660
- * @throws {RequiredError}
2661
- */
2662
- getDeal(requestParameters) {
2663
- return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2664
- },
2665
- /**
2666
- * Lists products attached to a deal.
2667
- * @summary List products attached to a deal
2668
- * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters.
2669
-
2670
- * @throws {RequiredError}
2671
- */
2672
- getDealProducts(requestParameters) {
2673
- return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2674
- },
2675
- /**
2676
- * Returns data about all deals.
2677
- * @summary Get all deals
2678
- * @param {BetaApiGetDealsRequest} requestParameters Request parameters.
2679
-
2680
- * @throws {RequiredError}
2681
- */
2682
- getDeals(requestParameters = {}) {
2683
- return localVarFp.getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2684
- },
2685
- /**
2686
- * Returns data about products attached to deals
2687
- * @summary Get deal products of several deals
2688
- * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters.
2689
-
2690
- * @throws {RequiredError}
2691
- */
2692
- getDealsProducts(requestParameters) {
2693
- return localVarFp.getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2694
- },
2695
- /**
2696
- * Lists installments attached to a list of deals. Only available in Advanced and above plans.
2697
- * @summary List installments added to a list of deals
2698
- * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters.
2699
-
2700
- * @throws {RequiredError}
2701
- */
2702
- getInstallments(requestParameters) {
2703
- return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2704
- },
2705
- /**
2706
- * Returns the details of a specific organization.
2707
- * @summary Get details of a organization
2708
- * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters.
2709
-
2710
- * @throws {RequiredError}
2711
- */
2712
- getOrganization(requestParameters) {
2713
- return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2714
- },
2715
- /**
2716
- * Returns data about all organizations.
2717
- * @summary Get all organizations
2718
- * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters.
2719
-
2720
- * @throws {RequiredError}
2721
- */
2722
- getOrganizations(requestParameters = {}) {
2723
- return localVarFp.getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2724
- },
2725
- /**
2726
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2727
- * @summary Get details of a person
2728
- * @param {BetaApiGetPersonRequest} requestParameters Request parameters.
2729
-
2730
- * @throws {RequiredError}
2731
- */
2732
- getPerson(requestParameters) {
2733
- return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2734
- },
2735
- /**
2736
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2737
- * @summary Get all persons
2738
- * @param {BetaApiGetPersonsRequest} requestParameters Request parameters.
2739
-
2740
- * @throws {RequiredError}
2741
- */
2742
- getPersons(requestParameters = {}) {
2743
- return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2744
- },
2745
- /**
2746
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
2747
- * @summary Add a discount to a deal
2748
- * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters.
2749
-
2750
- * @throws {RequiredError}
2751
- */
2752
- postAdditionalDiscount(requestParameters) {
2753
- return localVarFp.postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody).then((request) => request(axios, basePath));
446
+ getLeadConversionStatus(id, conversion_id) {
447
+ return __awaiter(this, void 0, void 0, function* () {
448
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id);
449
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
450
+ });
2754
451
  },
2755
452
  /**
2756
453
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
2757
454
  * @summary Add an installment to a deal
2758
- * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters.
2759
-
2760
- * @throws {RequiredError}
2761
- */
2762
- postInstallment(requestParameters) {
2763
- return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody).then((request) => request(axios, basePath));
2764
- },
2765
- /**
2766
- * Searches all deals 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 deals can be filtered by the person ID and the organization ID.
2767
- * @summary Search deals
2768
- * @param {BetaApiSearchDealsRequest} requestParameters Request parameters.
2769
-
2770
- * @throws {RequiredError}
2771
- */
2772
- searchDeals(requestParameters) {
2773
- return localVarFp.searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2774
- },
2775
- /**
2776
- * Performs a search from your choice of item types and fields.
2777
- * @summary Perform a search from multiple item types
2778
- * @param {BetaApiSearchItemRequest} requestParameters Request parameters.
455
+ * @param {number} id The ID of the deal
456
+ * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
2779
457
 
2780
458
  * @throws {RequiredError}
2781
459
  */
2782
- searchItem(requestParameters) {
2783
- return localVarFp.searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
460
+ postInstallment(id, AddInstallmentRequestBody) {
461
+ return __awaiter(this, void 0, void 0, function* () {
462
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody);
463
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
464
+ });
2784
465
  },
2785
466
  /**
2786
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
2787
- * @summary Perform a search using a specific field from an item type
2788
- * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters.
467
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
468
+ * @summary Update an installment added to a deal
469
+ * @param {number} id The ID of the deal
470
+ * @param {number} installment_id The ID of the installment
471
+ * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
2789
472
 
2790
473
  * @throws {RequiredError}
2791
474
  */
2792
- searchItemByField(requestParameters) {
2793
- return localVarFp.searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
475
+ updateInstallment(id, installment_id, UpdateInstallmentRequestBody) {
476
+ return __awaiter(this, void 0, void 0, function* () {
477
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody);
478
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
479
+ });
2794
480
  },
481
+ };
482
+ };
483
+ exports.BetaApiFp = BetaApiFp;
484
+ /**
485
+ * BetaApi - factory interface
486
+ * @export
487
+ */
488
+ const BetaApiFactory = function (configuration, basePath, axios) {
489
+ const localVarFp = (0, exports.BetaApiFp)(configuration);
490
+ return {
2795
491
  /**
2796
- * 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.
2797
- * @summary Search leads
2798
- * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters.
492
+ * Initiates a conversion of a deal to a lead. 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. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal 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/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
493
+ * @summary Convert a deal to a lead (BETA)
494
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
2799
495
 
2800
496
  * @throws {RequiredError}
2801
497
  */
2802
- searchLeads(requestParameters) {
2803
- return localVarFp.searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
498
+ convertDealToLead(requestParameters) {
499
+ return localVarFp.convertDealToLead(requestParameters.id).then((request) => request(axios, basePath));
2804
500
  },
2805
501
  /**
2806
- * Searches all organizations by name, address, 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.
2807
- * @summary Search organizations
2808
- * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters.
502
+ * 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.
503
+ * @summary Convert a lead to a deal (BETA)
504
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
2809
505
 
2810
506
  * @throws {RequiredError}
2811
507
  */
2812
- searchOrganization(requestParameters) {
2813
- return localVarFp.searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
508
+ convertLeadToDeal(requestParameters) {
509
+ return localVarFp.convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(axios, basePath));
2814
510
  },
2815
511
  /**
2816
- * Searches all persons by name, email, phone, 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 persons can be filtered by organization ID.
2817
- * @summary Search persons
2818
- * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters.
512
+ * Removes an installment from a deal. Only available in Advanced and above plans.
513
+ * @summary Delete an installment from a deal
514
+ * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters.
2819
515
 
2820
516
  * @throws {RequiredError}
2821
517
  */
2822
- searchPersons(requestParameters) {
2823
- return localVarFp.searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
518
+ deleteInstallment(requestParameters) {
519
+ return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(axios, basePath));
2824
520
  },
2825
521
  /**
2826
- * Updates the properties of an activity.
2827
- * @summary Update an activity
2828
- * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters.
522
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
523
+ * @summary Get Deal conversion status (BETA)
524
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
2829
525
 
2830
526
  * @throws {RequiredError}
2831
527
  */
2832
- updateActivity(requestParameters) {
2833
- return localVarFp.updateActivity(requestParameters.id, requestParameters.AddActivityRequest).then((request) => request(axios, basePath));
528
+ getDealConversionStatus(requestParameters) {
529
+ return localVarFp.getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
2834
530
  },
2835
531
  /**
2836
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
2837
- * @summary Update a discount added to a deal
2838
- * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters.
532
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
533
+ * @summary List installments added to a list of deals
534
+ * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters.
2839
535
 
2840
536
  * @throws {RequiredError}
2841
537
  */
2842
- updateAdditionalDiscount(requestParameters) {
2843
- return localVarFp.updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody).then((request) => request(axios, basePath));
538
+ getInstallments(requestParameters) {
539
+ return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2844
540
  },
2845
541
  /**
2846
- * Updates the properties of a deal.
2847
- * @summary Update a deal
2848
- * @param {BetaApiUpdateDealRequest} requestParameters Request parameters.
542
+ * 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.
543
+ * @summary Get Lead conversion status (BETA)
544
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
2849
545
 
2850
546
  * @throws {RequiredError}
2851
547
  */
2852
- updateDeal(requestParameters) {
2853
- return localVarFp.updateDeal(requestParameters.id, requestParameters.UpdateDealRequest).then((request) => request(axios, basePath));
548
+ getLeadConversionStatus(requestParameters) {
549
+ return localVarFp.getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
2854
550
  },
2855
551
  /**
2856
- * Updates the details of the product that has been attached to a deal.
2857
- * @summary Update the product attached to a deal
2858
- * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters.
552
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
553
+ * @summary Add an installment to a deal
554
+ * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters.
2859
555
 
2860
556
  * @throws {RequiredError}
2861
557
  */
2862
- updateDealProduct(requestParameters) {
2863
- return localVarFp.updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest).then((request) => request(axios, basePath));
558
+ postInstallment(requestParameters) {
559
+ return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody).then((request) => request(axios, basePath));
2864
560
  },
2865
561
  /**
2866
562
  * Edits an installment added to a deal. Only available in Advanced and above plans.
@@ -2872,26 +568,6 @@ const BetaApiFactory = function (configuration, basePath, axios) {
2872
568
  updateInstallment(requestParameters) {
2873
569
  return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody).then((request) => request(axios, basePath));
2874
570
  },
2875
- /**
2876
- * Updates the properties of a organization.
2877
- * @summary Update a organization
2878
- * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters.
2879
-
2880
- * @throws {RequiredError}
2881
- */
2882
- updateOrganization(requestParameters) {
2883
- return localVarFp.updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest).then((request) => request(axios, basePath));
2884
- },
2885
- /**
2886
- * Updates the properties of a person.
2887
- * @summary Update a person
2888
- * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters.
2889
-
2890
- * @throws {RequiredError}
2891
- */
2892
- updatePerson(requestParameters) {
2893
- return localVarFp.updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest).then((request) => request(axios, basePath));
2894
- },
2895
571
  };
2896
572
  };
2897
573
  exports.BetaApiFactory = BetaApiFactory;
@@ -2903,103 +579,26 @@ exports.BetaApiFactory = BetaApiFactory;
2903
579
  */
2904
580
  class BetaApi extends base_1.BaseAPI {
2905
581
  /**
2906
- * Adds a new activity.
2907
- * @summary Add a new activity
2908
- * @param {BetaApiAddActivityRequest} requestParameters Request parameters.
2909
-
2910
- * @throws {RequiredError}
2911
- * @memberof BetaApi
2912
- */
2913
- addActivity(requestParameters = {}) {
2914
- return (0, exports.BetaApiFp)(this.configuration).addActivity(requestParameters.AddActivityRequest).then((request) => request(this.axios, this.basePath));
2915
- }
2916
- /**
2917
- * Adds a new deal.
2918
- * @summary Add a new deal
2919
- * @param {BetaApiAddDealRequest} requestParameters Request parameters.
2920
-
2921
- * @throws {RequiredError}
2922
- * @memberof BetaApi
2923
- */
2924
- addDeal(requestParameters = {}) {
2925
- return (0, exports.BetaApiFp)(this.configuration).addDeal(requestParameters.AddDealRequest).then((request) => request(this.axios, this.basePath));
2926
- }
2927
- /**
2928
- * Adds a product to a deal, creating a new item called a deal-product.
2929
- * @summary Add a product to a deal
2930
- * @param {BetaApiAddDealProductRequest} requestParameters Request parameters.
2931
-
2932
- * @throws {RequiredError}
2933
- * @memberof BetaApi
2934
- */
2935
- addDealProduct(requestParameters) {
2936
- return (0, exports.BetaApiFp)(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(this.axios, this.basePath));
2937
- }
2938
- /**
2939
- * Adds a new organization.
2940
- * @summary Add a new organization
2941
- * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters.
2942
-
2943
- * @throws {RequiredError}
2944
- * @memberof BetaApi
2945
- */
2946
- addOrganization(requestParameters = {}) {
2947
- return (0, exports.BetaApiFp)(this.configuration).addOrganization(requestParameters.AddOrganizationRequest).then((request) => request(this.axios, this.basePath));
2948
- }
2949
- /**
2950
- * Adds a new person.
2951
- * @summary Add a new person
2952
- * @param {BetaApiAddPersonRequest} requestParameters Request parameters.
2953
-
2954
- * @throws {RequiredError}
2955
- * @memberof BetaApi
2956
- */
2957
- addPerson(requestParameters = {}) {
2958
- return (0, exports.BetaApiFp)(this.configuration).addPerson(requestParameters.AddPersonRequest).then((request) => request(this.axios, this.basePath));
2959
- }
2960
- /**
2961
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
2962
- * @summary Delete an activity
2963
- * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters.
2964
-
2965
- * @throws {RequiredError}
2966
- * @memberof BetaApi
2967
- */
2968
- deleteActivity(requestParameters) {
2969
- return (0, exports.BetaApiFp)(this.configuration).deleteActivity(requestParameters.id).then((request) => request(this.axios, this.basePath));
2970
- }
2971
- /**
2972
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
2973
- * @summary Delete a discount from a deal
2974
- * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters.
2975
-
2976
- * @throws {RequiredError}
2977
- * @memberof BetaApi
2978
- */
2979
- deleteAdditionalDiscount(requestParameters) {
2980
- return (0, exports.BetaApiFp)(this.configuration).deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id).then((request) => request(this.axios, this.basePath));
2981
- }
2982
- /**
2983
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
2984
- * @summary Delete a deal
2985
- * @param {BetaApiDeleteDealRequest} requestParameters Request parameters.
582
+ * Initiates a conversion of a deal to a lead. 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. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal 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/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
583
+ * @summary Convert a deal to a lead (BETA)
584
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
2986
585
 
2987
586
  * @throws {RequiredError}
2988
587
  * @memberof BetaApi
2989
588
  */
2990
- deleteDeal(requestParameters) {
2991
- return (0, exports.BetaApiFp)(this.configuration).deleteDeal(requestParameters.id).then((request) => request(this.axios, this.basePath));
589
+ convertDealToLead(requestParameters) {
590
+ return (0, exports.BetaApiFp)(this.configuration).convertDealToLead(requestParameters.id).then((request) => request(this.axios, this.basePath));
2992
591
  }
2993
592
  /**
2994
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
2995
- * @summary Delete an attached product from a deal
2996
- * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters.
593
+ * 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.
594
+ * @summary Convert a lead to a deal (BETA)
595
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
2997
596
 
2998
597
  * @throws {RequiredError}
2999
598
  * @memberof BetaApi
3000
599
  */
3001
- deleteDealProduct(requestParameters) {
3002
- return (0, exports.BetaApiFp)(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id).then((request) => request(this.axios, this.basePath));
600
+ convertLeadToDeal(requestParameters) {
601
+ return (0, exports.BetaApiFp)(this.configuration).convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(this.axios, this.basePath));
3003
602
  }
3004
603
  /**
3005
604
  * Removes an installment from a deal. Only available in Advanced and above plans.
@@ -3013,103 +612,15 @@ class BetaApi extends base_1.BaseAPI {
3013
612
  return (0, exports.BetaApiFp)(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(this.axios, this.basePath));
3014
613
  }
3015
614
  /**
3016
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
3017
- * @summary Delete a organization
3018
- * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters.
3019
-
3020
- * @throws {RequiredError}
3021
- * @memberof BetaApi
3022
- */
3023
- deleteOrganization(requestParameters) {
3024
- return (0, exports.BetaApiFp)(this.configuration).deleteOrganization(requestParameters.id).then((request) => request(this.axios, this.basePath));
3025
- }
3026
- /**
3027
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
3028
- * @summary Delete a person
3029
- * @param {BetaApiDeletePersonRequest} requestParameters Request parameters.
3030
-
3031
- * @throws {RequiredError}
3032
- * @memberof BetaApi
3033
- */
3034
- deletePerson(requestParameters) {
3035
- return (0, exports.BetaApiFp)(this.configuration).deletePerson(requestParameters.id).then((request) => request(this.axios, this.basePath));
3036
- }
3037
- /**
3038
- * Returns data about all activities.
3039
- * @summary Get all activities
3040
- * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters.
3041
-
3042
- * @throws {RequiredError}
3043
- * @memberof BetaApi
3044
- */
3045
- getActivities(requestParameters = {}) {
3046
- return (0, exports.BetaApiFp)(this.configuration).getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3047
- }
3048
- /**
3049
- * Returns the details of a specific activity.
3050
- * @summary Get details of an activity
3051
- * @param {BetaApiGetActivityRequest} requestParameters Request parameters.
3052
-
3053
- * @throws {RequiredError}
3054
- * @memberof BetaApi
3055
- */
3056
- getActivity(requestParameters) {
3057
- return (0, exports.BetaApiFp)(this.configuration).getActivity(requestParameters.id, requestParameters.include_fields).then((request) => request(this.axios, this.basePath));
3058
- }
3059
- /**
3060
- * Lists discounts attached to a deal.
3061
- * @summary List discounts added to a deal
3062
- * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters.
3063
-
3064
- * @throws {RequiredError}
3065
- * @memberof BetaApi
3066
- */
3067
- getAdditionalDiscounts(requestParameters) {
3068
- return (0, exports.BetaApiFp)(this.configuration).getAdditionalDiscounts(requestParameters.id).then((request) => request(this.axios, this.basePath));
3069
- }
3070
- /**
3071
- * Returns the details of a specific deal.
3072
- * @summary Get details of a deal
3073
- * @param {BetaApiGetDealRequest} requestParameters Request parameters.
3074
-
3075
- * @throws {RequiredError}
3076
- * @memberof BetaApi
3077
- */
3078
- getDeal(requestParameters) {
3079
- return (0, exports.BetaApiFp)(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
3080
- }
3081
- /**
3082
- * Lists products attached to a deal.
3083
- * @summary List products attached to a deal
3084
- * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters.
3085
-
3086
- * @throws {RequiredError}
3087
- * @memberof BetaApi
3088
- */
3089
- getDealProducts(requestParameters) {
3090
- return (0, exports.BetaApiFp)(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
3091
- }
3092
- /**
3093
- * Returns data about all deals.
3094
- * @summary Get all deals
3095
- * @param {BetaApiGetDealsRequest} requestParameters Request parameters.
3096
-
3097
- * @throws {RequiredError}
3098
- * @memberof BetaApi
3099
- */
3100
- getDeals(requestParameters = {}) {
3101
- return (0, exports.BetaApiFp)(this.configuration).getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3102
- }
3103
- /**
3104
- * Returns data about products attached to deals
3105
- * @summary Get deal products of several deals
3106
- * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters.
615
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
616
+ * @summary Get Deal conversion status (BETA)
617
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
3107
618
 
3108
619
  * @throws {RequiredError}
3109
620
  * @memberof BetaApi
3110
621
  */
3111
- getDealsProducts(requestParameters) {
3112
- return (0, exports.BetaApiFp)(this.configuration).getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
622
+ getDealConversionStatus(requestParameters) {
623
+ return (0, exports.BetaApiFp)(this.configuration).getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
3113
624
  }
3114
625
  /**
3115
626
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
@@ -3123,59 +634,15 @@ class BetaApi extends base_1.BaseAPI {
3123
634
  return (0, exports.BetaApiFp)(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
3124
635
  }
3125
636
  /**
3126
- * Returns the details of a specific organization.
3127
- * @summary Get details of a organization
3128
- * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters.
637
+ * 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.
638
+ * @summary Get Lead conversion status (BETA)
639
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
3129
640
 
3130
641
  * @throws {RequiredError}
3131
642
  * @memberof BetaApi
3132
643
  */
3133
- getOrganization(requestParameters) {
3134
- return (0, exports.BetaApiFp)(this.configuration).getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
3135
- }
3136
- /**
3137
- * Returns data about all organizations.
3138
- * @summary Get all organizations
3139
- * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters.
3140
-
3141
- * @throws {RequiredError}
3142
- * @memberof BetaApi
3143
- */
3144
- getOrganizations(requestParameters = {}) {
3145
- return (0, exports.BetaApiFp)(this.configuration).getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3146
- }
3147
- /**
3148
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
3149
- * @summary Get details of a person
3150
- * @param {BetaApiGetPersonRequest} requestParameters Request parameters.
3151
-
3152
- * @throws {RequiredError}
3153
- * @memberof BetaApi
3154
- */
3155
- getPerson(requestParameters) {
3156
- return (0, exports.BetaApiFp)(this.configuration).getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
3157
- }
3158
- /**
3159
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
3160
- * @summary Get all persons
3161
- * @param {BetaApiGetPersonsRequest} requestParameters Request parameters.
3162
-
3163
- * @throws {RequiredError}
3164
- * @memberof BetaApi
3165
- */
3166
- getPersons(requestParameters = {}) {
3167
- return (0, exports.BetaApiFp)(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3168
- }
3169
- /**
3170
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
3171
- * @summary Add a discount to a deal
3172
- * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters.
3173
-
3174
- * @throws {RequiredError}
3175
- * @memberof BetaApi
3176
- */
3177
- postAdditionalDiscount(requestParameters) {
3178
- return (0, exports.BetaApiFp)(this.configuration).postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody).then((request) => request(this.axios, this.basePath));
644
+ getLeadConversionStatus(requestParameters) {
645
+ return (0, exports.BetaApiFp)(this.configuration).getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
3179
646
  }
3180
647
  /**
3181
648
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
@@ -3188,116 +655,6 @@ class BetaApi extends base_1.BaseAPI {
3188
655
  postInstallment(requestParameters) {
3189
656
  return (0, exports.BetaApiFp)(this.configuration).postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody).then((request) => request(this.axios, this.basePath));
3190
657
  }
3191
- /**
3192
- * Searches all deals 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 deals can be filtered by the person ID and the organization ID.
3193
- * @summary Search deals
3194
- * @param {BetaApiSearchDealsRequest} requestParameters Request parameters.
3195
-
3196
- * @throws {RequiredError}
3197
- * @memberof BetaApi
3198
- */
3199
- searchDeals(requestParameters) {
3200
- return (0, exports.BetaApiFp)(this.configuration).searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3201
- }
3202
- /**
3203
- * Performs a search from your choice of item types and fields.
3204
- * @summary Perform a search from multiple item types
3205
- * @param {BetaApiSearchItemRequest} requestParameters Request parameters.
3206
-
3207
- * @throws {RequiredError}
3208
- * @memberof BetaApi
3209
- */
3210
- searchItem(requestParameters) {
3211
- return (0, exports.BetaApiFp)(this.configuration).searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3212
- }
3213
- /**
3214
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
3215
- * @summary Perform a search using a specific field from an item type
3216
- * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters.
3217
-
3218
- * @throws {RequiredError}
3219
- * @memberof BetaApi
3220
- */
3221
- searchItemByField(requestParameters) {
3222
- return (0, exports.BetaApiFp)(this.configuration).searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3223
- }
3224
- /**
3225
- * 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.
3226
- * @summary Search leads
3227
- * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters.
3228
-
3229
- * @throws {RequiredError}
3230
- * @memberof BetaApi
3231
- */
3232
- searchLeads(requestParameters) {
3233
- return (0, exports.BetaApiFp)(this.configuration).searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3234
- }
3235
- /**
3236
- * Searches all organizations by name, address, 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.
3237
- * @summary Search organizations
3238
- * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters.
3239
-
3240
- * @throws {RequiredError}
3241
- * @memberof BetaApi
3242
- */
3243
- searchOrganization(requestParameters) {
3244
- return (0, exports.BetaApiFp)(this.configuration).searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3245
- }
3246
- /**
3247
- * Searches all persons by name, email, phone, 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 persons can be filtered by organization ID.
3248
- * @summary Search persons
3249
- * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters.
3250
-
3251
- * @throws {RequiredError}
3252
- * @memberof BetaApi
3253
- */
3254
- searchPersons(requestParameters) {
3255
- return (0, exports.BetaApiFp)(this.configuration).searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
3256
- }
3257
- /**
3258
- * Updates the properties of an activity.
3259
- * @summary Update an activity
3260
- * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters.
3261
-
3262
- * @throws {RequiredError}
3263
- * @memberof BetaApi
3264
- */
3265
- updateActivity(requestParameters) {
3266
- return (0, exports.BetaApiFp)(this.configuration).updateActivity(requestParameters.id, requestParameters.AddActivityRequest).then((request) => request(this.axios, this.basePath));
3267
- }
3268
- /**
3269
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
3270
- * @summary Update a discount added to a deal
3271
- * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters.
3272
-
3273
- * @throws {RequiredError}
3274
- * @memberof BetaApi
3275
- */
3276
- updateAdditionalDiscount(requestParameters) {
3277
- return (0, exports.BetaApiFp)(this.configuration).updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody).then((request) => request(this.axios, this.basePath));
3278
- }
3279
- /**
3280
- * Updates the properties of a deal.
3281
- * @summary Update a deal
3282
- * @param {BetaApiUpdateDealRequest} requestParameters Request parameters.
3283
-
3284
- * @throws {RequiredError}
3285
- * @memberof BetaApi
3286
- */
3287
- updateDeal(requestParameters) {
3288
- return (0, exports.BetaApiFp)(this.configuration).updateDeal(requestParameters.id, requestParameters.UpdateDealRequest).then((request) => request(this.axios, this.basePath));
3289
- }
3290
- /**
3291
- * Updates the details of the product that has been attached to a deal.
3292
- * @summary Update the product attached to a deal
3293
- * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters.
3294
-
3295
- * @throws {RequiredError}
3296
- * @memberof BetaApi
3297
- */
3298
- updateDealProduct(requestParameters) {
3299
- return (0, exports.BetaApiFp)(this.configuration).updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest).then((request) => request(this.axios, this.basePath));
3300
- }
3301
658
  /**
3302
659
  * Edits an installment added to a deal. Only available in Advanced and above plans.
3303
660
  * @summary Update an installment added to a deal
@@ -3309,27 +666,5 @@ class BetaApi extends base_1.BaseAPI {
3309
666
  updateInstallment(requestParameters) {
3310
667
  return (0, exports.BetaApiFp)(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody).then((request) => request(this.axios, this.basePath));
3311
668
  }
3312
- /**
3313
- * Updates the properties of a organization.
3314
- * @summary Update a organization
3315
- * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters.
3316
-
3317
- * @throws {RequiredError}
3318
- * @memberof BetaApi
3319
- */
3320
- updateOrganization(requestParameters) {
3321
- return (0, exports.BetaApiFp)(this.configuration).updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest).then((request) => request(this.axios, this.basePath));
3322
- }
3323
- /**
3324
- * Updates the properties of a person.
3325
- * @summary Update a person
3326
- * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters.
3327
-
3328
- * @throws {RequiredError}
3329
- * @memberof BetaApi
3330
- */
3331
- updatePerson(requestParameters) {
3332
- return (0, exports.BetaApiFp)(this.configuration).updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest).then((request) => request(this.axios, this.basePath));
3333
- }
3334
669
  }
3335
670
  exports.BetaApi = BetaApi;