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
@@ -57,7 +57,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
57
57
  const localVarHeaderParameter = {};
58
58
  const localVarQueryParameter = {};
59
59
  // authentication api_key required
60
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
60
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
61
61
  // authentication oauth2 required
62
62
  // oauth required
63
63
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
@@ -94,7 +94,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
94
94
  const localVarHeaderParameter = {};
95
95
  const localVarQueryParameter = {};
96
96
  // authentication api_key required
97
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
97
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
98
98
  // authentication oauth2 required
99
99
  // oauth required
100
100
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
@@ -131,7 +131,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
131
131
  const localVarHeaderParameter = {};
132
132
  const localVarQueryParameter = {};
133
133
  // authentication api_key required
134
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
134
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
135
135
  // authentication oauth2 required
136
136
  // oauth required
137
137
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
@@ -145,6 +145,40 @@ const DealsApiAxiosParamCreator = function (configuration) {
145
145
  options: localVarRequestOptions,
146
146
  };
147
147
  }),
148
+ /**
149
+ * 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.
150
+ * @summary Convert a deal to a lead (BETA)
151
+ * @param {number} id The ID of the deal to convert
152
+
153
+ * @throws {RequiredError}
154
+ */
155
+ convertDealToLead: (id) => __awaiter(this, void 0, void 0, function* () {
156
+ // verify required parameter 'id' is not null or undefined
157
+ (0, common_1.assertParamExists)('convertDealToLead', 'id', id);
158
+ const localVarPath = `/deals/{id}/convert/lead`
159
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
160
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
161
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
162
+ let baseOptions;
163
+ if (configuration) {
164
+ baseOptions = configuration.baseOptions;
165
+ }
166
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
167
+ const localVarHeaderParameter = {};
168
+ const localVarQueryParameter = {};
169
+ // authentication api_key required
170
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
171
+ // authentication oauth2 required
172
+ // oauth required
173
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
174
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
175
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
176
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
177
+ return {
178
+ url: (0, common_1.toPathString)(localVarUrlObj),
179
+ options: localVarRequestOptions,
180
+ };
181
+ }),
148
182
  /**
149
183
  * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
150
184
  * @summary Delete a discount from a deal
@@ -171,7 +205,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
171
205
  const localVarHeaderParameter = {};
172
206
  const localVarQueryParameter = {};
173
207
  // authentication api_key required
174
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
208
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
175
209
  // authentication oauth2 required
176
210
  // oauth required
177
211
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -205,7 +239,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
205
239
  const localVarHeaderParameter = {};
206
240
  const localVarQueryParameter = {};
207
241
  // authentication api_key required
208
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
242
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
209
243
  // authentication oauth2 required
210
244
  // oauth required
211
245
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
@@ -243,7 +277,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
243
277
  const localVarHeaderParameter = {};
244
278
  const localVarQueryParameter = {};
245
279
  // authentication api_key required
246
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
280
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
247
281
  // authentication oauth2 required
248
282
  // oauth required
249
283
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
@@ -281,7 +315,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
281
315
  const localVarHeaderParameter = {};
282
316
  const localVarQueryParameter = {};
283
317
  // authentication api_key required
284
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
318
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
285
319
  // authentication oauth2 required
286
320
  // oauth required
287
321
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "products:full"], configuration);
@@ -319,7 +353,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
319
353
  const localVarHeaderParameter = {};
320
354
  const localVarQueryParameter = {};
321
355
  // authentication api_key required
322
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
356
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
323
357
  // authentication oauth2 required
324
358
  // oauth required
325
359
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -353,7 +387,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
353
387
  const localVarHeaderParameter = {};
354
388
  const localVarQueryParameter = {};
355
389
  // authentication api_key required
356
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
390
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
357
391
  // authentication oauth2 required
358
392
  // oauth required
359
393
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -365,6 +399,100 @@ const DealsApiAxiosParamCreator = function (configuration) {
365
399
  options: localVarRequestOptions,
366
400
  };
367
401
  }),
402
+ /**
403
+ * Returns data about all archived deals.
404
+ * @summary Get all archived deals
405
+ * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
406
+ * @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.
407
+ * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
408
+ * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
409
+ * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
410
+ * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
411
+ * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
412
+ * @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.
413
+ * @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.
414
+ * @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.
415
+ * @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;.
416
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
417
+ * @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
418
+ * @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.
419
+ * @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.
420
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
421
+
422
+ * @throws {RequiredError}
423
+ */
424
+ getArchivedDeals: (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* () {
425
+ const localVarPath = `/deals/archived`;
426
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
427
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
428
+ let baseOptions;
429
+ if (configuration) {
430
+ baseOptions = configuration.baseOptions;
431
+ }
432
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
433
+ const localVarHeaderParameter = {};
434
+ const localVarQueryParameter = {};
435
+ // authentication api_key required
436
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
437
+ // authentication oauth2 required
438
+ // oauth required
439
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
440
+ if (filter_id !== undefined) {
441
+ localVarQueryParameter['filter_id'] = filter_id;
442
+ }
443
+ if (ids !== undefined) {
444
+ localVarQueryParameter['ids'] = ids;
445
+ }
446
+ if (owner_id !== undefined) {
447
+ localVarQueryParameter['owner_id'] = owner_id;
448
+ }
449
+ if (person_id !== undefined) {
450
+ localVarQueryParameter['person_id'] = person_id;
451
+ }
452
+ if (org_id !== undefined) {
453
+ localVarQueryParameter['org_id'] = org_id;
454
+ }
455
+ if (pipeline_id !== undefined) {
456
+ localVarQueryParameter['pipeline_id'] = pipeline_id;
457
+ }
458
+ if (stage_id !== undefined) {
459
+ localVarQueryParameter['stage_id'] = stage_id;
460
+ }
461
+ if (status !== undefined) {
462
+ localVarQueryParameter['status'] = status;
463
+ }
464
+ if (updated_since !== undefined) {
465
+ localVarQueryParameter['updated_since'] = updated_since;
466
+ }
467
+ if (updated_until !== undefined) {
468
+ localVarQueryParameter['updated_until'] = updated_until;
469
+ }
470
+ if (sort_by !== undefined) {
471
+ localVarQueryParameter['sort_by'] = sort_by;
472
+ }
473
+ if (sort_direction !== undefined) {
474
+ localVarQueryParameter['sort_direction'] = sort_direction;
475
+ }
476
+ if (include_fields !== undefined) {
477
+ localVarQueryParameter['include_fields'] = include_fields;
478
+ }
479
+ if (custom_fields !== undefined) {
480
+ localVarQueryParameter['custom_fields'] = custom_fields;
481
+ }
482
+ if (limit !== undefined) {
483
+ localVarQueryParameter['limit'] = limit;
484
+ }
485
+ if (cursor !== undefined) {
486
+ localVarQueryParameter['cursor'] = cursor;
487
+ }
488
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
489
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
490
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
491
+ return {
492
+ url: (0, common_1.toPathString)(localVarUrlObj),
493
+ options: localVarRequestOptions,
494
+ };
495
+ }),
368
496
  /**
369
497
  * Returns the details of a specific deal.
370
498
  * @summary Get details of a deal
@@ -389,7 +517,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
389
517
  const localVarHeaderParameter = {};
390
518
  const localVarQueryParameter = {};
391
519
  // authentication api_key required
392
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
520
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
393
521
  // authentication oauth2 required
394
522
  // oauth required
395
523
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -407,6 +535,44 @@ const DealsApiAxiosParamCreator = function (configuration) {
407
535
  options: localVarRequestOptions,
408
536
  };
409
537
  }),
538
+ /**
539
+ * 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.
540
+ * @summary Get Deal conversion status (BETA)
541
+ * @param {number} id The ID of a deal
542
+ * @param {string} conversion_id The ID of the conversion
543
+
544
+ * @throws {RequiredError}
545
+ */
546
+ getDealConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
547
+ // verify required parameter 'id' is not null or undefined
548
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'id', id);
549
+ // verify required parameter 'conversion_id' is not null or undefined
550
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'conversion_id', conversion_id);
551
+ const localVarPath = `/deals/{id}/convert/status/{conversion_id}`
552
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
553
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
554
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
555
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
556
+ let baseOptions;
557
+ if (configuration) {
558
+ baseOptions = configuration.baseOptions;
559
+ }
560
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
561
+ const localVarHeaderParameter = {};
562
+ const localVarQueryParameter = {};
563
+ // authentication api_key required
564
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
565
+ // authentication oauth2 required
566
+ // oauth required
567
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read"], configuration);
568
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
569
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
570
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
571
+ return {
572
+ url: (0, common_1.toPathString)(localVarUrlObj),
573
+ options: localVarRequestOptions,
574
+ };
575
+ }),
410
576
  /**
411
577
  * Lists users who are following the deal.
412
578
  * @summary List followers of a deal
@@ -431,7 +597,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
431
597
  const localVarHeaderParameter = {};
432
598
  const localVarQueryParameter = {};
433
599
  // authentication api_key required
434
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
600
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
435
601
  // authentication oauth2 required
436
602
  // oauth required
437
603
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -473,7 +639,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
473
639
  const localVarHeaderParameter = {};
474
640
  const localVarQueryParameter = {};
475
641
  // authentication api_key required
476
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
642
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
477
643
  // authentication oauth2 required
478
644
  // oauth required
479
645
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -517,7 +683,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
517
683
  const localVarHeaderParameter = {};
518
684
  const localVarQueryParameter = {};
519
685
  // authentication api_key required
520
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
686
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
521
687
  // authentication oauth2 required
522
688
  // oauth required
523
689
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
@@ -542,7 +708,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
542
708
  };
543
709
  }),
544
710
  /**
545
- * Returns data about all deals.
711
+ * Returns data about all not archived deals.
546
712
  * @summary Get all deals
547
713
  * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
548
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.
@@ -575,7 +741,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
575
741
  const localVarHeaderParameter = {};
576
742
  const localVarQueryParameter = {};
577
743
  // authentication api_key required
578
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
744
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
579
745
  // authentication oauth2 required
580
746
  // oauth required
581
747
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -660,7 +826,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
660
826
  const localVarHeaderParameter = {};
661
827
  const localVarQueryParameter = {};
662
828
  // authentication api_key required
663
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
829
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
664
830
  // authentication oauth2 required
665
831
  // oauth required
666
832
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
@@ -712,7 +878,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
712
878
  const localVarHeaderParameter = {};
713
879
  const localVarQueryParameter = {};
714
880
  // authentication api_key required
715
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
881
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
716
882
  // authentication oauth2 required
717
883
  // oauth required
718
884
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -762,7 +928,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
762
928
  const localVarHeaderParameter = {};
763
929
  const localVarQueryParameter = {};
764
930
  // authentication api_key required
765
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
931
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
766
932
  // authentication oauth2 required
767
933
  // oauth required
768
934
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -799,7 +965,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
799
965
  const localVarHeaderParameter = {};
800
966
  const localVarQueryParameter = {};
801
967
  // authentication api_key required
802
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
968
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
803
969
  // authentication oauth2 required
804
970
  // oauth required
805
971
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -842,7 +1008,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
842
1008
  const localVarHeaderParameter = {};
843
1009
  const localVarQueryParameter = {};
844
1010
  // authentication api_key required
845
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1011
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
846
1012
  // authentication oauth2 required
847
1013
  // oauth required
848
1014
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full", "search:read"], configuration);
@@ -908,7 +1074,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
908
1074
  const localVarHeaderParameter = {};
909
1075
  const localVarQueryParameter = {};
910
1076
  // authentication api_key required
911
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1077
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
912
1078
  // authentication oauth2 required
913
1079
  // oauth required
914
1080
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -945,7 +1111,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
945
1111
  const localVarHeaderParameter = {};
946
1112
  const localVarQueryParameter = {};
947
1113
  // authentication api_key required
948
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1114
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
949
1115
  // authentication oauth2 required
950
1116
  // oauth required
951
1117
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
@@ -986,7 +1152,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
986
1152
  const localVarHeaderParameter = {};
987
1153
  const localVarQueryParameter = {};
988
1154
  // authentication api_key required
989
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1155
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
990
1156
  // authentication oauth2 required
991
1157
  // oauth required
992
1158
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
@@ -1027,7 +1193,7 @@ const DealsApiAxiosParamCreator = function (configuration) {
1027
1193
  const localVarHeaderParameter = {};
1028
1194
  const localVarQueryParameter = {};
1029
1195
  // authentication api_key required
1030
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1196
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
1031
1197
  // authentication oauth2 required
1032
1198
  // oauth required
1033
1199
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
@@ -1092,6 +1258,19 @@ const DealsApiFp = function (configuration) {
1092
1258
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1093
1259
  });
1094
1260
  },
1261
+ /**
1262
+ * 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.
1263
+ * @summary Convert a deal to a lead (BETA)
1264
+ * @param {number} id The ID of the deal to convert
1265
+
1266
+ * @throws {RequiredError}
1267
+ */
1268
+ convertDealToLead(id) {
1269
+ return __awaiter(this, void 0, void 0, function* () {
1270
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertDealToLead(id);
1271
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1272
+ });
1273
+ },
1095
1274
  /**
1096
1275
  * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
1097
1276
  * @summary Delete a discount from a deal
@@ -1174,6 +1353,34 @@ const DealsApiFp = function (configuration) {
1174
1353
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1175
1354
  });
1176
1355
  },
1356
+ /**
1357
+ * Returns data about all archived deals.
1358
+ * @summary Get all archived deals
1359
+ * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
1360
+ * @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.
1361
+ * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
1362
+ * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
1363
+ * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
1364
+ * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
1365
+ * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
1366
+ * @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.
1367
+ * @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.
1368
+ * @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.
1369
+ * @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;.
1370
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1371
+ * @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
1372
+ * @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.
1373
+ * @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.
1374
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1375
+
1376
+ * @throws {RequiredError}
1377
+ */
1378
+ getArchivedDeals(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) {
1379
+ return __awaiter(this, void 0, void 0, function* () {
1380
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getArchivedDeals(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);
1381
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1382
+ });
1383
+ },
1177
1384
  /**
1178
1385
  * Returns the details of a specific deal.
1179
1386
  * @summary Get details of a deal
@@ -1189,6 +1396,20 @@ const DealsApiFp = function (configuration) {
1189
1396
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1190
1397
  });
1191
1398
  },
1399
+ /**
1400
+ * 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.
1401
+ * @summary Get Deal conversion status (BETA)
1402
+ * @param {number} id The ID of a deal
1403
+ * @param {string} conversion_id The ID of the conversion
1404
+
1405
+ * @throws {RequiredError}
1406
+ */
1407
+ getDealConversionStatus(id, conversion_id) {
1408
+ return __awaiter(this, void 0, void 0, function* () {
1409
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id);
1410
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1411
+ });
1412
+ },
1192
1413
  /**
1193
1414
  * Lists users who are following the deal.
1194
1415
  * @summary List followers of a deal
@@ -1237,7 +1458,7 @@ const DealsApiFp = function (configuration) {
1237
1458
  });
1238
1459
  },
1239
1460
  /**
1240
- * Returns data about all deals.
1461
+ * Returns data about all not archived deals.
1241
1462
  * @summary Get all deals
1242
1463
  * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
1243
1464
  * @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.
@@ -1446,6 +1667,16 @@ const DealsApiFactory = function (configuration, basePath, axios) {
1446
1667
  addDealProduct(requestParameters) {
1447
1668
  return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(axios, basePath));
1448
1669
  },
1670
+ /**
1671
+ * 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.
1672
+ * @summary Convert a deal to a lead (BETA)
1673
+ * @param {DealsApiConvertDealToLeadRequest} requestParameters Request parameters.
1674
+
1675
+ * @throws {RequiredError}
1676
+ */
1677
+ convertDealToLead(requestParameters) {
1678
+ return localVarFp.convertDealToLead(requestParameters.id).then((request) => request(axios, basePath));
1679
+ },
1449
1680
  /**
1450
1681
  * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
1451
1682
  * @summary Delete a discount from a deal
@@ -1506,6 +1737,16 @@ const DealsApiFactory = function (configuration, basePath, axios) {
1506
1737
  getAdditionalDiscounts(requestParameters) {
1507
1738
  return localVarFp.getAdditionalDiscounts(requestParameters.id).then((request) => request(axios, basePath));
1508
1739
  },
1740
+ /**
1741
+ * Returns data about all archived deals.
1742
+ * @summary Get all archived deals
1743
+ * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters.
1744
+
1745
+ * @throws {RequiredError}
1746
+ */
1747
+ getArchivedDeals(requestParameters = {}) {
1748
+ return localVarFp.getArchivedDeals(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));
1749
+ },
1509
1750
  /**
1510
1751
  * Returns the details of a specific deal.
1511
1752
  * @summary Get details of a deal
@@ -1516,6 +1757,16 @@ const DealsApiFactory = function (configuration, basePath, axios) {
1516
1757
  getDeal(requestParameters) {
1517
1758
  return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
1518
1759
  },
1760
+ /**
1761
+ * 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.
1762
+ * @summary Get Deal conversion status (BETA)
1763
+ * @param {DealsApiGetDealConversionStatusRequest} requestParameters Request parameters.
1764
+
1765
+ * @throws {RequiredError}
1766
+ */
1767
+ getDealConversionStatus(requestParameters) {
1768
+ return localVarFp.getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
1769
+ },
1519
1770
  /**
1520
1771
  * Lists users who are following the deal.
1521
1772
  * @summary List followers of a deal
@@ -1547,7 +1798,7 @@ const DealsApiFactory = function (configuration, basePath, axios) {
1547
1798
  return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
1548
1799
  },
1549
1800
  /**
1550
- * Returns data about all deals.
1801
+ * Returns data about all not archived deals.
1551
1802
  * @summary Get all deals
1552
1803
  * @param {DealsApiGetDealsRequest} requestParameters Request parameters.
1553
1804
 
@@ -1689,6 +1940,17 @@ class DealsApi extends base_1.BaseAPI {
1689
1940
  addDealProduct(requestParameters) {
1690
1941
  return (0, exports.DealsApiFp)(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(this.axios, this.basePath));
1691
1942
  }
1943
+ /**
1944
+ * 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.
1945
+ * @summary Convert a deal to a lead (BETA)
1946
+ * @param {DealsApiConvertDealToLeadRequest} requestParameters Request parameters.
1947
+
1948
+ * @throws {RequiredError}
1949
+ * @memberof DealsApi
1950
+ */
1951
+ convertDealToLead(requestParameters) {
1952
+ return (0, exports.DealsApiFp)(this.configuration).convertDealToLead(requestParameters.id).then((request) => request(this.axios, this.basePath));
1953
+ }
1692
1954
  /**
1693
1955
  * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
1694
1956
  * @summary Delete a discount from a deal
@@ -1755,6 +2017,17 @@ class DealsApi extends base_1.BaseAPI {
1755
2017
  getAdditionalDiscounts(requestParameters) {
1756
2018
  return (0, exports.DealsApiFp)(this.configuration).getAdditionalDiscounts(requestParameters.id).then((request) => request(this.axios, this.basePath));
1757
2019
  }
2020
+ /**
2021
+ * Returns data about all archived deals.
2022
+ * @summary Get all archived deals
2023
+ * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters.
2024
+
2025
+ * @throws {RequiredError}
2026
+ * @memberof DealsApi
2027
+ */
2028
+ getArchivedDeals(requestParameters = {}) {
2029
+ return (0, exports.DealsApiFp)(this.configuration).getArchivedDeals(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));
2030
+ }
1758
2031
  /**
1759
2032
  * Returns the details of a specific deal.
1760
2033
  * @summary Get details of a deal
@@ -1766,6 +2039,17 @@ class DealsApi extends base_1.BaseAPI {
1766
2039
  getDeal(requestParameters) {
1767
2040
  return (0, exports.DealsApiFp)(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
1768
2041
  }
2042
+ /**
2043
+ * 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.
2044
+ * @summary Get Deal conversion status (BETA)
2045
+ * @param {DealsApiGetDealConversionStatusRequest} requestParameters Request parameters.
2046
+
2047
+ * @throws {RequiredError}
2048
+ * @memberof DealsApi
2049
+ */
2050
+ getDealConversionStatus(requestParameters) {
2051
+ return (0, exports.DealsApiFp)(this.configuration).getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
2052
+ }
1769
2053
  /**
1770
2054
  * Lists users who are following the deal.
1771
2055
  * @summary List followers of a deal
@@ -1800,7 +2084,7 @@ class DealsApi extends base_1.BaseAPI {
1800
2084
  return (0, exports.DealsApiFp)(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
1801
2085
  }
1802
2086
  /**
1803
- * Returns data about all deals.
2087
+ * Returns data about all not archived deals.
1804
2088
  * @summary Get all deals
1805
2089
  * @param {DealsApiGetDealsRequest} requestParameters Request parameters.
1806
2090
 
@@ -66,7 +66,7 @@ const ItemSearchApiAxiosParamCreator = function (configuration) {
66
66
  const localVarHeaderParameter = {};
67
67
  const localVarQueryParameter = {};
68
68
  // authentication api_key required
69
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
69
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
70
70
  // authentication oauth2 required
71
71
  // oauth required
72
72
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);
@@ -132,7 +132,7 @@ const ItemSearchApiAxiosParamCreator = function (configuration) {
132
132
  const localVarHeaderParameter = {};
133
133
  const localVarQueryParameter = {};
134
134
  // authentication api_key required
135
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
135
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-token", configuration);
136
136
  // authentication oauth2 required
137
137
  // oauth required
138
138
  yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);