pipedrive 25.0.0 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/esm/versions/v1/api/activities-api.d.ts +40 -40
  2. package/dist/esm/versions/v1/api/activities-api.js +40 -40
  3. package/dist/esm/versions/v1/api/deals-api.d.ts +410 -88
  4. package/dist/esm/versions/v1/api/deals-api.js +417 -88
  5. package/dist/esm/versions/v1/api/item-search-api.d.ts +8 -8
  6. package/dist/esm/versions/v1/api/item-search-api.js +8 -8
  7. package/dist/esm/versions/v1/api/leads-api.d.ts +100 -14
  8. package/dist/esm/versions/v1/api/leads-api.js +107 -14
  9. package/dist/esm/versions/v1/api/notes-api.d.ts +18 -2
  10. package/dist/esm/versions/v1/api/notes-api.js +15 -5
  11. package/dist/esm/versions/v1/api/organizations-api.d.ts +68 -68
  12. package/dist/esm/versions/v1/api/organizations-api.js +68 -68
  13. package/dist/esm/versions/v1/api/persons-api.d.ts +56 -56
  14. package/dist/esm/versions/v1/api/persons-api.js +56 -56
  15. package/dist/esm/versions/v1/api/pipelines-api.d.ts +28 -28
  16. package/dist/esm/versions/v1/api/pipelines-api.js +28 -28
  17. package/dist/esm/versions/v1/api/products-api.d.ts +24 -24
  18. package/dist/esm/versions/v1/api/products-api.js +24 -24
  19. package/dist/esm/versions/v1/api/stages-api.d.ts +36 -36
  20. package/dist/esm/versions/v1/api/stages-api.js +36 -36
  21. package/dist/esm/versions/v1/base.d.ts +2 -3
  22. package/dist/esm/versions/v1/configuration.d.ts +2 -2
  23. package/dist/esm/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  24. package/dist/esm/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  25. package/dist/esm/versions/v1/models/add-note-request-all-of1.js +4 -0
  26. package/dist/esm/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  27. package/dist/esm/versions/v1/models/index.d.ts +1 -0
  28. package/dist/esm/versions/v1/models/index.js +1 -0
  29. package/dist/esm/versions/v1/models/note-project.d.ts +23 -0
  30. package/dist/esm/versions/v1/models/note-project.js +14 -0
  31. package/dist/esm/versions/v1/models/note-request-all-of1.d.ts +5 -0
  32. package/dist/esm/versions/v1/models/note.d.ts +16 -0
  33. package/dist/esm/versions/v2/api/activities-api.d.ts +15 -7
  34. package/dist/esm/versions/v2/api/activities-api.js +12 -7
  35. package/dist/esm/versions/v2/api/beta-api.d.ts +212 -0
  36. package/dist/esm/versions/v2/api/beta-api.js +286 -0
  37. package/dist/esm/versions/v2/api/deals-api.d.ts +272 -4
  38. package/dist/esm/versions/v2/api/deals-api.js +288 -4
  39. package/dist/esm/versions/v2/api/leads-api.d.ts +111 -0
  40. package/dist/esm/versions/v2/api/leads-api.js +146 -1
  41. package/dist/esm/versions/v2/api/persons-api.d.ts +8 -8
  42. package/dist/esm/versions/v2/api/persons-api.js +8 -8
  43. package/dist/esm/versions/v2/api/products-api.js +1 -1
  44. package/dist/esm/versions/v2/base.d.ts +2 -3
  45. package/dist/esm/versions/v2/configuration.d.ts +2 -2
  46. package/dist/esm/versions/v2/models/activity-item.d.ts +5 -0
  47. package/dist/esm/versions/v2/models/activity-item1.d.ts +5 -0
  48. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  49. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response-data.js +14 -0
  50. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  51. package/dist/esm/versions/v2/models/add-convert-deal-to-lead-response.js +14 -0
  52. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  53. package/dist/esm/versions/v2/models/add-convert-lead-to-deal-response.js +14 -0
  54. package/dist/esm/versions/v2/models/add-person-request.d.ts +12 -0
  55. package/dist/esm/versions/v2/models/add-person-request.js +6 -1
  56. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  57. package/dist/esm/versions/v2/models/convert-lead-to-deal-request.js +14 -0
  58. package/dist/esm/versions/v2/models/deal-item.d.ts +5 -0
  59. package/dist/esm/versions/v2/models/deal-item1.d.ts +5 -0
  60. package/dist/esm/versions/v2/models/get-convert-response.d.ts +43 -0
  61. package/dist/esm/versions/v2/models/get-convert-response.js +14 -0
  62. package/dist/esm/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  63. package/dist/esm/versions/v2/models/get-convert-response1-data.js +20 -0
  64. package/dist/esm/versions/v2/models/get-convert-response1.d.ts +34 -0
  65. package/dist/esm/versions/v2/models/get-convert-response1.js +14 -0
  66. package/dist/esm/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  67. package/dist/esm/versions/v2/models/index.d.ts +7 -0
  68. package/dist/esm/versions/v2/models/index.js +7 -0
  69. package/dist/esm/versions/v2/models/update-person-request.d.ts +12 -0
  70. package/dist/esm/versions/v2/models/update-person-request.js +6 -1
  71. package/dist/versions/v1/api/activities-api.d.ts +40 -40
  72. package/dist/versions/v1/api/activities-api.js +40 -40
  73. package/dist/versions/v1/api/deals-api.d.ts +410 -88
  74. package/dist/versions/v1/api/deals-api.js +417 -88
  75. package/dist/versions/v1/api/item-search-api.d.ts +8 -8
  76. package/dist/versions/v1/api/item-search-api.js +8 -8
  77. package/dist/versions/v1/api/leads-api.d.ts +100 -14
  78. package/dist/versions/v1/api/leads-api.js +107 -14
  79. package/dist/versions/v1/api/notes-api.d.ts +18 -2
  80. package/dist/versions/v1/api/notes-api.js +15 -5
  81. package/dist/versions/v1/api/organizations-api.d.ts +68 -68
  82. package/dist/versions/v1/api/organizations-api.js +68 -68
  83. package/dist/versions/v1/api/persons-api.d.ts +56 -56
  84. package/dist/versions/v1/api/persons-api.js +56 -56
  85. package/dist/versions/v1/api/pipelines-api.d.ts +28 -28
  86. package/dist/versions/v1/api/pipelines-api.js +28 -28
  87. package/dist/versions/v1/api/products-api.d.ts +24 -24
  88. package/dist/versions/v1/api/products-api.js +24 -24
  89. package/dist/versions/v1/api/stages-api.d.ts +36 -36
  90. package/dist/versions/v1/api/stages-api.js +36 -36
  91. package/dist/versions/v1/base.d.ts +2 -3
  92. package/dist/versions/v1/configuration.d.ts +2 -2
  93. package/dist/versions/v1/models/add-note-request-all-of.d.ts +9 -4
  94. package/dist/versions/v1/models/add-note-request-all-of1.d.ts +10 -0
  95. package/dist/versions/v1/models/add-note-request-all-of1.js +5 -1
  96. package/dist/versions/v1/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  97. package/dist/versions/v1/models/index.d.ts +1 -0
  98. package/dist/versions/v1/models/index.js +1 -0
  99. package/dist/versions/v1/models/note-project.d.ts +23 -0
  100. package/dist/versions/v1/models/note-project.js +15 -0
  101. package/dist/versions/v1/models/note-request-all-of1.d.ts +5 -0
  102. package/dist/versions/v1/models/note.d.ts +16 -0
  103. package/dist/versions/v2/api/activities-api.d.ts +15 -7
  104. package/dist/versions/v2/api/activities-api.js +12 -7
  105. package/dist/versions/v2/api/beta-api.d.ts +212 -0
  106. package/dist/versions/v2/api/beta-api.js +286 -0
  107. package/dist/versions/v2/api/deals-api.d.ts +272 -4
  108. package/dist/versions/v2/api/deals-api.js +288 -4
  109. package/dist/versions/v2/api/leads-api.d.ts +111 -0
  110. package/dist/versions/v2/api/leads-api.js +145 -0
  111. package/dist/versions/v2/api/persons-api.d.ts +8 -8
  112. package/dist/versions/v2/api/persons-api.js +8 -8
  113. package/dist/versions/v2/api/products-api.js +1 -1
  114. package/dist/versions/v2/base.d.ts +2 -3
  115. package/dist/versions/v2/configuration.d.ts +2 -2
  116. package/dist/versions/v2/models/activity-item.d.ts +5 -0
  117. package/dist/versions/v2/models/activity-item1.d.ts +5 -0
  118. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.d.ts +23 -0
  119. package/dist/versions/v2/models/add-convert-deal-to-lead-response-data.js +15 -0
  120. package/dist/versions/v2/models/add-convert-deal-to-lead-response.d.ts +34 -0
  121. package/dist/versions/v2/models/add-convert-deal-to-lead-response.js +15 -0
  122. package/dist/versions/v2/models/add-convert-lead-to-deal-response.d.ts +34 -0
  123. package/dist/versions/v2/models/add-convert-lead-to-deal-response.js +15 -0
  124. package/dist/versions/v2/models/add-person-request.d.ts +12 -0
  125. package/dist/versions/v2/models/add-person-request.js +7 -0
  126. package/dist/versions/v2/models/convert-lead-to-deal-request.d.ts +28 -0
  127. package/dist/versions/v2/models/convert-lead-to-deal-request.js +15 -0
  128. package/dist/versions/v2/models/deal-item.d.ts +5 -0
  129. package/dist/versions/v2/models/deal-item1.d.ts +5 -0
  130. package/dist/versions/v2/models/get-convert-response.d.ts +43 -0
  131. package/dist/versions/v2/models/get-convert-response.js +15 -0
  132. package/dist/versions/v2/models/get-convert-response1-data.d.ts +46 -0
  133. package/dist/versions/v2/models/get-convert-response1-data.js +23 -0
  134. package/dist/versions/v2/models/get-convert-response1.d.ts +34 -0
  135. package/dist/versions/v2/models/get-convert-response1.js +15 -0
  136. package/dist/versions/v2/models/get-deal-search-response-all-of-data-items-inner-item.d.ts +5 -0
  137. package/dist/versions/v2/models/index.d.ts +7 -0
  138. package/dist/versions/v2/models/index.js +7 -0
  139. package/dist/versions/v2/models/update-person-request.d.ts +12 -0
  140. package/dist/versions/v2/models/update-person-request.js +7 -0
  141. package/package.json +1 -1
@@ -38,6 +38,77 @@ const base_1 = require("../base");
38
38
  */
39
39
  const BetaApiAxiosParamCreator = function (configuration) {
40
40
  return {
41
+ /**
42
+ * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
43
+ * @summary Convert a deal to a lead (BETA)
44
+ * @param {number} id The ID of the deal to convert
45
+
46
+ * @throws {RequiredError}
47
+ */
48
+ convertDealToLead: (id) => __awaiter(this, void 0, void 0, function* () {
49
+ // verify required parameter 'id' is not null or undefined
50
+ (0, common_1.assertParamExists)('convertDealToLead', 'id', id);
51
+ const localVarPath = `/deals/{id}/convert/lead`
52
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
53
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
54
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
55
+ let baseOptions;
56
+ if (configuration) {
57
+ baseOptions = configuration.baseOptions;
58
+ }
59
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
60
+ const localVarHeaderParameter = {};
61
+ const localVarQueryParameter = {};
62
+ // authentication api_key required
63
+ yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
64
+ // authentication oauth2 required
65
+ // oauth required
66
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
67
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
68
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
69
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
70
+ return {
71
+ url: (0, common_1.toPathString)(localVarUrlObj),
72
+ options: localVarRequestOptions,
73
+ };
74
+ }),
75
+ /**
76
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
77
+ * @summary Convert a lead to a deal (BETA)
78
+ * @param {string} id The ID of the lead to convert
79
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
80
+
81
+ * @throws {RequiredError}
82
+ */
83
+ convertLeadToDeal: (id, ConvertLeadToDealRequest) => __awaiter(this, void 0, void 0, function* () {
84
+ // verify required parameter 'id' is not null or undefined
85
+ (0, common_1.assertParamExists)('convertLeadToDeal', 'id', id);
86
+ const localVarPath = `/leads/{id}/convert/deal`
87
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
88
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
89
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
90
+ let baseOptions;
91
+ if (configuration) {
92
+ baseOptions = configuration.baseOptions;
93
+ }
94
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
95
+ const localVarHeaderParameter = {};
96
+ const localVarQueryParameter = {};
97
+ // authentication api_key required
98
+ yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
99
+ // authentication oauth2 required
100
+ // oauth required
101
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "leads:full"], configuration);
102
+ localVarHeaderParameter['Content-Type'] = 'application/json';
103
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
104
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
105
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
106
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(ConvertLeadToDealRequest, localVarRequestOptions, configuration);
107
+ return {
108
+ url: (0, common_1.toPathString)(localVarUrlObj),
109
+ options: localVarRequestOptions,
110
+ };
111
+ }),
41
112
  /**
42
113
  * Removes an installment from a deal. Only available in Advanced and above plans.
43
114
  * @summary Delete an installment from a deal
@@ -76,6 +147,44 @@ const BetaApiAxiosParamCreator = function (configuration) {
76
147
  options: localVarRequestOptions,
77
148
  };
78
149
  }),
150
+ /**
151
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
152
+ * @summary Get Deal conversion status (BETA)
153
+ * @param {number} id The ID of a deal
154
+ * @param {string} conversion_id The ID of the conversion
155
+
156
+ * @throws {RequiredError}
157
+ */
158
+ getDealConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
159
+ // verify required parameter 'id' is not null or undefined
160
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'id', id);
161
+ // verify required parameter 'conversion_id' is not null or undefined
162
+ (0, common_1.assertParamExists)('getDealConversionStatus', 'conversion_id', conversion_id);
163
+ const localVarPath = `/deals/{id}/convert/status/{conversion_id}`
164
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
165
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
166
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
167
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
168
+ let baseOptions;
169
+ if (configuration) {
170
+ baseOptions = configuration.baseOptions;
171
+ }
172
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
173
+ const localVarHeaderParameter = {};
174
+ const localVarQueryParameter = {};
175
+ // authentication api_key required
176
+ yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
177
+ // authentication oauth2 required
178
+ // oauth required
179
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read"], configuration);
180
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
181
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
182
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
183
+ return {
184
+ url: (0, common_1.toPathString)(localVarUrlObj),
185
+ options: localVarRequestOptions,
186
+ };
187
+ }),
79
188
  /**
80
189
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
81
190
  * @summary List installments added to a list of deals
@@ -128,6 +237,44 @@ const BetaApiAxiosParamCreator = function (configuration) {
128
237
  options: localVarRequestOptions,
129
238
  };
130
239
  }),
240
+ /**
241
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
242
+ * @summary Get Lead conversion status (BETA)
243
+ * @param {string} id The ID of a lead
244
+ * @param {string} conversion_id The ID of the conversion
245
+
246
+ * @throws {RequiredError}
247
+ */
248
+ getLeadConversionStatus: (id, conversion_id) => __awaiter(this, void 0, void 0, function* () {
249
+ // verify required parameter 'id' is not null or undefined
250
+ (0, common_1.assertParamExists)('getLeadConversionStatus', 'id', id);
251
+ // verify required parameter 'conversion_id' is not null or undefined
252
+ (0, common_1.assertParamExists)('getLeadConversionStatus', 'conversion_id', conversion_id);
253
+ const localVarPath = `/leads/{id}/convert/status/{conversion_id}`
254
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
255
+ .replace(`{${"conversion_id"}}`, encodeURIComponent(String(conversion_id)));
256
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
257
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
258
+ let baseOptions;
259
+ if (configuration) {
260
+ baseOptions = configuration.baseOptions;
261
+ }
262
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
263
+ const localVarHeaderParameter = {};
264
+ const localVarQueryParameter = {};
265
+ // authentication api_key required
266
+ yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
267
+ // authentication oauth2 required
268
+ // oauth required
269
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["leads:read"], configuration);
270
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
271
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
272
+ localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
273
+ return {
274
+ url: (0, common_1.toPathString)(localVarUrlObj),
275
+ options: localVarRequestOptions,
276
+ };
277
+ }),
131
278
  /**
132
279
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
133
280
  * @summary Add an installment to a deal
@@ -216,6 +363,33 @@ exports.BetaApiAxiosParamCreator = BetaApiAxiosParamCreator;
216
363
  const BetaApiFp = function (configuration) {
217
364
  const localVarAxiosParamCreator = (0, exports.BetaApiAxiosParamCreator)(configuration);
218
365
  return {
366
+ /**
367
+ * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
368
+ * @summary Convert a deal to a lead (BETA)
369
+ * @param {number} id The ID of the deal to convert
370
+
371
+ * @throws {RequiredError}
372
+ */
373
+ convertDealToLead(id) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertDealToLead(id);
376
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
377
+ });
378
+ },
379
+ /**
380
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
381
+ * @summary Convert a lead to a deal (BETA)
382
+ * @param {string} id The ID of the lead to convert
383
+ * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest]
384
+
385
+ * @throws {RequiredError}
386
+ */
387
+ convertLeadToDeal(id, ConvertLeadToDealRequest) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest);
390
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
391
+ });
392
+ },
219
393
  /**
220
394
  * Removes an installment from a deal. Only available in Advanced and above plans.
221
395
  * @summary Delete an installment from a deal
@@ -230,6 +404,20 @@ const BetaApiFp = function (configuration) {
230
404
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
231
405
  });
232
406
  },
407
+ /**
408
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
409
+ * @summary Get Deal conversion status (BETA)
410
+ * @param {number} id The ID of a deal
411
+ * @param {string} conversion_id The ID of the conversion
412
+
413
+ * @throws {RequiredError}
414
+ */
415
+ getDealConversionStatus(id, conversion_id) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id);
418
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
419
+ });
420
+ },
233
421
  /**
234
422
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
235
423
  * @summary List installments added to a list of deals
@@ -247,6 +435,20 @@ const BetaApiFp = function (configuration) {
247
435
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
248
436
  });
249
437
  },
438
+ /**
439
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
440
+ * @summary Get Lead conversion status (BETA)
441
+ * @param {string} id The ID of a lead
442
+ * @param {string} conversion_id The ID of the conversion
443
+
444
+ * @throws {RequiredError}
445
+ */
446
+ getLeadConversionStatus(id, conversion_id) {
447
+ return __awaiter(this, void 0, void 0, function* () {
448
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id);
449
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
450
+ });
451
+ },
250
452
  /**
251
453
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
252
454
  * @summary Add an installment to a deal
@@ -286,6 +488,26 @@ exports.BetaApiFp = BetaApiFp;
286
488
  const BetaApiFactory = function (configuration, basePath, axios) {
287
489
  const localVarFp = (0, exports.BetaApiFp)(configuration);
288
490
  return {
491
+ /**
492
+ * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
493
+ * @summary Convert a deal to a lead (BETA)
494
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
495
+
496
+ * @throws {RequiredError}
497
+ */
498
+ convertDealToLead(requestParameters) {
499
+ return localVarFp.convertDealToLead(requestParameters.id).then((request) => request(axios, basePath));
500
+ },
501
+ /**
502
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
503
+ * @summary Convert a lead to a deal (BETA)
504
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
505
+
506
+ * @throws {RequiredError}
507
+ */
508
+ convertLeadToDeal(requestParameters) {
509
+ return localVarFp.convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(axios, basePath));
510
+ },
289
511
  /**
290
512
  * Removes an installment from a deal. Only available in Advanced and above plans.
291
513
  * @summary Delete an installment from a deal
@@ -296,6 +518,16 @@ const BetaApiFactory = function (configuration, basePath, axios) {
296
518
  deleteInstallment(requestParameters) {
297
519
  return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(axios, basePath));
298
520
  },
521
+ /**
522
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
523
+ * @summary Get Deal conversion status (BETA)
524
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
525
+
526
+ * @throws {RequiredError}
527
+ */
528
+ getDealConversionStatus(requestParameters) {
529
+ return localVarFp.getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
530
+ },
299
531
  /**
300
532
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
301
533
  * @summary List installments added to a list of deals
@@ -306,6 +538,16 @@ const BetaApiFactory = function (configuration, basePath, axios) {
306
538
  getInstallments(requestParameters) {
307
539
  return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
308
540
  },
541
+ /**
542
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
543
+ * @summary Get Lead conversion status (BETA)
544
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
545
+
546
+ * @throws {RequiredError}
547
+ */
548
+ getLeadConversionStatus(requestParameters) {
549
+ return localVarFp.getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(axios, basePath));
550
+ },
309
551
  /**
310
552
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
311
553
  * @summary Add an installment to a deal
@@ -336,6 +578,28 @@ exports.BetaApiFactory = BetaApiFactory;
336
578
  * @extends {BaseAPI}
337
579
  */
338
580
  class BetaApi extends base_1.BaseAPI {
581
+ /**
582
+ * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Deals#getDealConversionStatus\">/api/v2/deals/{deal_id}/convert/status/{conversion_id}</a> endpoint.
583
+ * @summary Convert a deal to a lead (BETA)
584
+ * @param {BetaApiConvertDealToLeadRequest} requestParameters Request parameters.
585
+
586
+ * @throws {RequiredError}
587
+ * @memberof BetaApi
588
+ */
589
+ convertDealToLead(requestParameters) {
590
+ return (0, exports.BetaApiFp)(this.configuration).convertDealToLead(requestParameters.id).then((request) => request(this.axios, this.basePath));
591
+ }
592
+ /**
593
+ * Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the <a href=\"https://developers.pipedrive.com/docs/api/v1/Leads#getLeadConversionStatus\">/api/v2/leads/{lead_id}/convert/status/{conversion_id}</a> endpoint.
594
+ * @summary Convert a lead to a deal (BETA)
595
+ * @param {BetaApiConvertLeadToDealRequest} requestParameters Request parameters.
596
+
597
+ * @throws {RequiredError}
598
+ * @memberof BetaApi
599
+ */
600
+ convertLeadToDeal(requestParameters) {
601
+ return (0, exports.BetaApiFp)(this.configuration).convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest).then((request) => request(this.axios, this.basePath));
602
+ }
339
603
  /**
340
604
  * Removes an installment from a deal. Only available in Advanced and above plans.
341
605
  * @summary Delete an installment from a deal
@@ -347,6 +611,17 @@ class BetaApi extends base_1.BaseAPI {
347
611
  deleteInstallment(requestParameters) {
348
612
  return (0, exports.BetaApiFp)(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(this.axios, this.basePath));
349
613
  }
614
+ /**
615
+ * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
616
+ * @summary Get Deal conversion status (BETA)
617
+ * @param {BetaApiGetDealConversionStatusRequest} requestParameters Request parameters.
618
+
619
+ * @throws {RequiredError}
620
+ * @memberof BetaApi
621
+ */
622
+ getDealConversionStatus(requestParameters) {
623
+ return (0, exports.BetaApiFp)(this.configuration).getDealConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
624
+ }
350
625
  /**
351
626
  * Lists installments attached to a list of deals. Only available in Advanced and above plans.
352
627
  * @summary List installments added to a list of deals
@@ -358,6 +633,17 @@ class BetaApi extends base_1.BaseAPI {
358
633
  getInstallments(requestParameters) {
359
634
  return (0, exports.BetaApiFp)(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
360
635
  }
636
+ /**
637
+ * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.
638
+ * @summary Get Lead conversion status (BETA)
639
+ * @param {BetaApiGetLeadConversionStatusRequest} requestParameters Request parameters.
640
+
641
+ * @throws {RequiredError}
642
+ * @memberof BetaApi
643
+ */
644
+ getLeadConversionStatus(requestParameters) {
645
+ return (0, exports.BetaApiFp)(this.configuration).getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id).then((request) => request(this.axios, this.basePath));
646
+ }
361
647
  /**
362
648
  * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
363
649
  * @summary Add an installment to a deal