pipedrive 25.0.0 → 27.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 (213) 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 +47 -47
  3. package/dist/esm/versions/v1/api/activity-fields-api.js +1 -1
  4. package/dist/esm/versions/v1/api/activity-types-api.js +5 -5
  5. package/dist/esm/versions/v1/api/billing-api.js +1 -1
  6. package/dist/esm/versions/v1/api/call-logs-api.js +5 -5
  7. package/dist/esm/versions/v1/api/channels-api.js +4 -4
  8. package/dist/esm/versions/v1/api/currencies-api.js +1 -1
  9. package/dist/esm/versions/v1/api/deal-fields-api.js +6 -6
  10. package/dist/esm/versions/v1/api/deals-api.d.ts +410 -88
  11. package/dist/esm/versions/v1/api/deals-api.js +447 -118
  12. package/dist/esm/versions/v1/api/files-api.js +8 -8
  13. package/dist/esm/versions/v1/api/filters-api.js +7 -7
  14. package/dist/esm/versions/v1/api/goals-api.js +5 -5
  15. package/dist/esm/versions/v1/api/item-search-api.d.ts +8 -8
  16. package/dist/esm/versions/v1/api/item-search-api.js +10 -10
  17. package/dist/esm/versions/v1/api/lead-labels-api.js +4 -4
  18. package/dist/esm/versions/v1/api/lead-sources-api.js +1 -1
  19. package/dist/esm/versions/v1/api/leads-api.d.ts +100 -14
  20. package/dist/esm/versions/v1/api/leads-api.js +114 -21
  21. package/dist/esm/versions/v1/api/legacy-teams-api.js +8 -8
  22. package/dist/esm/versions/v1/api/mailbox-api.js +6 -6
  23. package/dist/esm/versions/v1/api/meetings-api.js +2 -2
  24. package/dist/esm/versions/v1/api/note-fields-api.js +1 -1
  25. package/dist/esm/versions/v1/api/notes-api.d.ts +18 -2
  26. package/dist/esm/versions/v1/api/notes-api.js +25 -15
  27. package/dist/esm/versions/v1/api/organization-fields-api.js +6 -6
  28. package/dist/esm/versions/v1/api/organization-relationships-api.js +5 -5
  29. package/dist/esm/versions/v1/api/organizations-api.d.ts +68 -68
  30. package/dist/esm/versions/v1/api/organizations-api.js +88 -88
  31. package/dist/esm/versions/v1/api/permission-sets-api.js +3 -3
  32. package/dist/esm/versions/v1/api/person-fields-api.js +6 -6
  33. package/dist/esm/versions/v1/api/persons-api.d.ts +56 -56
  34. package/dist/esm/versions/v1/api/persons-api.js +78 -78
  35. package/dist/esm/versions/v1/api/pipelines-api.d.ts +28 -28
  36. package/dist/esm/versions/v1/api/pipelines-api.js +36 -36
  37. package/dist/esm/versions/v1/api/product-fields-api.js +6 -6
  38. package/dist/esm/versions/v1/api/products-api.d.ts +24 -24
  39. package/dist/esm/versions/v1/api/products-api.js +36 -36
  40. package/dist/esm/versions/v1/api/project-templates-api.js +4 -4
  41. package/dist/esm/versions/v1/api/projects-api.js +14 -14
  42. package/dist/esm/versions/v1/api/recents-api.js +1 -1
  43. package/dist/esm/versions/v1/api/roles-api.js +12 -12
  44. package/dist/esm/versions/v1/api/stages-api.d.ts +36 -36
  45. package/dist/esm/versions/v1/api/stages-api.js +43 -43
  46. package/dist/esm/versions/v1/api/subscriptions-api.js +9 -9
  47. package/dist/esm/versions/v1/api/tasks-api.js +5 -5
  48. package/dist/esm/versions/v1/api/user-connections-api.js +1 -1
  49. package/dist/esm/versions/v1/api/user-settings-api.js +1 -1
  50. package/dist/esm/versions/v1/api/users-api.js +10 -10
  51. package/dist/esm/versions/v1/api/webhooks-api.js +3 -3
  52. package/dist/esm/versions/v1/base.d.ts +2 -3
  53. package/dist/esm/versions/v1/configuration.d.ts +2 -2
  54. package/dist/esm/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  55. package/dist/esm/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  56. package/dist/esm/versions/v1/models/add-note-request-all-of1.js +4 -0
  57. package/dist/esm/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  58. package/dist/esm/versions/v1/models/index.d.ts +1 -0
  59. package/dist/esm/versions/v1/models/index.js +1 -0
  60. package/dist/esm/versions/v1/models/note-project.d.ts +23 -0
  61. package/dist/esm/versions/v1/models/note-project.js +14 -0
  62. package/dist/esm/versions/v1/models/note-request-all-of1.d.ts +5 -0
  63. package/dist/esm/versions/v1/models/note.d.ts +16 -0
  64. package/dist/esm/versions/v2/api/activities-api.d.ts +15 -7
  65. package/dist/esm/versions/v2/api/activities-api.js +17 -12
  66. package/dist/esm/versions/v2/api/beta-api.d.ts +212 -0
  67. package/dist/esm/versions/v2/api/beta-api.js +290 -4
  68. package/dist/esm/versions/v2/api/deals-api.d.ts +272 -4
  69. package/dist/esm/versions/v2/api/deals-api.js +311 -27
  70. package/dist/esm/versions/v2/api/item-search-api.js +2 -2
  71. package/dist/esm/versions/v2/api/leads-api.d.ts +111 -0
  72. package/dist/esm/versions/v2/api/leads-api.js +147 -2
  73. package/dist/esm/versions/v2/api/organizations-api.js +10 -10
  74. package/dist/esm/versions/v2/api/persons-api.d.ts +8 -8
  75. package/dist/esm/versions/v2/api/persons-api.js +18 -18
  76. package/dist/esm/versions/v2/api/pipelines-api.js +5 -5
  77. package/dist/esm/versions/v2/api/products-api.js +15 -15
  78. package/dist/esm/versions/v2/api/stages-api.js +5 -5
  79. package/dist/esm/versions/v2/api/users-api.js +1 -1
  80. package/dist/esm/versions/v2/base.d.ts +2 -3
  81. package/dist/esm/versions/v2/configuration.d.ts +2 -2
  82. package/dist/esm/versions/v2/models/activity-item.d.ts +5 -0
  83. package/dist/esm/versions/v2/models/activity-item1.d.ts +5 -0
  84. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  85. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.js +14 -0
  86. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  87. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.js +14 -0
  88. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  89. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.js +14 -0
  90. package/dist/esm/versions/v2/models/add-person-request.d.ts +12 -0
  91. package/dist/esm/versions/v2/models/add-person-request.js +6 -1
  92. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  93. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.js +14 -0
  94. package/dist/esm/versions/v2/models/deal-item.d.ts +5 -0
  95. package/dist/esm/versions/v2/models/deal-item1.d.ts +5 -0
  96. package/dist/esm/versions/v2/models/get-convert-response.d.ts +43 -0
  97. package/dist/esm/versions/v2/models/get-convert-response.js +14 -0
  98. package/dist/esm/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  99. package/dist/esm/versions/v2/models/get-convert-response1-data.js +20 -0
  100. package/dist/esm/versions/v2/models/get-convert-response1.d.ts +34 -0
  101. package/dist/esm/versions/v2/models/get-convert-response1.js +14 -0
  102. package/dist/esm/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  103. package/dist/esm/versions/v2/models/index.d.ts +7 -0
  104. package/dist/esm/versions/v2/models/index.js +7 -0
  105. package/dist/esm/versions/v2/models/update-person-request.d.ts +12 -0
  106. package/dist/esm/versions/v2/models/update-person-request.js +6 -1
  107. package/dist/versions/v1/api/activities-api.d.ts +40 -40
  108. package/dist/versions/v1/api/activities-api.js +47 -47
  109. package/dist/versions/v1/api/activity-fields-api.js +1 -1
  110. package/dist/versions/v1/api/activity-types-api.js +5 -5
  111. package/dist/versions/v1/api/billing-api.js +1 -1
  112. package/dist/versions/v1/api/call-logs-api.js +5 -5
  113. package/dist/versions/v1/api/channels-api.js +4 -4
  114. package/dist/versions/v1/api/currencies-api.js +1 -1
  115. package/dist/versions/v1/api/deal-fields-api.js +6 -6
  116. package/dist/versions/v1/api/deals-api.d.ts +410 -88
  117. package/dist/versions/v1/api/deals-api.js +447 -118
  118. package/dist/versions/v1/api/files-api.js +8 -8
  119. package/dist/versions/v1/api/filters-api.js +7 -7
  120. package/dist/versions/v1/api/goals-api.js +5 -5
  121. package/dist/versions/v1/api/item-search-api.d.ts +8 -8
  122. package/dist/versions/v1/api/item-search-api.js +10 -10
  123. package/dist/versions/v1/api/lead-labels-api.js +4 -4
  124. package/dist/versions/v1/api/lead-sources-api.js +1 -1
  125. package/dist/versions/v1/api/leads-api.d.ts +100 -14
  126. package/dist/versions/v1/api/leads-api.js +114 -21
  127. package/dist/versions/v1/api/legacy-teams-api.js +8 -8
  128. package/dist/versions/v1/api/mailbox-api.js +6 -6
  129. package/dist/versions/v1/api/meetings-api.js +2 -2
  130. package/dist/versions/v1/api/note-fields-api.js +1 -1
  131. package/dist/versions/v1/api/notes-api.d.ts +18 -2
  132. package/dist/versions/v1/api/notes-api.js +25 -15
  133. package/dist/versions/v1/api/organization-fields-api.js +6 -6
  134. package/dist/versions/v1/api/organization-relationships-api.js +5 -5
  135. package/dist/versions/v1/api/organizations-api.d.ts +68 -68
  136. package/dist/versions/v1/api/organizations-api.js +88 -88
  137. package/dist/versions/v1/api/permission-sets-api.js +3 -3
  138. package/dist/versions/v1/api/person-fields-api.js +6 -6
  139. package/dist/versions/v1/api/persons-api.d.ts +56 -56
  140. package/dist/versions/v1/api/persons-api.js +78 -78
  141. package/dist/versions/v1/api/pipelines-api.d.ts +28 -28
  142. package/dist/versions/v1/api/pipelines-api.js +36 -36
  143. package/dist/versions/v1/api/product-fields-api.js +6 -6
  144. package/dist/versions/v1/api/products-api.d.ts +24 -24
  145. package/dist/versions/v1/api/products-api.js +36 -36
  146. package/dist/versions/v1/api/project-templates-api.js +4 -4
  147. package/dist/versions/v1/api/projects-api.js +14 -14
  148. package/dist/versions/v1/api/recents-api.js +1 -1
  149. package/dist/versions/v1/api/roles-api.js +12 -12
  150. package/dist/versions/v1/api/stages-api.d.ts +36 -36
  151. package/dist/versions/v1/api/stages-api.js +43 -43
  152. package/dist/versions/v1/api/subscriptions-api.js +9 -9
  153. package/dist/versions/v1/api/tasks-api.js +5 -5
  154. package/dist/versions/v1/api/user-connections-api.js +1 -1
  155. package/dist/versions/v1/api/user-settings-api.js +1 -1
  156. package/dist/versions/v1/api/users-api.js +10 -10
  157. package/dist/versions/v1/api/webhooks-api.js +3 -3
  158. package/dist/versions/v1/base.d.ts +2 -3
  159. package/dist/versions/v1/configuration.d.ts +2 -2
  160. package/dist/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  161. package/dist/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  162. package/dist/versions/v1/models/add-note-request-all-of1.js +5 -1
  163. package/dist/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  164. package/dist/versions/v1/models/index.d.ts +1 -0
  165. package/dist/versions/v1/models/index.js +1 -0
  166. package/dist/versions/v1/models/note-project.d.ts +23 -0
  167. package/dist/versions/v1/models/note-project.js +15 -0
  168. package/dist/versions/v1/models/note-request-all-of1.d.ts +5 -0
  169. package/dist/versions/v1/models/note.d.ts +16 -0
  170. package/dist/versions/v2/api/activities-api.d.ts +15 -7
  171. package/dist/versions/v2/api/activities-api.js +17 -12
  172. package/dist/versions/v2/api/beta-api.d.ts +212 -0
  173. package/dist/versions/v2/api/beta-api.js +290 -4
  174. package/dist/versions/v2/api/deals-api.d.ts +272 -4
  175. package/dist/versions/v2/api/deals-api.js +311 -27
  176. package/dist/versions/v2/api/item-search-api.js +2 -2
  177. package/dist/versions/v2/api/leads-api.d.ts +111 -0
  178. package/dist/versions/v2/api/leads-api.js +146 -1
  179. package/dist/versions/v2/api/organizations-api.js +10 -10
  180. package/dist/versions/v2/api/persons-api.d.ts +8 -8
  181. package/dist/versions/v2/api/persons-api.js +18 -18
  182. package/dist/versions/v2/api/pipelines-api.js +5 -5
  183. package/dist/versions/v2/api/products-api.js +15 -15
  184. package/dist/versions/v2/api/stages-api.js +5 -5
  185. package/dist/versions/v2/api/users-api.js +1 -1
  186. package/dist/versions/v2/base.d.ts +2 -3
  187. package/dist/versions/v2/configuration.d.ts +2 -2
  188. package/dist/versions/v2/models/activity-item.d.ts +5 -0
  189. package/dist/versions/v2/models/activity-item1.d.ts +5 -0
  190. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  191. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.js +15 -0
  192. package/dist/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  193. package/dist/versions/v2/models/add-convert-deal-to-lead-response.js +15 -0
  194. package/dist/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  195. package/dist/versions/v2/models/add-convert-lead-to-deal-response.js +15 -0
  196. package/dist/versions/v2/models/add-person-request.d.ts +12 -0
  197. package/dist/versions/v2/models/add-person-request.js +7 -0
  198. package/dist/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  199. package/dist/versions/v2/models/convert-lead-to-deal-request.js +15 -0
  200. package/dist/versions/v2/models/deal-item.d.ts +5 -0
  201. package/dist/versions/v2/models/deal-item1.d.ts +5 -0
  202. package/dist/versions/v2/models/get-convert-response.d.ts +43 -0
  203. package/dist/versions/v2/models/get-convert-response.js +15 -0
  204. package/dist/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  205. package/dist/versions/v2/models/get-convert-response1-data.js +23 -0
  206. package/dist/versions/v2/models/get-convert-response1.d.ts +34 -0
  207. package/dist/versions/v2/models/get-convert-response1.js +15 -0
  208. package/dist/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  209. package/dist/versions/v2/models/index.d.ts +7 -0
  210. package/dist/versions/v2/models/index.js +7 -0
  211. package/dist/versions/v2/models/update-person-request.d.ts +12 -0
  212. package/dist/versions/v2/models/update-person-request.js +7 -0
  213. package/package.json +1 -1
@@ -32,6 +32,77 @@ import { BASE_PATH, BaseAPI } from '../base';
32
32
  */
33
33
  export const BetaApiAxiosParamCreator = function (configuration) {
34
34
  return {
35
+ /**
36
+ * 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.
37
+ * @summary Convert a deal to a lead (BETA)
38
+ * @param {number} id The ID of the deal to convert
39
+
40
+ * @throws {RequiredError}
41
+ */
42
+ convertDealToLead: (id) => __awaiter(this, void 0, void 0, function* () {
43
+ // verify required parameter 'id' is not null or undefined
44
+ assertParamExists('convertDealToLead', 'id', id);
45
+ const localVarPath = `/deals/{id}/convert/lead`
46
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
47
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
48
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
49
+ let baseOptions;
50
+ if (configuration) {
51
+ baseOptions = configuration.baseOptions;
52
+ }
53
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
54
+ const localVarHeaderParameter = {};
55
+ const localVarQueryParameter = {};
56
+ // authentication api_key required
57
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
58
+ // authentication oauth2 required
59
+ // oauth required
60
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
61
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
62
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
63
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
64
+ return {
65
+ url: toPathString(localVarUrlObj),
66
+ options: localVarRequestOptions,
67
+ };
68
+ }),
69
+ /**
70
+ * 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.
71
+ * @summary Convert a lead to a deal (BETA)
72
+ * @param {string} id The ID of the lead to convert
73
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
74
+
75
+ * @throws {RequiredError}
76
+ */
77
+ convertLeadToDeal: (id, ConvertLeadToDealRequest) => __awaiter(this, void 0, void 0, function* () {
78
+ // verify required parameter 'id' is not null or undefined
79
+ assertParamExists('convertLeadToDeal', 'id', id);
80
+ const localVarPath = `/leads/{id}/convert/deal`
81
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
82
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
83
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
84
+ let baseOptions;
85
+ if (configuration) {
86
+ baseOptions = configuration.baseOptions;
87
+ }
88
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
89
+ const localVarHeaderParameter = {};
90
+ const localVarQueryParameter = {};
91
+ // authentication api_key required
92
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
93
+ // authentication oauth2 required
94
+ // oauth required
95
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
96
+ localVarHeaderParameter['Content-Type'] = 'application/json';
97
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
98
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
99
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
100
+ localVarRequestOptions.data = serializeDataIfNeeded(ConvertLeadToDealRequest, localVarRequestOptions, configuration);
101
+ return {
102
+ url: toPathString(localVarUrlObj),
103
+ options: localVarRequestOptions,
104
+ };
105
+ }),
35
106
  /**
36
107
  * Removes an installment from a deal. Only available in Advanced and above plans.
37
108
  * @summary Delete an installment from a deal
@@ -58,7 +129,7 @@ export const BetaApiAxiosParamCreator = function (configuration) {
58
129
  const localVarHeaderParameter = {};
59
130
  const localVarQueryParameter = {};
60
131
  // authentication api_key required
61
- yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
132
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
62
133
  // authentication oauth2 required
63
134
  // oauth required
64
135
  yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -70,6 +141,44 @@ export const BetaApiAxiosParamCreator = function (configuration) {
70
141
  options: localVarRequestOptions,
71
142
  };
72
143
  }),
144
+ /**
145
+ * 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.
146
+ * @summary Get Deal conversion status (BETA)
147
+ * @param {number} id The ID of a deal
148
+ * @param {string} conversion_id The ID of the conversion
149
+
150
+ * @throws {RequiredError}
151
+ */
152
+ getDealConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
153
+ // verify required parameter 'id' is not null or undefined
154
+ assertParamExists('getDealConversionStatus', 'id', id);
155
+ // verify required parameter 'conversion_id' is not null or undefined
156
+ assertParamExists('getDealConversionStatus', 'conversion_id', conversion_id);
157
+ const localVarPath = `/deals/{id}/convert/status/{conversion_id}`
158
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
159
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
160
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
161
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
162
+ let baseOptions;
163
+ if (configuration) {
164
+ baseOptions = configuration.baseOptions;
165
+ }
166
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
167
+ const localVarHeaderParameter = {};
168
+ const localVarQueryParameter = {};
169
+ // authentication api_key required
170
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
171
+ // authentication oauth2 required
172
+ // oauth required
173
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read"], configuration);
174
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
175
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
176
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
177
+ return {
178
+ url: toPathString(localVarUrlObj),
179
+ options: localVarRequestOptions,
180
+ };
181
+ }),
73
182
  /**
74
183
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
75
184
  * @summary List installments added to a list of deals
@@ -95,7 +204,7 @@ export const BetaApiAxiosParamCreator = function (configuration) {
95
204
  const localVarHeaderParameter = {};
96
205
  const localVarQueryParameter = {};
97
206
  // authentication api_key required
98
- yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
207
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
99
208
  // authentication oauth2 required
100
209
  // oauth required
101
210
  yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -122,6 +231,44 @@ export const BetaApiAxiosParamCreator = function (configuration) {
122
231
  options: localVarRequestOptions,
123
232
  };
124
233
  }),
234
+ /**
235
+ * 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.
236
+ * @summary Get Lead conversion status (BETA)
237
+ * @param {string} id The ID of a lead
238
+ * @param {string} conversion_id The ID of the conversion
239
+
240
+ * @throws {RequiredError}
241
+ */
242
+ getLeadConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
243
+ // verify required parameter 'id' is not null or undefined
244
+ assertParamExists('getLeadConversionStatus', 'id', id);
245
+ // verify required parameter 'conversion_id' is not null or undefined
246
+ assertParamExists('getLeadConversionStatus', 'conversion_id', conversion_id);
247
+ const localVarPath = `/leads/{id}/convert/status/{conversion_id}`
248
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
249
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
250
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
251
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
252
+ let baseOptions;
253
+ if (configuration) {
254
+ baseOptions = configuration.baseOptions;
255
+ }
256
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
257
+ const localVarHeaderParameter = {};
258
+ const localVarQueryParameter = {};
259
+ // authentication api_key required
260
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
261
+ // authentication oauth2 required
262
+ // oauth required
263
+ yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read"], configuration);
264
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
265
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
266
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
267
+ return {
268
+ url: toPathString(localVarUrlObj),
269
+ options: localVarRequestOptions,
270
+ };
271
+ }),
125
272
  /**
126
273
  * 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.
127
274
  * @summary Add an installment to a deal
@@ -145,7 +292,7 @@ export const BetaApiAxiosParamCreator = function (configuration) {
145
292
  const localVarHeaderParameter = {};
146
293
  const localVarQueryParameter = {};
147
294
  // authentication api_key required
148
- yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
295
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
149
296
  // authentication oauth2 required
150
297
  // oauth required
151
298
  yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -186,7 +333,7 @@ export const BetaApiAxiosParamCreator = function (configuration) {
186
333
  const localVarHeaderParameter = {};
187
334
  const localVarQueryParameter = {};
188
335
  // authentication api_key required
189
- yield setApiKeyToObject(localVarQueryParameter, "api_token", configuration);
336
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration);
190
337
  // authentication oauth2 required
191
338
  // oauth required
192
339
  yield setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -209,6 +356,33 @@ export const BetaApiAxiosParamCreator = function (configuration) {
209
356
  export const BetaApiFp = function (configuration) {
210
357
  const localVarAxiosParamCreator = BetaApiAxiosParamCreator(configuration);
211
358
  return {
359
+ /**
360
+ * 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.
361
+ * @summary Convert a deal to a lead (BETA)
362
+ * @param {number} id The ID of the deal to convert
363
+
364
+ * @throws {RequiredError}
365
+ */
366
+ convertDealToLead(id) {
367
+ return __awaiter(this, void 0, void 0, function* () {
368
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertDealToLead(id);
369
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
370
+ });
371
+ },
372
+ /**
373
+ * 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.
374
+ * @summary Convert a lead to a deal (BETA)
375
+ * @param {string} id The ID of the lead to convert
376
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
377
+
378
+ * @throws {RequiredError}
379
+ */
380
+ convertLeadToDeal(id, ConvertLeadToDealRequest) {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest);
383
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
384
+ });
385
+ },
212
386
  /**
213
387
  * Removes an installment from a deal. Only available in Advanced and above plans.
214
388
  * @summary Delete an installment from a deal
@@ -223,6 +397,20 @@ export const BetaApiFp = function (configuration) {
223
397
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
224
398
  });
225
399
  },
400
+ /**
401
+ * 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.
402
+ * @summary Get Deal conversion status (BETA)
403
+ * @param {number} id The ID of a deal
404
+ * @param {string} conversion_id The ID of the conversion
405
+
406
+ * @throws {RequiredError}
407
+ */
408
+ getDealConversionStatus(id, conversion_id) {
409
+ return __awaiter(this, void 0, void 0, function* () {
410
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id);
411
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
412
+ });
413
+ },
226
414
  /**
227
415
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
228
416
  * @summary List installments added to a list of deals
@@ -240,6 +428,20 @@ export const BetaApiFp = function (configuration) {
240
428
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
241
429
  });
242
430
  },
431
+ /**
432
+ * 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.
433
+ * @summary Get Lead conversion status (BETA)
434
+ * @param {string} id The ID of a lead
435
+ * @param {string} conversion_id The ID of the conversion
436
+
437
+ * @throws {RequiredError}
438
+ */
439
+ getLeadConversionStatus(id, conversion_id) {
440
+ return __awaiter(this, void 0, void 0, function* () {
441
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id);
442
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
443
+ });
444
+ },
243
445
  /**
244
446
  * 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.
245
447
  * @summary Add an installment to a deal
@@ -278,6 +480,26 @@ export const BetaApiFp = function (configuration) {
278
480
  export const BetaApiFactory = function (configuration, basePath, axios) {
279
481
  const localVarFp = BetaApiFp(configuration);
280
482
  return {
483
+ /**
484
+ * 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.
485
+ * @summary Convert a deal to a lead (BETA)
486
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
487
+
488
+ * @throws {RequiredError}
489
+ */
490
+ convertDealToLead(requestParameters) {
491
+ return localVarFp.convertDealToLead(requestParameters.id).then((request) => request(axios, basePath));
492
+ },
493
+ /**
494
+ * 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.
495
+ * @summary Convert a lead to a deal (BETA)
496
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
497
+
498
+ * @throws {RequiredError}
499
+ */
500
+ convertLeadToDeal(requestParameters) {
501
+ return localVarFp.convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(axios, basePath));
502
+ },
281
503
  /**
282
504
  * Removes an installment from a deal. Only available in Advanced and above plans.
283
505
  * @summary Delete an installment from a deal
@@ -288,6 +510,16 @@ export const BetaApiFactory = function (configuration, basePath, axios) {
288
510
  deleteInstallment(requestParameters) {
289
511
  return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(axios, basePath));
290
512
  },
513
+ /**
514
+ * 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.
515
+ * @summary Get Deal conversion status (BETA)
516
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
517
+
518
+ * @throws {RequiredError}
519
+ */
520
+ getDealConversionStatus(requestParameters) {
521
+ return localVarFp.getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
522
+ },
291
523
  /**
292
524
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
293
525
  * @summary List installments added to a list of deals
@@ -298,6 +530,16 @@ export const BetaApiFactory = function (configuration, basePath, axios) {
298
530
  getInstallments(requestParameters) {
299
531
  return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
300
532
  },
533
+ /**
534
+ * 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.
535
+ * @summary Get Lead conversion status (BETA)
536
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
537
+
538
+ * @throws {RequiredError}
539
+ */
540
+ getLeadConversionStatus(requestParameters) {
541
+ return localVarFp.getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
542
+ },
301
543
  /**
302
544
  * 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.
303
545
  * @summary Add an installment to a deal
@@ -327,6 +569,28 @@ export const BetaApiFactory = function (configuration, basePath, axios) {
327
569
  * @extends {BaseAPI}
328
570
  */
329
571
  export class BetaApi extends BaseAPI {
572
+ /**
573
+ * 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.
574
+ * @summary Convert a deal to a lead (BETA)
575
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
576
+
577
+ * @throws {RequiredError}
578
+ * @memberof BetaApi
579
+ */
580
+ convertDealToLead(requestParameters) {
581
+ return BetaApiFp(this.configuration).convertDealToLead(requestParameters.id).then((request) => request(this.axios, this.basePath));
582
+ }
583
+ /**
584
+ * 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.
585
+ * @summary Convert a lead to a deal (BETA)
586
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
587
+
588
+ * @throws {RequiredError}
589
+ * @memberof BetaApi
590
+ */
591
+ convertLeadToDeal(requestParameters) {
592
+ return BetaApiFp(this.configuration).convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(this.axios, this.basePath));
593
+ }
330
594
  /**
331
595
  * Removes an installment from a deal. Only available in Advanced and above plans.
332
596
  * @summary Delete an installment from a deal
@@ -338,6 +602,17 @@ export class BetaApi extends BaseAPI {
338
602
  deleteInstallment(requestParameters) {
339
603
  return BetaApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(this.axios, this.basePath));
340
604
  }
605
+ /**
606
+ * 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.
607
+ * @summary Get Deal conversion status (BETA)
608
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
609
+
610
+ * @throws {RequiredError}
611
+ * @memberof BetaApi
612
+ */
613
+ getDealConversionStatus(requestParameters) {
614
+ return BetaApiFp(this.configuration).getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
615
+ }
341
616
  /**
342
617
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
343
618
  * @summary List installments added to a list of deals
@@ -349,6 +624,17 @@ export class BetaApi extends BaseAPI {
349
624
  getInstallments(requestParameters) {
350
625
  return BetaApiFp(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
351
626
  }
627
+ /**
628
+ * 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.
629
+ * @summary Get Lead conversion status (BETA)
630
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
631
+
632
+ * @throws {RequiredError}
633
+ * @memberof BetaApi
634
+ */
635
+ getLeadConversionStatus(requestParameters) {
636
+ return BetaApiFp(this.configuration).getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
637
+ }
352
638
  /**
353
639
  * 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.
354
640
  * @summary Add an installment to a deal