pipedrive 17.3.1 → 17.5.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,21 @@ For public Changelog covering all changes done to Pipedrive’s API, webhooks an
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## 17.5.0
12
+ ### Changed
13
+ - Updated `type.params.pipeline_id` and `type.params.activity_type_id` description, type and response example for goals queries
14
+
15
+ ## 17.4.0
16
+ ### Changed
17
+ - Added `pipeline` and `stage` objects to the `related_objects` section in the following endpoints:
18
+ - `GET /v1/deals`
19
+ - `GET /v1/deals/{id}`
20
+ - `GET /v1/organizations/{id}/deals`
21
+ - `GET /v1/persons/{id}/deals`
22
+ - `GET /v1/products/{id}/deals`
23
+ - `POST /v1/deals`
24
+ - `PUT /v1/deals/{id}`
25
+
11
26
  ## 17.3.1
12
27
  ### Changed
13
28
  - Changed the content type to `application/json` in the following endpoints:
@@ -104,7 +104,7 @@ var GoalsApi = /*#__PURE__*/function () {
104
104
  /**
105
105
  * Delete existing goal
106
106
  * Marks a goal as deleted.
107
- * @param {String} id The ID of the goal to be deleted
107
+ * @param {String} id The ID of the goal
108
108
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteGoalResponse200} and HTTP response
109
109
  */
110
110
 
@@ -147,7 +147,7 @@ var GoalsApi = /*#__PURE__*/function () {
147
147
  /**
148
148
  * Delete existing goal
149
149
  * Marks a goal as deleted.
150
- * @param {String} id The ID of the goal to be deleted
150
+ * @param {String} id The ID of the goal
151
151
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteGoalResponse200}
152
152
  */
153
153
 
@@ -162,8 +162,8 @@ var GoalsApi = /*#__PURE__*/function () {
162
162
  * Get result of a goal
163
163
  * Gets the progress of a goal for the specified period.
164
164
  * @param {String} id The ID of the goal that the results are looked for
165
- * @param {Date} periodStart The start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. This date must be the same or after the goal duration start date.
166
- * @param {Date} periodEnd The end date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. This date must be the same or before the goal duration end date.
165
+ * @param {Date} periodStart The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date.
166
+ * @param {Date} periodEnd The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date.
167
167
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetGoalResultResponse200} and HTTP response
168
168
  */
169
169
 
@@ -220,8 +220,8 @@ var GoalsApi = /*#__PURE__*/function () {
220
220
  * Get result of a goal
221
221
  * Gets the progress of a goal for the specified period.
222
222
  * @param {String} id The ID of the goal that the results are looked for
223
- * @param {Date} periodStart The start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. This date must be the same or after the goal duration start date.
224
- * @param {Date} periodEnd The end date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. This date must be the same or before the goal duration end date.
223
+ * @param {Date} periodStart The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date.
224
+ * @param {Date} periodEnd The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date.
225
225
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetGoalResultResponse200}
226
226
  */
227
227
 
@@ -244,9 +244,9 @@ var GoalsApi = /*#__PURE__*/function () {
244
244
  * @param {Number} opts.expectedOutcomeTarget The numeric value of the outcome. If provided, everyone's goals will be returned.
245
245
  * @param {module:model/String} opts.expectedOutcomeTrackingMetric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned.
246
246
  * @param {Number} opts.expectedOutcomeCurrencyId The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned.
247
- * @param {Number} opts.typeParamsPipelineId The ID of the pipeline or `null` for all pipelines. If provided, everyone's goals will be returned.
247
+ * @param {Array.<Number>} opts.typeParamsPipelineId An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned.
248
248
  * @param {Number} opts.typeParamsStageId The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned.
249
- * @param {Number} opts.typeParamsActivityTypeId The ID of the activity type. Applicable to only `activities_completed` or `activities_added` types of goals. If provided, everyone's goals will be returned.
249
+ * @param {Array.<Number>} opts.typeParamsActivityTypeId An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned.
250
250
  * @param {Date} opts.periodStart The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too.
251
251
  * @param {Date} opts.periodEnd The end date of the period for which to find goals. Date in format of YYYY-MM-DD.
252
252
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetGoalsResponse200} and HTTP response
@@ -267,9 +267,9 @@ var GoalsApi = /*#__PURE__*/function () {
267
267
  'expected_outcome.target': opts['expectedOutcomeTarget'],
268
268
  'expected_outcome.tracking_metric': opts['expectedOutcomeTrackingMetric'],
269
269
  'expected_outcome.currency_id': opts['expectedOutcomeCurrencyId'],
270
- 'type.params.pipeline_id': opts['typeParamsPipelineId'],
270
+ 'type.params.pipeline_id': this.apiClient.buildCollectionParam(opts['typeParamsPipelineId'], 'csv'),
271
271
  'type.params.stage_id': opts['typeParamsStageId'],
272
- 'type.params.activity_type_id': opts['typeParamsActivityTypeId'],
272
+ 'type.params.activity_type_id': this.apiClient.buildCollectionParam(opts['typeParamsActivityTypeId'], 'csv'),
273
273
  'period.start': opts['periodStart'],
274
274
  'period.end': opts['periodEnd']
275
275
  };
@@ -307,9 +307,9 @@ var GoalsApi = /*#__PURE__*/function () {
307
307
  * @param {Number} opts.expectedOutcomeTarget The numeric value of the outcome. If provided, everyone's goals will be returned.
308
308
  * @param {module:model/String} opts.expectedOutcomeTrackingMetric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned.
309
309
  * @param {Number} opts.expectedOutcomeCurrencyId The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned.
310
- * @param {Number} opts.typeParamsPipelineId The ID of the pipeline or `null` for all pipelines. If provided, everyone's goals will be returned.
310
+ * @param {Array.<Number>} opts.typeParamsPipelineId An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned.
311
311
  * @param {Number} opts.typeParamsStageId The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned.
312
- * @param {Number} opts.typeParamsActivityTypeId The ID of the activity type. Applicable to only `activities_completed` or `activities_added` types of goals. If provided, everyone's goals will be returned.
312
+ * @param {Array.<Number>} opts.typeParamsActivityTypeId An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned.
313
313
  * @param {Date} opts.periodStart The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too.
314
314
  * @param {Date} opts.periodEnd The end date of the period for which to find goals. Date in format of YYYY-MM-DD.
315
315
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetGoalsResponse200}
@@ -325,7 +325,7 @@ var GoalsApi = /*#__PURE__*/function () {
325
325
  /**
326
326
  * Update existing goal
327
327
  * Updates an existing goal.
328
- * @param {String} id The ID of the goal to be updated
328
+ * @param {String} id The ID of the goal
329
329
  * @param {Object} opts Optional parameters
330
330
  * @param {module:model/BasicGoal} opts.basicGoal
331
331
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AddOrUpdateGoalResponse200} and HTTP response
@@ -370,7 +370,7 @@ var GoalsApi = /*#__PURE__*/function () {
370
370
  /**
371
371
  * Update existing goal
372
372
  * Updates an existing goal.
373
- * @param {String} id The ID of the goal to be updated
373
+ * @param {String} id The ID of the goal
374
374
  * @param {Object} opts Optional parameters
375
375
  * @param {module:model/BasicGoal} opts.basicGoal
376
376
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AddOrUpdateGoalResponse200}
@@ -23,6 +23,8 @@ var _DeleteProductFollowerResponse = _interopRequireDefault(require("../model/De
23
23
 
24
24
  var _DeleteProductResponse = _interopRequireDefault(require("../model/DeleteProductResponse"));
25
25
 
26
+ var _ListDealsResponse = _interopRequireDefault(require("../model/ListDealsResponse"));
27
+
26
28
  var _ListFilesResponse = _interopRequireDefault(require("../model/ListFilesResponse"));
27
29
 
28
30
  var _ListProductFollowersResponse = _interopRequireDefault(require("../model/ListProductFollowersResponse"));
@@ -35,8 +37,6 @@ var _ProductSearchResponse = _interopRequireDefault(require("../model/ProductSea
35
37
 
36
38
  var _ProductsResponse = _interopRequireDefault(require("../model/ProductsResponse"));
37
39
 
38
- var _UpdateDealRequest = _interopRequireDefault(require("../model/UpdateDealRequest"));
39
-
40
40
  var _UpdateProductRequestBody = _interopRequireDefault(require("../model/UpdateProductRequestBody"));
41
41
 
42
42
  var _UpdateProductResponse = _interopRequireDefault(require("../model/UpdateProductResponse"));
@@ -369,7 +369,7 @@ var ProductsApi = /*#__PURE__*/function () {
369
369
  * @param {Number} opts.start Pagination start (default to 0)
370
370
  * @param {Number} opts.limit Items shown per page
371
371
  * @param {module:model/String} opts.status Only fetch deals with a specific status. If omitted, all not deleted deals are fetched. (default to 'all_not_deleted')
372
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateDealRequest} and HTTP response
372
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListDealsResponse} and HTTP response
373
373
  */
374
374
 
375
375
  }, {
@@ -409,7 +409,7 @@ var ProductsApi = /*#__PURE__*/function () {
409
409
 
410
410
  var authNames = ['api_key', 'oauth2'];
411
411
  var accepts = ['application/json'];
412
- var returnType = _UpdateDealRequest["default"];
412
+ var returnType = _ListDealsResponse["default"];
413
413
  return this.apiClient.callApi('/products/{id}/deals', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
414
414
  }
415
415
  /**
@@ -420,7 +420,7 @@ var ProductsApi = /*#__PURE__*/function () {
420
420
  * @param {Number} opts.start Pagination start (default to 0)
421
421
  * @param {Number} opts.limit Items shown per page
422
422
  * @param {module:model/String} opts.status Only fetch deals with a specific status. If omitted, all not deleted deals are fetched. (default to 'all_not_deleted')
423
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateDealRequest}
423
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListDealsResponse}
424
424
  */
425
425
 
426
426
  }, {
@@ -118,7 +118,7 @@ BasicGoal.prototype['title'] = undefined;
118
118
 
119
119
  BasicGoal.prototype['assignee'] = undefined;
120
120
  /**
121
- * 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`.
121
+ * The type of the goal. It requires the following JSON structure: { \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }. 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. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.”
122
122
  * @member {Object} type
123
123
  */
124
124
 
@@ -13,6 +13,10 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
 
14
14
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
15
15
 
16
+ var _BasePipeline = _interopRequireDefault(require("./BasePipeline"));
17
+
18
+ var _BaseStage = _interopRequireDefault(require("./BaseStage"));
19
+
16
20
  var _RelatedOrganizationDataWithActiveFlag = _interopRequireDefault(require("./RelatedOrganizationDataWithActiveFlag"));
17
21
 
18
22
  var _RelatedPersonDataWithActiveFlag = _interopRequireDefault(require("./RelatedPersonDataWithActiveFlag"));
@@ -85,6 +89,16 @@ var ListDealsResponseAllOfRelatedObjects = /*#__PURE__*/function () {
85
89
  delete data['user'];
86
90
  }
87
91
 
92
+ if (data.hasOwnProperty('stage')) {
93
+ obj['stage'] = _BaseStage["default"].constructFromObject(data['stage']);
94
+ delete data['stage'];
95
+ }
96
+
97
+ if (data.hasOwnProperty('pipeline')) {
98
+ obj['pipeline'] = _BasePipeline["default"].constructFromObject(data['pipeline']);
99
+ delete data['pipeline'];
100
+ }
101
+
88
102
  if (Object.keys(data).length > 0) {
89
103
  Object.assign(obj, data);
90
104
  }
@@ -111,5 +125,15 @@ ListDealsResponseAllOfRelatedObjects.prototype['person'] = undefined;
111
125
  */
112
126
 
113
127
  ListDealsResponseAllOfRelatedObjects.prototype['user'] = undefined;
128
+ /**
129
+ * @member {module:model/BaseStage} stage
130
+ */
131
+
132
+ ListDealsResponseAllOfRelatedObjects.prototype['stage'] = undefined;
133
+ /**
134
+ * @member {module:model/BasePipeline} pipeline
135
+ */
136
+
137
+ ListDealsResponseAllOfRelatedObjects.prototype['pipeline'] = undefined;
114
138
  var _default = ListDealsResponseAllOfRelatedObjects;
115
139
  exports["default"] = _default;
@@ -126,7 +126,7 @@ NewGoal.prototype['title'] = undefined;
126
126
 
127
127
  NewGoal.prototype['assignee'] = undefined;
128
128
  /**
129
- * 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`.
129
+ * The type of the goal. It requires the following JSON structure: { \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }. 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. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.”
130
130
  * @member {Object} type
131
131
  */
132
132
 
@@ -163,7 +163,7 @@ _BasicGoal["default"].prototype['title'] = undefined;
163
163
 
164
164
  _BasicGoal["default"].prototype['assignee'] = undefined;
165
165
  /**
166
- * 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`.
166
+ * The type of the goal. It requires the following JSON structure: { \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }. 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. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.”
167
167
  * @member {Object} type
168
168
  */
169
169
 
@@ -66,10 +66,15 @@ var Params = /*#__PURE__*/function () {
66
66
  obj = obj || new Params();
67
67
 
68
68
  if (data.hasOwnProperty('pipeline_id')) {
69
- obj['pipeline_id'] = _ApiClient["default"].convertToType(data['pipeline_id'], 'String');
69
+ obj['pipeline_id'] = _ApiClient["default"].convertToType(data['pipeline_id'], ['Number']);
70
70
  delete data['pipeline_id'];
71
71
  }
72
72
 
73
+ if (data.hasOwnProperty('activity_type_id')) {
74
+ obj['activity_type_id'] = _ApiClient["default"].convertToType(data['activity_type_id'], ['Number']);
75
+ delete data['activity_type_id'];
76
+ }
77
+
73
78
  if (Object.keys(data).length > 0) {
74
79
  Object.assign(obj, data);
75
80
  }
@@ -81,11 +86,17 @@ var Params = /*#__PURE__*/function () {
81
86
  return Params;
82
87
  }();
83
88
  /**
84
- * The pipeline ID of the goal
85
- * @member {String} pipeline_id
89
+ * The IDs of pipelines of the goal
90
+ * @member {Array.<Number>} pipeline_id
86
91
  */
87
92
 
88
93
 
89
94
  Params.prototype['pipeline_id'] = undefined;
95
+ /**
96
+ * The IDs of activity types of the goal
97
+ * @member {Array.<Number>} activity_type_id
98
+ */
99
+
100
+ Params.prototype['activity_type_id'] = undefined;
90
101
  var _default = Params;
91
102
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipedrive",
3
- "version": "17.3.1",
3
+ "version": "17.5.0",
4
4
  "description": "Pipedrive REST client for NodeJS",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",