asana 0.18.6 → 0.18.14

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.
@@ -0,0 +1,27 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+
11
+ jobs:
12
+ test:
13
+ name: Run npm build and npm test
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ node-version: [8.x, 9.x, 12.x]
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ - name: Install dependencies
25
+ run: npm i
26
+ - run: npm run build --if-present
27
+ - run: npm test
@@ -0,0 +1,26 @@
1
+ name: Publish to GitHub Releases
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ jobs:
9
+ build-n-publish-to-github:
10
+ name: Build and publish to GitHub Releases
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - uses: actions/setup-node@v3
15
+ with:
16
+ node-version: '8.x'
17
+ - name: Bundle the code, full version to asana.js and minified to asana-min.js
18
+ run: |
19
+ npm i gulp
20
+ gulp bundle
21
+ - name: Publish to GitHub Releases
22
+ uses: softprops/action-gh-release@v1
23
+ with:
24
+ files: |
25
+ dist/asana.js
26
+ dist/asana-min.js
@@ -0,0 +1,21 @@
1
+ name: Publish 📦 to npmjs
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ jobs:
9
+ build-n-publish-to-npmjs:
10
+ name: Build and publish 📦 to npmjs
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - uses: actions/setup-node@v3
15
+ with:
16
+ node-version: '8.x'
17
+ registry-url: 'https://registry.npmjs.com'
18
+ - run: npm i
19
+ - run: npm publish
20
+ env:
21
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Asana [![GitHub release][release-image]]() [![Build Status][travis-image]][travis-url] [![NPM Version][npm-image]][npm-url]
1
+ # Asana [![GitHub release][release-image]]() [![Build Status][github-actions-image]][github-actions-url] [![NPM Version][npm-image]][npm-url]
2
2
 
3
3
  A JavaScript client (for both Node and browser) for the Asana API v1.0.
4
4
 
@@ -314,18 +314,34 @@ See our [openapi spec][https://github.com/Asana/developer-docs/blob/master/defs/
314
314
 
315
315
  **Repo Owners Only.** Take the following steps to issue a new release of the library.
316
316
 
317
+ #### Automatic Deployment
318
+
317
319
  1. Merge in the desired changes into the `master` branch and commit them.
318
320
  2. Clone the repo; work on `master`.
319
- 3. Bump the package version to indicate the [semantic version](http://semver.org) change, using one of: `gulp bump-patch`, `gulp bump-feature`, or `gulp bump-release`
321
+ 3. Bump the package version to indicate the [semantic version](http://semver.org) change, using one of: `gulp bump-patch`, `gulp bump-minor`, or `gulp bump-major`
322
+ (NOTE: If this is your first time running `gulp` please install `gulp` globally using `npm i -g gulp`)
320
323
  4. Push changes to origin, including tags:
321
- `git push origin master --tags`
324
+ `git push --tags origin master:master`
325
+
326
+ #### Manual Deployment
327
+
328
+ 1. Merge in the desired changes into the `master` branch and commit them.
329
+ 2. Clone the repo, work on master.
330
+ 3. Edit package version in `package.json`, `bower.json` and `VERSION` to indicate the [semantic version](http://semver.org/) change.
331
+ 4. Commit the change
332
+ 5. Tag the commit with `v` plus the same version number you set in the file.
333
+ `git tag v1.2.3`
334
+ 6. Push changes to origin, including tags:
335
+ `git push --tags origin master:master`
336
+
337
+ GitHub Actions will automatically build and deploy the tagged release.
322
338
 
323
- Travis CI will automatically build and deploy the tagged release.
339
+ :reminder_ribbon: Make sure to edit the [new release](https://github.com/Asana/node-asana/releases) description on GitHub after it has been deployed. Please use bullet points to indicate notable changes since the last version.
324
340
 
325
341
  [release-image]: https://img.shields.io/github/release/asana/node-asana.svg
326
342
 
327
- [travis-url]: http://travis-ci.org/Asana/node-asana
328
- [travis-image]: http://img.shields.io/travis/Asana/node-asana.svg?style=flat-square&branch=master
343
+ [github-actions-url]: https://github.com/Asana/node-asana/actions
344
+ [github-actions-image]: https://github.com/Asana/node-asana/workflows/Build/badge.svg
329
345
 
330
346
  [npm-url]: https://www.npmjs.org/package/asana
331
347
  [npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.18.6
1
+ 0.18.14
package/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "asana",
3
3
  "main": "dist/asana.js",
4
- "version": "0.15.1",
4
+ "version": "0.18.14",
5
5
  "homepage": "https://github.com/Asana/node-asana",
6
6
  "authors": [
7
7
  "Greg Slovacek <greg@asana.com>",
package/gulpfile.js CHANGED
@@ -1,4 +1,5 @@
1
1
  var browserify = require('browserify');
2
+ var fs = require('fs');
2
3
  var bump = require('gulp-bump');
3
4
  var filter = require('gulp-filter');
4
5
  var git = require('gulp-git');
@@ -51,8 +52,10 @@ function browserTask(minify) {
51
52
  function ensureGitClean(done) {
52
53
  git.status(function(err, out) {
53
54
  if (err) { throw err; }
54
- if (!/working directory clean/.exec(out)) {
55
- throw new Error('Git working directory not clean, will not bump version');
55
+ if (!/nothing to commit/.exec(out)) {
56
+ throw new Error(
57
+ 'Git working directory not clean, will not bump version'
58
+ );
56
59
  }
57
60
  });
58
61
 
@@ -66,33 +69,87 @@ gulp.task('ensure-git-clean', ensureGitClean);
66
69
  *
67
70
  * You can use the commands
68
71
  *
69
- * gulp bump-patch # makes v0.1.0 → v0.1.1
70
- * gulp bump-feature # makes v0.1.1 → v0.2.0
71
- * gulp bump-release # makes v0.2.1 → v1.0.0
72
+ * gulp bump-patch # makes v0.1.0 → v0.1.1
73
+ * gulp bump-minor # makes v0.1.1 → v0.2.0
74
+ * gulp bump-major # makes v0.2.1 → v1.0.0
72
75
  *
73
76
  * To bump the version numbers accordingly after you did a patch,
74
77
  * introduced a feature or made a backwards-incompatible release.
75
78
  */
76
79
  function bumpVersion(importance) {
77
- return gulp.src(['./package.json', './bower.json'])
78
- .pipe(bump({type: importance}))
79
- .pipe(gulp.dest('./'))
80
- .pipe(git.commit('bump package version'))
80
+ // Update VERSION file
81
+ function updateVersionFile(cb) {
82
+ fs.readFile('VERSION', 'utf-8', function (err, data) {
83
+ if (err) {
84
+ console.log(err);
85
+ }
86
+
87
+ var versionArray = data.split('.');
88
+ var major = versionArray[0];
89
+ var minor = versionArray[1];
90
+ var patch = versionArray[2];
91
+
92
+ if (importance === 'major') {
93
+ major = (parseInt(major) + 1).toString();
94
+ }
95
+ if (importance === 'minor') {
96
+ minor = (parseInt(minor) + 1).toString();
97
+ }
98
+ if (importance === 'patch') {
99
+ patch = (parseInt(patch) + 1).toString();
100
+ }
101
+
102
+ var updatedVersion = [major, minor, patch].join('.');
103
+
104
+ fs.writeFile('VERSION', updatedVersion, function (err) {
105
+ if (err) {
106
+ console.log(err);
107
+ }
108
+ });
109
+ });
110
+ cb();
111
+ }
112
+
113
+ // Bump version in package.json and bower.json
114
+ function updateVersion() {
115
+ return gulp
116
+ .src(['./package.json', './bower.json'])
117
+ .pipe(bump({ type: importance }))
118
+ .pipe(gulp.dest('./'));
119
+ }
120
+
121
+ // Add, commit version files and tag commit with new version
122
+ function addCommitTagPush(cb) {
123
+ gulp
124
+ .src(['./package.json', './bower.json', './VERSION'])
125
+ .pipe(git.add())
126
+ .pipe(git.commit('Bump package version'))
81
127
  .pipe(filter('package.json'))
82
128
  .pipe(tagVersion());
129
+ cb();
130
+ }
131
+
132
+ // Update the version files in parallel and then commit the changes
133
+ return gulp.series(
134
+ gulp.parallel(updateVersionFile, updateVersion),
135
+ addCommitTagPush
136
+ )();
83
137
  }
84
- function bumpPatch() {
85
- return bumpVersion('patch');
138
+ function bumpPatch(cb) {
139
+ bumpVersion('patch');
140
+ cb();
86
141
  }
87
142
  gulp.task('bump-patch', gulp.series('ensure-git-clean', bumpPatch));
88
- function bumpFeature() {
89
- return bumpVersion('minor');
143
+ function bumpMinor(cb) {
144
+ bumpVersion('minor');
145
+ cb();
90
146
  }
91
- gulp.task('bump-feature', gulp.series('ensure-git-clean', bumpFeature));
92
- function bumpVersion() {
93
- return bumpVersion('major');
147
+ gulp.task('bump-minor', gulp.series('ensure-git-clean', bumpMinor));
148
+ function bumpMajor(cb) {
149
+ bumpVersion('major');
150
+ cb();
94
151
  }
95
- gulp.task('bump-release', gulp.series('ensure-git-clean', bumpVersion));
152
+ gulp.task('bump-major', gulp.series('ensure-git-clean', bumpMajor));
96
153
 
97
154
  /**
98
155
  * Lints all of the JavaScript files and fails if the tasks do not pass
@@ -117,7 +174,7 @@ function spec(callback) {
117
174
  .on('finish', function() {
118
175
  gulp.src(test)
119
176
  .pipe(mocha({
120
- reporter: process.env.TRAVIS ? 'spec' : 'nyan'
177
+ reporter: 'nyan'
121
178
  }))
122
179
  .pipe(istanbul.writeReports({
123
180
  reporters: ['text', 'text-summary']
package/lib/auth/app.js CHANGED
@@ -97,7 +97,7 @@ App.prototype.accessTokenFromCode = function(code, options) {
97
97
  var params = {
98
98
  method: 'POST',
99
99
  url: this.asanaTokenUrl(options),
100
- formData: {
100
+ form: {
101
101
  'grant_type': 'authorization_code',
102
102
  'client_id': this.clientId,
103
103
  'client_secret': this.clientSecret,
@@ -121,7 +121,7 @@ App.prototype.accessTokenFromRefreshToken = function(refreshToken, options) {
121
121
  var params = {
122
122
  method: 'POST',
123
123
  url: this.asanaTokenUrl(options),
124
- formData: {
124
+ form: {
125
125
  'grant_type': 'refresh_token',
126
126
  'client_id': this.clientId,
127
127
  'client_secret': this.clientSecret,
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This file is auto-generated by our openapi spec.
3
+ * We try to keep the generated code pretty clean but there will be lint
4
+ * errors that are just not worth fixing (like unused requires).
5
+ * TODO: maybe we can just disable those specifically and keep this code
6
+ * pretty lint-free too!
7
+ */
8
+ /* jshint ignore:start */
9
+ var Resource = require('../resource');
10
+ var util = require('util');
11
+ var _ = require('lodash');
12
+
13
+ function AuditLogAPI(dispatcher) {
14
+ Resource.call(this, dispatcher);
15
+ }
16
+ util.inherits(AuditLogAPI, Resource);
17
+
18
+
19
+ /**
20
+ * Get audit log events
21
+ * @param {String} workspaceGid: (required) Globally unique identifier for the workspace or organization.
22
+ * @param {Object} params: Parameters for the request
23
+ - startAt {Date}: Filter to events created after this time (inclusive).
24
+ - endAt {Date}: Filter to events created before this time (exclusive).
25
+ - eventType {String}: Filter to events of this type. Refer to the [Supported AuditLogEvents](/docs/supported-auditlogevents) for a full list of values.
26
+ - actorType {String}: Filter to events with an actor of this type. This only needs to be included if querying for actor types without an ID. If `actor_gid` is included, this should be excluded.
27
+ - actorGid {String}: Filter to events triggered by the actor with this ID.
28
+ - resourceGid {String}: Filter to events with this resource ID.
29
+ - offset {String}: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
30
+ - limit {Number}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
31
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
32
+ * @return {Promise} The requested resource
33
+ */
34
+ AuditLogAPI.prototype.getAuditLogEvents = function(
35
+ workspaceGid,
36
+ params,
37
+ dispatchOptions
38
+ ) {
39
+ var path = "/workspaces/{workspace_gid}/audit_log_events".replace("{workspace_gid}", workspaceGid);
40
+
41
+ return this.dispatchGetCollection(path, params, dispatchOptions)
42
+ };
43
+
44
+ module.exports = AuditLogAPI;
45
+ /* jshint ignore:end */
@@ -0,0 +1,299 @@
1
+ /**
2
+ * This file is auto-generated by our openapi spec.
3
+ * We try to keep the generated code pretty clean but there will be lint
4
+ * errors that are just not worth fixing (like unused requires).
5
+ * TODO: maybe we can just disable those specifically and keep this code
6
+ * pretty lint-free too!
7
+ */
8
+ /* jshint ignore:start */
9
+ var Resource = require('../resource');
10
+ var util = require('util');
11
+ var _ = require('lodash');
12
+
13
+ function Goals(dispatcher) {
14
+ Resource.call(this, dispatcher);
15
+ }
16
+ util.inherits(Goals, Resource);
17
+
18
+
19
+ /**
20
+ * Add a collaborator to a goal
21
+ * @param {Object} data: Data for the request
22
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
23
+ * @return {Promise} The requested resource
24
+ */
25
+ Goals.prototype.addFollowers = function(
26
+ data,
27
+ dispatchOptions
28
+ ) {
29
+ var path = "/goals/{goal_gid}/addFollowers";
30
+
31
+ return this.dispatchPost(path, data, dispatchOptions)
32
+ };
33
+
34
+
35
+ /**
36
+ * Add a subgoal to a parent goal
37
+ * @param {Object} data: Data for the request
38
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
39
+ * @return {Promise} The requested resource
40
+ */
41
+ Goals.prototype.addSubgoal = function(
42
+ data,
43
+ dispatchOptions
44
+ ) {
45
+ var path = "/goals/{goal_gid}/addSubgoal";
46
+
47
+ return this.dispatchPost(path, data, dispatchOptions)
48
+ };
49
+
50
+
51
+ /**
52
+ * Add a project/portfolio as supporting work for a goal.
53
+ * @param {Object} data: Data for the request
54
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
55
+ * @return {Promise} The requested resource
56
+ */
57
+ Goals.prototype.addSupportingWorkForGoal = function(
58
+ data,
59
+ dispatchOptions
60
+ ) {
61
+ var path = "/goals/{goal_gid}/addSupportingWork";
62
+
63
+ return this.dispatchPost(path, data, dispatchOptions)
64
+ };
65
+
66
+
67
+ /**
68
+ * Create a goal
69
+ * @param {Object} data: Data for the request
70
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
71
+ * @return {Promise} The requested resource
72
+ */
73
+ Goals.prototype.createGoal = function(
74
+ data,
75
+ dispatchOptions
76
+ ) {
77
+ var path = "/goals";
78
+
79
+ return this.dispatchPost(path, data, dispatchOptions)
80
+ };
81
+
82
+
83
+ /**
84
+ * Create a goal metric
85
+ * @param {Object} data: Data for the request
86
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
87
+ * @return {Promise} The requested resource
88
+ */
89
+ Goals.prototype.createGoalMetric = function(
90
+ data,
91
+ dispatchOptions
92
+ ) {
93
+ var path = "/goals/{goal_gid}/setMetric";
94
+
95
+ return this.dispatchPost(path, data, dispatchOptions)
96
+ };
97
+
98
+
99
+ /**
100
+ * Delete a goal
101
+ * @param {String} goalGid: (required) Globally unique identifier for the goal.
102
+ * @param {Object} data: Data for the request
103
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
104
+ * @return {Promise} The requested resource
105
+ */
106
+ Goals.prototype.deleteGoal = function(
107
+ goalGid,
108
+ data,
109
+ dispatchOptions
110
+ ) {
111
+ var path = "/goals/{goal_gid}".replace("{goal_gid}", goalGid);
112
+
113
+ return this.dispatchDelete(path, data, dispatchOptions)
114
+ };
115
+
116
+
117
+ /**
118
+ * Get a goal
119
+ * @param {String} goalGid: (required) Globally unique identifier for the goal.
120
+ * @param {Object} params: Parameters for the request
121
+ - optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
122
+ - optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
123
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
124
+ * @return {Promise} The requested resource
125
+ */
126
+ Goals.prototype.getGoal = function(
127
+ goalGid,
128
+ params,
129
+ dispatchOptions
130
+ ) {
131
+ var path = "/goals/{goal_gid}".replace("{goal_gid}", goalGid);
132
+
133
+ return this.dispatchGet(path, params, dispatchOptions)
134
+ };
135
+
136
+
137
+ /**
138
+ * Get goals
139
+ * @param {Object} params: Parameters for the request
140
+ - portfolio {String}: Globally unique identifier for supporting portfolio.
141
+ - project {String}: Globally unique identifier for supporting project.
142
+ - isWorkspaceLevel {Boolean}: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter.
143
+ - team {String}: Globally unique identifier for the team.
144
+ - workspace {String}: Globally unique identifier for the workspace.
145
+ - timePeriods {[String]}: Globally unique identifiers for the time periods.
146
+ - offset {String}: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
147
+ - limit {Number}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
148
+ - optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
149
+ - optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
150
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
151
+ * @return {Promise} The requested resource
152
+ */
153
+ Goals.prototype.getGoals = function(
154
+ params,
155
+ dispatchOptions
156
+ ) {
157
+ var path = "/goals";
158
+
159
+ return this.dispatchGetCollection(path, params, dispatchOptions)
160
+ };
161
+
162
+
163
+ /**
164
+ * Get parent goals from a goal
165
+ * @param {Object} params: Parameters for the request
166
+ - optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
167
+ - optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
168
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
169
+ * @return {Promise} The requested resource
170
+ */
171
+ Goals.prototype.getParentGoalsForGoal = function(
172
+ params,
173
+ dispatchOptions
174
+ ) {
175
+ var path = "/goals/{goal_gid}/parentGoals";
176
+
177
+ return this.dispatchGetCollection(path, params, dispatchOptions)
178
+ };
179
+
180
+
181
+ /**
182
+ * Get subgoals from a goal
183
+ * @param {Object} params: Parameters for the request
184
+ - optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
185
+ - optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
186
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
187
+ * @return {Promise} The requested resource
188
+ */
189
+ Goals.prototype.getSubgoalsForGoal = function(
190
+ params,
191
+ dispatchOptions
192
+ ) {
193
+ var path = "/goals/{goal_gid}/subgoals";
194
+
195
+ return this.dispatchGetCollection(path, params, dispatchOptions)
196
+ };
197
+
198
+
199
+ /**
200
+ * Remove a collaborator from a goal
201
+ * @param {Object} data: Data for the request
202
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
203
+ * @return {Promise} The requested resource
204
+ */
205
+ Goals.prototype.removeFollowers = function(
206
+ data,
207
+ dispatchOptions
208
+ ) {
209
+ var path = "/goals/{goal_gid}/removeFollowers";
210
+
211
+ return this.dispatchPost(path, data, dispatchOptions)
212
+ };
213
+
214
+
215
+ /**
216
+ * Remove a subgoal from a goal
217
+ * @param {Object} data: Data for the request
218
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
219
+ * @return {Promise} The requested resource
220
+ */
221
+ Goals.prototype.removeSubgoal = function(
222
+ data,
223
+ dispatchOptions
224
+ ) {
225
+ var path = "/goals/{goal_gid}/removeSubgoal";
226
+
227
+ return this.dispatchPost(path, data, dispatchOptions)
228
+ };
229
+
230
+
231
+ /**
232
+ * Remove a project/portfolio as supporting work for a goal.
233
+ * @param {Object} data: Data for the request
234
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
235
+ * @return {Promise} The requested resource
236
+ */
237
+ Goals.prototype.removeSupportingWorkForGoal = function(
238
+ data,
239
+ dispatchOptions
240
+ ) {
241
+ var path = "/goals/{goal_gid}/removeSupportingWork";
242
+
243
+ return this.dispatchPost(path, data, dispatchOptions)
244
+ };
245
+
246
+
247
+ /**
248
+ * Get supporting work from a goal
249
+ * @param {Object} params: Parameters for the request
250
+ - optFields {[String]}: Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
251
+ - optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
252
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
253
+ * @return {Promise} The requested resource
254
+ */
255
+ Goals.prototype.supportingWork = function(
256
+ params,
257
+ dispatchOptions
258
+ ) {
259
+ var path = "/goals/{goal_gid}/supportingWork";
260
+
261
+ return this.dispatchGetCollection(path, params, dispatchOptions)
262
+ };
263
+
264
+
265
+ /**
266
+ * Update a goal
267
+ * @param {String} goalGid: (required) Globally unique identifier for the goal.
268
+ * @param {Object} data: Data for the request
269
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
270
+ * @return {Promise} The requested resource
271
+ */
272
+ Goals.prototype.updateGoal = function(
273
+ goalGid,
274
+ data,
275
+ dispatchOptions
276
+ ) {
277
+ var path = "/goals/{goal_gid}".replace("{goal_gid}", goalGid);
278
+
279
+ return this.dispatchPut(path, data, dispatchOptions)
280
+ };
281
+
282
+
283
+ /**
284
+ * Update a goal metric
285
+ * @param {Object} data: Data for the request
286
+ * @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
287
+ * @return {Promise} The requested resource
288
+ */
289
+ Goals.prototype.updateGoalMetric = function(
290
+ data,
291
+ dispatchOptions
292
+ ) {
293
+ var path = "/goals/{goal_gid}/setMetricCurrentValue";
294
+
295
+ return this.dispatchPost(path, data, dispatchOptions)
296
+ };
297
+
298
+ module.exports = Goals;
299
+ /* jshint ignore:end */