pipedrive 17.4.0 → 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,10 @@ 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
+
11
15
  ## 17.4.0
12
16
  ### Changed
13
17
  - Added `pipeline` and `stage` objects to the `related_objects` section 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}
@@ -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
 
@@ -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.4.0",
3
+ "version": "17.5.0",
4
4
  "description": "Pipedrive REST client for NodeJS",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",