pipedrive 13.0.12 → 13.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,12 @@ For public Changelog covering all changes done to Pipedrive’s API, webhooks an
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## 13.1.0
12
+ ### Fixed
13
+ - Fixed runtime error for `FilesApi.addFile`
14
+ - Fixed missing required parameters check
15
+ - Fixed camelCase support for application/json endpoints
16
+
11
17
  ## 13.0.12
12
18
  ### Fixed
13
19
  - Fixed capitalization, punctuation, grammar, articles in all endpoint descriptions
package/dist/ApiClient.js CHANGED
@@ -21,6 +21,8 @@ var _superagent = _interopRequireDefault(require("superagent"));
21
21
 
22
22
  var _querystring = _interopRequireDefault(require("querystring"));
23
23
 
24
+ var _lodash = require("lodash");
25
+
24
26
  var _UnauthorizedException = _interopRequireDefault(require("./exceptions/UnauthorizedException"));
25
27
 
26
28
  var _OAuthProviderException = _interopRequireDefault(require("./exceptions/OAuthProviderException"));
@@ -471,12 +473,14 @@ var ApiClient = /*#__PURE__*/function () {
471
473
  contentType,
472
474
  _formParams,
473
475
  key,
476
+ normalizeBodyParams,
474
477
  accept,
475
478
  response,
476
479
  shouldRefreshTokenAndRetry,
477
480
  _exception,
478
481
  _exception2,
479
482
  exception,
483
+ exceptionMessage,
480
484
  data,
481
485
  _args = arguments;
482
486
 
@@ -542,7 +546,8 @@ var ApiClient = /*#__PURE__*/function () {
542
546
  request.type('application/json');
543
547
  }
544
548
 
545
- request.send(bodyParam);
549
+ normalizeBodyParams = this.replaceCamelCaseObj(bodyParam);
550
+ request.send(normalizeBodyParams);
546
551
  }
547
552
 
548
553
  accept = this.jsonPreferredMime(accepts);
@@ -581,7 +586,7 @@ var ApiClient = /*#__PURE__*/function () {
581
586
 
582
587
  case 23:
583
588
  response = _context.sent;
584
- _context.next = 51;
589
+ _context.next = 52;
585
590
  break;
586
591
 
587
592
  case 26:
@@ -636,17 +641,18 @@ var ApiClient = /*#__PURE__*/function () {
636
641
 
637
642
  case 45:
638
643
  exception = new _FailResponseException["default"]();
639
- exception.message = _context.t0.response.res.statusMessage;
644
+ exceptionMessage = _context.t0.response && _context.t0.response.res.statusMessage || _context.t0.message;
645
+ exception.message = exceptionMessage;
640
646
  exception.errorCode = _context.t0.status;
641
647
 
642
- if (_context.t0.response.body.error_info) {
648
+ if (_context.t0.response && _context.t0.response.body.error_info) {
643
649
  exception.errorInfo = _context.t0.response.body.error_info;
644
650
  }
645
651
 
646
652
  exception.context = _context.t0.response;
647
653
  throw exception;
648
654
 
649
- case 51:
655
+ case 52:
650
656
  data = this.deserialize(response, returnType);
651
657
 
652
658
  if (this.enableCookies && typeof window === 'undefined') {
@@ -655,7 +661,7 @@ var ApiClient = /*#__PURE__*/function () {
655
661
 
656
662
  return _context.abrupt("return", data);
657
663
 
658
- case 54:
664
+ case 55:
659
665
  case "end":
660
666
  return _context.stop();
661
667
  }
@@ -663,17 +669,48 @@ var ApiClient = /*#__PURE__*/function () {
663
669
  }, _callee, this, [[20, 26]]);
664
670
  }));
665
671
 
666
- function callApi(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12) {
672
+ function callApi(_x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13) {
667
673
  return _callApi.apply(this, arguments);
668
674
  }
669
675
 
670
676
  return callApi;
671
677
  }()
672
678
  /**
679
+ * Converts CamelCase attributes of an object to snake_case and returns it
680
+ */
681
+
682
+ }, {
683
+ key: "replaceCamelCaseObj",
684
+ value: function (_replaceCamelCaseObj) {
685
+ function replaceCamelCaseObj(_x) {
686
+ return _replaceCamelCaseObj.apply(this, arguments);
687
+ }
688
+
689
+ replaceCamelCaseObj.toString = function () {
690
+ return _replaceCamelCaseObj.toString();
691
+ };
692
+
693
+ return replaceCamelCaseObj;
694
+ }(function (obj) {
695
+ var snakeCased = {};
696
+
697
+ for (var key in obj) {
698
+ var keyValue = obj[key];
699
+ var isArray = Array.isArray(keyValue);
700
+ var isObject = (0, _typeof2["default"])(keyValue) === 'object' && !isArray;
701
+ if (isArray) keyValue = keyValue.map(function (kv) {
702
+ return (0, _typeof2["default"])(kv) === 'object' ? replaceCamelCaseObj(kv) : kv;
703
+ });
704
+ snakeCased[(0, _lodash.snakeCase)(key)] = isObject ? replaceCamelCaseObj(keyValue) : keyValue;
705
+ }
706
+
707
+ return snakeCased;
708
+ }
709
+ /**
673
710
  * Checks whether the API supports oauth2 type authorization.
674
711
  * @returns {Boolean} Whether oauth2 type authorization is supported by the API.
675
712
  */
676
-
713
+ )
677
714
  }, {
678
715
  key: "isOauth2Supported",
679
716
  value: function isOauth2Supported() {
@@ -797,7 +834,7 @@ var ApiClient = /*#__PURE__*/function () {
797
834
  }, _callee2, this, [[10, 18]]);
798
835
  }));
799
836
 
800
- function authorize(_x13) {
837
+ function authorize(_x14) {
801
838
  return _authorize.apply(this, arguments);
802
839
  }
803
840
 
@@ -66,6 +66,23 @@ var CallLogsApi = /*#__PURE__*/function () {
66
66
  value: function addCallLogWithHttpInfo(opts) {
67
67
  opts = opts || {};
68
68
  var postBody = opts['callLogObject'];
69
+
70
+ if (opts['outcome'] === undefined || opts['outcome'] === null) {
71
+ throw new Error("Missing the required parameter 'outcome' when calling addCallLog");
72
+ }
73
+
74
+ if (opts['to_phone_number'] === undefined || opts['to_phone_number'] === null) {
75
+ throw new Error("Missing the required parameter 'to_phone_number' when calling addCallLog");
76
+ }
77
+
78
+ if (opts['start_time'] === undefined || opts['start_time'] === null) {
79
+ throw new Error("Missing the required parameter 'start_time' when calling addCallLog");
80
+ }
81
+
82
+ if (opts['end_time'] === undefined || opts['end_time'] === null) {
83
+ throw new Error("Missing the required parameter 'end_time' when calling addCallLog");
84
+ }
85
+
69
86
  var pathParams = {};
70
87
  var queryParams = {};
71
88
  var headerParams = {};
@@ -176,6 +176,10 @@ var DealsApi = /*#__PURE__*/function () {
176
176
  throw new Error("Missing the required parameter 'id' when calling addDealFollower");
177
177
  }
178
178
 
179
+ if (opts['user_id'] === undefined || opts['user_id'] === null) {
180
+ throw new Error("Missing the required parameter 'user_id' when calling addDealFollower");
181
+ }
182
+
179
183
  var pathParams = {
180
184
  'id': id
181
185
  };
@@ -237,6 +241,10 @@ var DealsApi = /*#__PURE__*/function () {
237
241
  throw new Error("Missing the required parameter 'id' when calling addDealParticipant");
238
242
  }
239
243
 
244
+ if (opts['person_id'] === undefined || opts['person_id'] === null) {
245
+ throw new Error("Missing the required parameter 'person_id' when calling addDealParticipant");
246
+ }
247
+
240
248
  var pathParams = {
241
249
  'id': id
242
250
  };
@@ -1615,6 +1623,10 @@ var DealsApi = /*#__PURE__*/function () {
1615
1623
  throw new Error("Missing the required parameter 'id' when calling mergeDeals");
1616
1624
  }
1617
1625
 
1626
+ if (opts['merge_with_id'] === undefined || opts['merge_with_id'] === null) {
1627
+ throw new Error("Missing the required parameter 'merge_with_id' when calling mergeDeals");
1628
+ }
1629
+
1618
1630
  var pathParams = {
1619
1631
  'id': id
1620
1632
  };
@@ -66,6 +66,19 @@ var FiltersApi = /*#__PURE__*/function () {
66
66
  value: function addFilterWithHttpInfo(opts) {
67
67
  opts = opts || {};
68
68
  var postBody = opts['addFilterRequest'];
69
+
70
+ if (opts['name'] === undefined || opts['name'] === null) {
71
+ throw new Error("Missing the required parameter 'name' when calling addFilter");
72
+ }
73
+
74
+ if (opts['conditions'] === undefined || opts['conditions'] === null) {
75
+ throw new Error("Missing the required parameter 'conditions' when calling addFilter");
76
+ }
77
+
78
+ if (opts['type'] === undefined || opts['type'] === null) {
79
+ throw new Error("Missing the required parameter 'type' when calling addFilter");
80
+ }
81
+
69
82
  var pathParams = {};
70
83
  var queryParams = {};
71
84
  var headerParams = {};
@@ -397,6 +410,10 @@ var FiltersApi = /*#__PURE__*/function () {
397
410
  throw new Error("Missing the required parameter 'id' when calling updateFilter");
398
411
  }
399
412
 
413
+ if (opts['conditions'] === undefined || opts['conditions'] === null) {
414
+ throw new Error("Missing the required parameter 'conditions' when calling updateFilter");
415
+ }
416
+
400
417
  var pathParams = {
401
418
  'id': id
402
419
  };
@@ -326,10 +326,10 @@ var GoalsApi = /*#__PURE__*/function () {
326
326
  * @param {String} id The ID of the goal to be updated
327
327
  * @param {Object} opts Optional parameters
328
328
  * @param {String} opts.title The title of the goal
329
- * @param {Object} opts.assignee Who this goal is assigned to. It requires the following JSON structure: { \\\"id\\\": \\\"1\\\", \\\"type\\\": \\\"person\\\" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team.
330
- * @param {Object} opts.type The type of the goal. It requires the following JSON structure: { \\\"name\\\": \\\"deals_started\\\", \\\"params\\\": { \\\"pipeline_id\\\": 1 } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. To track goal in all pipelines set `pipeline_id` as `null`.
331
- * @param {Object} opts.expectedOutcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"quantity\\\" } or { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"sum\\\", \\\"currency_id\\\": 1 }. `currency_id` should only be added to `sum` type of goals.
332
- * @param {Object} opts.duration The date when the goal starts and ends. It requires the following JSON structure: { \\\"start\\\": \\\"2019-01-01\\\", \\\"end\\\": \\\"2022-12-31\\\" }. Date in format of YYYY-MM-DD. \\\"end\\\" can be set to `null` for an infinite, open-ended goal.
329
+ * @param {Object.<String, Object>} opts.assignee Who this goal is assigned to. It requires the following JSON structure: { \\\"id\\\": \\\"1\\\", \\\"type\\\": \\\"person\\\" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team.
330
+ * @param {Object.<String, Object>} opts.type The type of the goal. It requires the following JSON structure: { \\\"name\\\": \\\"deals_started\\\", \\\"params\\\": { \\\"pipeline_id\\\": 1 } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. To track goal in all pipelines set `pipeline_id` as `null`.
331
+ * @param {Object.<String, Object>} opts.expectedOutcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"quantity\\\" } or { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"sum\\\", \\\"currency_id\\\": 1 }. `currency_id` should only be added to `sum` type of goals.
332
+ * @param {Object.<String, Object>} opts.duration The date when the goal starts and ends. It requires the following JSON structure: { \\\"start\\\": \\\"2019-01-01\\\", \\\"end\\\": \\\"2022-12-31\\\" }. Date in format of YYYY-MM-DD. \\\"end\\\" can be set to `null` for an infinite, open-ended goal.
333
333
  * @param {module:model/String} opts.interval The interval of the goal
334
334
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AddOrUpdateGoalResponse200} and HTTP response
335
335
  */
@@ -383,10 +383,10 @@ var GoalsApi = /*#__PURE__*/function () {
383
383
  * @param {String} id The ID of the goal to be updated
384
384
  * @param {Object} opts Optional parameters
385
385
  * @param {String} opts.title The title of the goal
386
- * @param {Object} opts.assignee Who this goal is assigned to. It requires the following JSON structure: { \\\"id\\\": \\\"1\\\", \\\"type\\\": \\\"person\\\" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team.
387
- * @param {Object} opts.type The type of the goal. It requires the following JSON structure: { \\\"name\\\": \\\"deals_started\\\", \\\"params\\\": { \\\"pipeline_id\\\": 1 } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. To track goal in all pipelines set `pipeline_id` as `null`.
388
- * @param {Object} opts.expectedOutcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"quantity\\\" } or { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"sum\\\", \\\"currency_id\\\": 1 }. `currency_id` should only be added to `sum` type of goals.
389
- * @param {Object} opts.duration The date when the goal starts and ends. It requires the following JSON structure: { \\\"start\\\": \\\"2019-01-01\\\", \\\"end\\\": \\\"2022-12-31\\\" }. Date in format of YYYY-MM-DD. \\\"end\\\" can be set to `null` for an infinite, open-ended goal.
386
+ * @param {Object.<String, Object>} opts.assignee Who this goal is assigned to. It requires the following JSON structure: { \\\"id\\\": \\\"1\\\", \\\"type\\\": \\\"person\\\" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team.
387
+ * @param {Object.<String, Object>} opts.type The type of the goal. It requires the following JSON structure: { \\\"name\\\": \\\"deals_started\\\", \\\"params\\\": { \\\"pipeline_id\\\": 1 } }. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. To track goal in all pipelines set `pipeline_id` as `null`.
388
+ * @param {Object.<String, Object>} opts.expectedOutcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"quantity\\\" } or { \\\"target\\\": \\\"50\\\", \\\"tracking_metric\\\": \\\"sum\\\", \\\"currency_id\\\": 1 }. `currency_id` should only be added to `sum` type of goals.
389
+ * @param {Object.<String, Object>} opts.duration The date when the goal starts and ends. It requires the following JSON structure: { \\\"start\\\": \\\"2019-01-01\\\", \\\"end\\\": \\\"2022-12-31\\\" }. Date in format of YYYY-MM-DD. \\\"end\\\" can be set to `null` for an infinite, open-ended goal.
390
390
  * @param {module:model/String} opts.interval The interval of the goal
391
391
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AddOrUpdateGoalResponse200}
392
392
  */
@@ -46,8 +46,8 @@ var ItemSearchApi = /*#__PURE__*/function () {
46
46
  * @param {String} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`).
47
47
  * @param {Object} opts Optional parameters
48
48
  * @param {module:model/String} opts.itemTypes A comma-separated string array. The type of items to perform the search from. Defaults to all.
49
- * @param {module:model/String} opts.fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> </table> <br> 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 `search_for_related_items`.
50
- * @param {module:model/Boolean} opts.searchForRelatedItems 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.
49
+ * @param {module:model/String} opts.fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> </table> <br> 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 `search_for_related_items`.
50
+ * @param {module:model/Boolean} opts.searchForRelatedItems 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.
51
51
  * @param {module:model/Boolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive.
52
52
  * @param {module:model/String} opts.includeFields A comma-separated string array. Supports including optional fields in the results which are not provided by default.
53
53
  * @param {Number} opts.start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (default to 0)
@@ -105,8 +105,8 @@ var ItemSearchApi = /*#__PURE__*/function () {
105
105
  * @param {String} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`).
106
106
  * @param {Object} opts Optional parameters
107
107
  * @param {module:model/String} opts.itemTypes A comma-separated string array. The type of items to perform the search from. Defaults to all.
108
- * @param {module:model/String} opts.fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> </table> <br> 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 `search_for_related_items`.
109
- * @param {module:model/Boolean} opts.searchForRelatedItems 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.
108
+ * @param {module:model/String} opts.fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> </table> <br> 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 `search_for_related_items`.
109
+ * @param {module:model/Boolean} opts.searchForRelatedItems 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.
110
110
  * @param {module:model/Boolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive.
111
111
  * @param {module:model/String} opts.includeFields A comma-separated string array. Supports including optional fields in the results which are not provided by default.
112
112
  * @param {Number} opts.start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (default to 0)
@@ -123,7 +123,7 @@ var ItemSearchApi = /*#__PURE__*/function () {
123
123
  }
124
124
  /**
125
125
  * Perform a search using a specific field from an item type
126
- * 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).
126
+ * 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).
127
127
  * @param {String} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`).
128
128
  * @param {module:model/String} fieldType The type of the field to perform the search from
129
129
  * @param {String} fieldKey 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' API GET methods (dealFields, personFields, etc.).
@@ -189,7 +189,7 @@ var ItemSearchApi = /*#__PURE__*/function () {
189
189
  }
190
190
  /**
191
191
  * Perform a search using a specific field from an item type
192
- * 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).
192
+ * 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).
193
193
  * @param {String} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`).
194
194
  * @param {module:model/String} fieldType The type of the field to perform the search from
195
195
  * @param {String} fieldKey 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' API GET methods (dealFields, personFields, etc.).
@@ -62,6 +62,15 @@ var LeadLabelsApi = /*#__PURE__*/function () {
62
62
  value: function addLeadLabelWithHttpInfo(opts) {
63
63
  opts = opts || {};
64
64
  var postBody = opts['addLeadLabelRequest'];
65
+
66
+ if (opts['name'] === undefined || opts['name'] === null) {
67
+ throw new Error("Missing the required parameter 'name' when calling addLeadLabel");
68
+ }
69
+
70
+ if (opts['color'] === undefined || opts['color'] === null) {
71
+ throw new Error("Missing the required parameter 'color' when calling addLeadLabel");
72
+ }
73
+
65
74
  var pathParams = {};
66
75
  var queryParams = {};
67
76
  var headerParams = {};
@@ -62,6 +62,11 @@ var LeadsApi = /*#__PURE__*/function () {
62
62
  value: function addLeadWithHttpInfo(opts) {
63
63
  opts = opts || {};
64
64
  var postBody = opts['addLeadRequest'];
65
+
66
+ if (opts['title'] === undefined || opts['title'] === null) {
67
+ throw new Error("Missing the required parameter 'title' when calling addLead");
68
+ }
69
+
65
70
  var pathParams = {};
66
71
  var queryParams = {};
67
72
  var headerParams = {};
@@ -128,6 +128,10 @@ var NotesApi = /*#__PURE__*/function () {
128
128
  throw new Error("Missing the required parameter 'id' when calling addNoteComment");
129
129
  }
130
130
 
131
+ if (opts['content'] === undefined || opts['content'] === null) {
132
+ throw new Error("Missing the required parameter 'content' when calling addNoteComment");
133
+ }
134
+
131
135
  var pathParams = {
132
136
  'id': id
133
137
  };
@@ -598,6 +602,10 @@ var NotesApi = /*#__PURE__*/function () {
598
602
  throw new Error("Missing the required parameter 'commentId' when calling updateCommentForNote");
599
603
  }
600
604
 
605
+ if (opts['content'] === undefined || opts['content'] === null) {
606
+ throw new Error("Missing the required parameter 'content' when calling updateCommentForNote");
607
+ }
608
+
601
609
  var pathParams = {
602
610
  'id': id,
603
611
  'commentId': commentId
@@ -64,6 +64,19 @@ var OrganizationRelationshipsApi = /*#__PURE__*/function () {
64
64
  value: function addOrganizationRelationshipWithHttpInfo(opts) {
65
65
  opts = opts || {};
66
66
  var postBody = opts['addOrganizationRelationshipRequest'];
67
+
68
+ if (opts['type'] === undefined || opts['type'] === null) {
69
+ throw new Error("Missing the required parameter 'type' when calling addOrganizationRelationship");
70
+ }
71
+
72
+ if (opts['rel_owner_org_id'] === undefined || opts['rel_owner_org_id'] === null) {
73
+ throw new Error("Missing the required parameter 'rel_owner_org_id' when calling addOrganizationRelationship");
74
+ }
75
+
76
+ if (opts['rel_linked_org_id'] === undefined || opts['rel_linked_org_id'] === null) {
77
+ throw new Error("Missing the required parameter 'rel_linked_org_id' when calling addOrganizationRelationship");
78
+ }
79
+
67
80
  var pathParams = {};
68
81
  var queryParams = {};
69
82
  var headerParams = {};
@@ -154,6 +154,10 @@ var OrganizationsApi = /*#__PURE__*/function () {
154
154
  throw new Error("Missing the required parameter 'id' when calling addOrganizationFollower");
155
155
  }
156
156
 
157
+ if (opts['user_id'] === undefined || opts['user_id'] === null) {
158
+ throw new Error("Missing the required parameter 'user_id' when calling addOrganizationFollower");
159
+ }
160
+
157
161
  var pathParams = {
158
162
  'id': id
159
163
  };
@@ -1057,6 +1061,10 @@ var OrganizationsApi = /*#__PURE__*/function () {
1057
1061
  throw new Error("Missing the required parameter 'id' when calling mergeOrganizations");
1058
1062
  }
1059
1063
 
1064
+ if (opts['merge_with_id'] === undefined || opts['merge_with_id'] === null) {
1065
+ throw new Error("Missing the required parameter 'merge_with_id' when calling mergeOrganizations");
1066
+ }
1067
+
1060
1068
  var pathParams = {
1061
1069
  'id': id
1062
1070
  };
@@ -154,6 +154,10 @@ var PersonsApi = /*#__PURE__*/function () {
154
154
  throw new Error("Missing the required parameter 'id' when calling addPersonFollower");
155
155
  }
156
156
 
157
+ if (opts['user_id'] === undefined || opts['user_id'] === null) {
158
+ throw new Error("Missing the required parameter 'user_id' when calling addPersonFollower");
159
+ }
160
+
157
161
  var pathParams = {
158
162
  'id': id
159
163
  };
@@ -1188,6 +1192,10 @@ var PersonsApi = /*#__PURE__*/function () {
1188
1192
  throw new Error("Missing the required parameter 'id' when calling mergePersons");
1189
1193
  }
1190
1194
 
1195
+ if (opts['merge_with_id'] === undefined || opts['merge_with_id'] === null) {
1196
+ throw new Error("Missing the required parameter 'merge_with_id' when calling mergePersons");
1197
+ }
1198
+
1191
1199
  var pathParams = {
1192
1200
  'id': id
1193
1201
  };
@@ -64,6 +64,15 @@ var ProductFieldsApi = /*#__PURE__*/function () {
64
64
  value: function addProductFieldWithHttpInfo(opts) {
65
65
  opts = opts || {};
66
66
  var postBody = opts['newProductField'];
67
+
68
+ if (opts['name'] === undefined || opts['name'] === null) {
69
+ throw new Error("Missing the required parameter 'name' when calling addProductField");
70
+ }
71
+
72
+ if (opts['field_type'] === undefined || opts['field_type'] === null) {
73
+ throw new Error("Missing the required parameter 'field_type' when calling addProductField");
74
+ }
75
+
67
76
  var pathParams = {};
68
77
  var queryParams = {};
69
78
  var headerParams = {};
@@ -350,6 +359,10 @@ var ProductFieldsApi = /*#__PURE__*/function () {
350
359
  throw new Error("Missing the required parameter 'id' when calling updateProductField");
351
360
  }
352
361
 
362
+ if (opts['name'] === undefined || opts['name'] === null) {
363
+ throw new Error("Missing the required parameter 'name' when calling updateProductField");
364
+ }
365
+
353
366
  var pathParams = {
354
367
  'id': id
355
368
  };
@@ -138,6 +138,10 @@ var ProductsApi = /*#__PURE__*/function () {
138
138
  throw new Error("Missing the required parameter 'id' when calling addProductFollower");
139
139
  }
140
140
 
141
+ if (opts['user_id'] === undefined || opts['user_id'] === null) {
142
+ throw new Error("Missing the required parameter 'user_id' when calling addProductFollower");
143
+ }
144
+
141
145
  var pathParams = {
142
146
  'id': id
143
147
  };
@@ -64,6 +64,27 @@ var SubscriptionsApi = /*#__PURE__*/function () {
64
64
  value: function addRecurringSubscriptionWithHttpInfo(opts) {
65
65
  opts = opts || {};
66
66
  var postBody = opts['subscriptionRecurringCreateRequest'];
67
+
68
+ if (opts['deal_id'] === undefined || opts['deal_id'] === null) {
69
+ throw new Error("Missing the required parameter 'deal_id' when calling addRecurringSubscription");
70
+ }
71
+
72
+ if (opts['currency'] === undefined || opts['currency'] === null) {
73
+ throw new Error("Missing the required parameter 'currency' when calling addRecurringSubscription");
74
+ }
75
+
76
+ if (opts['cadence_type'] === undefined || opts['cadence_type'] === null) {
77
+ throw new Error("Missing the required parameter 'cadence_type' when calling addRecurringSubscription");
78
+ }
79
+
80
+ if (opts['cycle_amount'] === undefined || opts['cycle_amount'] === null) {
81
+ throw new Error("Missing the required parameter 'cycle_amount' when calling addRecurringSubscription");
82
+ }
83
+
84
+ if (opts['start_date'] === undefined || opts['start_date'] === null) {
85
+ throw new Error("Missing the required parameter 'start_date' when calling addRecurringSubscription");
86
+ }
87
+
67
88
  var pathParams = {};
68
89
  var queryParams = {};
69
90
  var headerParams = {};
@@ -116,6 +137,19 @@ var SubscriptionsApi = /*#__PURE__*/function () {
116
137
  value: function addSubscriptionInstallmentWithHttpInfo(opts) {
117
138
  opts = opts || {};
118
139
  var postBody = opts['subscriptionInstallmentCreateRequest'];
140
+
141
+ if (opts['deal_id'] === undefined || opts['deal_id'] === null) {
142
+ throw new Error("Missing the required parameter 'deal_id' when calling addSubscriptionInstallment");
143
+ }
144
+
145
+ if (opts['currency'] === undefined || opts['currency'] === null) {
146
+ throw new Error("Missing the required parameter 'currency' when calling addSubscriptionInstallment");
147
+ }
148
+
149
+ if (opts['payments'] === undefined || opts['payments'] === null) {
150
+ throw new Error("Missing the required parameter 'payments' when calling addSubscriptionInstallment");
151
+ }
152
+
119
153
  var pathParams = {};
120
154
  var queryParams = {};
121
155
  var headerParams = {};
@@ -463,6 +497,10 @@ var SubscriptionsApi = /*#__PURE__*/function () {
463
497
  throw new Error("Missing the required parameter 'id' when calling updateRecurringSubscription");
464
498
  }
465
499
 
500
+ if (opts['effective_date'] === undefined || opts['effective_date'] === null) {
501
+ throw new Error("Missing the required parameter 'effective_date' when calling updateRecurringSubscription");
502
+ }
503
+
466
504
  var pathParams = {
467
505
  'id': id
468
506
  };
@@ -524,6 +562,10 @@ var SubscriptionsApi = /*#__PURE__*/function () {
524
562
  throw new Error("Missing the required parameter 'id' when calling updateSubscriptionInstallment");
525
563
  }
526
564
 
565
+ if (opts['payments'] === undefined || opts['payments'] === null) {
566
+ throw new Error("Missing the required parameter 'payments' when calling updateSubscriptionInstallment");
567
+ }
568
+
527
569
  var pathParams = {
528
570
  'id': id
529
571
  };
@@ -68,6 +68,15 @@ var TeamsApi = /*#__PURE__*/function () {
68
68
  value: function addTeamWithHttpInfo(opts) {
69
69
  opts = opts || {};
70
70
  var postBody = opts['createTeam'];
71
+
72
+ if (opts['name'] === undefined || opts['name'] === null) {
73
+ throw new Error("Missing the required parameter 'name' when calling addTeam");
74
+ }
75
+
76
+ if (opts['manager_id'] === undefined || opts['manager_id'] === null) {
77
+ throw new Error("Missing the required parameter 'manager_id' when calling addTeam");
78
+ }
79
+
71
80
  var pathParams = {};
72
81
  var queryParams = {};
73
82
  var headerParams = {};
@@ -126,6 +135,10 @@ var TeamsApi = /*#__PURE__*/function () {
126
135
  throw new Error("Missing the required parameter 'id' when calling addTeamUser");
127
136
  }
128
137
 
138
+ if (opts['users'] === undefined || opts['users'] === null) {
139
+ throw new Error("Missing the required parameter 'users' when calling addTeamUser");
140
+ }
141
+
129
142
  var pathParams = {
130
143
  'id': id
131
144
  };
@@ -187,6 +200,10 @@ var TeamsApi = /*#__PURE__*/function () {
187
200
  throw new Error("Missing the required parameter 'id' when calling deleteTeamUser");
188
201
  }
189
202
 
203
+ if (opts['users'] === undefined || opts['users'] === null) {
204
+ throw new Error("Missing the required parameter 'users' when calling deleteTeamUser");
205
+ }
206
+
190
207
  var pathParams = {
191
208
  'id': id
192
209
  };
@@ -64,6 +64,19 @@ var WebhooksApi = /*#__PURE__*/function () {
64
64
  value: function addWebhookWithHttpInfo(opts) {
65
65
  opts = opts || {};
66
66
  var postBody = opts['addWebhookRequest'];
67
+
68
+ if (opts['subscription_url'] === undefined || opts['subscription_url'] === null) {
69
+ throw new Error("Missing the required parameter 'subscription_url' when calling addWebhook");
70
+ }
71
+
72
+ if (opts['event_action'] === undefined || opts['event_action'] === null) {
73
+ throw new Error("Missing the required parameter 'event_action' when calling addWebhook");
74
+ }
75
+
76
+ if (opts['event_object'] === undefined || opts['event_object'] === null) {
77
+ throw new Error("Missing the required parameter 'event_object' when calling addWebhook");
78
+ }
79
+
67
80
  var pathParams = {};
68
81
  var queryParams = {};
69
82
  var headerParams = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipedrive",
3
- "version": "13.0.12",
3
+ "version": "13.1.0",
4
4
  "description": "Pipedrive REST client for NodeJS",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,8 @@
21
21
  "@babel/cli": "^7.0.0",
22
22
  "@babel/runtime": "^7.14.0",
23
23
  "jest-environment-node": "^27.4.4",
24
- "superagent": "^5.3.0"
24
+ "superagent": "^5.3.0",
25
+ "lodash": "^4.17.21"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@babel/core": "^7.0.0",