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