asana 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +15 -7
  2. package/codegen/templates/ApiClient.mustache +5 -0
  3. package/codegen/templates/README.mustache +3 -3
  4. package/codegen/templates/api.mustache +7 -0
  5. package/codegen/templates/package.mustache +1 -1
  6. package/dist/ApiClient.js +8 -3
  7. package/dist/api/AccessRequestsApi.js +238 -0
  8. package/dist/api/AllocationsApi.js +1 -1
  9. package/dist/api/AttachmentsApi.js +6 -4
  10. package/dist/api/AuditLogAPIApi.js +1 -1
  11. package/dist/api/BatchAPIApi.js +1 -1
  12. package/dist/api/CustomFieldSettingsApi.js +1 -1
  13. package/dist/api/CustomFieldsApi.js +15 -15
  14. package/dist/api/CustomTypesApi.js +54 -6
  15. package/dist/api/EventsApi.js +1 -1
  16. package/dist/api/ExportsApi.js +44 -5
  17. package/dist/api/GoalRelationshipsApi.js +1 -1
  18. package/dist/api/GoalsApi.js +1 -1
  19. package/dist/api/JobsApi.js +1 -1
  20. package/dist/api/MembershipsApi.js +5 -5
  21. package/dist/api/OrganizationExportsApi.js +1 -1
  22. package/dist/api/PortfolioMembershipsApi.js +1 -1
  23. package/dist/api/PortfoliosApi.js +13 -13
  24. package/dist/api/ProjectBriefsApi.js +1 -1
  25. package/dist/api/ProjectMembershipsApi.js +1 -1
  26. package/dist/api/ProjectStatusesApi.js +1 -1
  27. package/dist/api/ProjectTemplatesApi.js +1 -1
  28. package/dist/api/ProjectsApi.js +1 -1
  29. package/dist/api/ReactionsApi.js +124 -0
  30. package/dist/api/RulesApi.js +1 -1
  31. package/dist/api/SectionsApi.js +1 -1
  32. package/dist/api/StatusUpdatesApi.js +1 -1
  33. package/dist/api/StoriesApi.js +5 -5
  34. package/dist/api/TagsApi.js +15 -15
  35. package/dist/api/TaskTemplatesApi.js +1 -1
  36. package/dist/api/TasksApi.js +1 -1
  37. package/dist/api/TeamMembershipsApi.js +9 -9
  38. package/dist/api/TeamsApi.js +1 -1
  39. package/dist/api/TimePeriodsApi.js +1 -1
  40. package/dist/api/TimeTrackingEntriesApi.js +75 -1
  41. package/dist/api/TypeaheadApi.js +1 -1
  42. package/dist/api/UserTaskListsApi.js +1 -1
  43. package/dist/api/UsersApi.js +1 -1
  44. package/dist/api/WebhooksApi.js +11 -11
  45. package/dist/api/WorkspaceMembershipsApi.js +1 -1
  46. package/dist/api/WorkspacesApi.js +1 -1
  47. package/dist/index.js +14 -0
  48. package/package.json +2 -2
  49. package/src/ApiClient.js +8 -3
  50. package/src/api/AccessRequestsApi.js +287 -0
  51. package/src/api/AllocationsApi.js +1 -1
  52. package/src/api/AttachmentsApi.js +6 -4
  53. package/src/api/AuditLogAPIApi.js +1 -1
  54. package/src/api/BatchAPIApi.js +1 -1
  55. package/src/api/CustomFieldSettingsApi.js +1 -1
  56. package/src/api/CustomFieldsApi.js +15 -15
  57. package/src/api/CustomTypesApi.js +60 -1
  58. package/src/api/EventsApi.js +1 -1
  59. package/src/api/ExportsApi.js +58 -5
  60. package/src/api/GoalRelationshipsApi.js +1 -1
  61. package/src/api/GoalsApi.js +1 -1
  62. package/src/api/JobsApi.js +1 -1
  63. package/src/api/MembershipsApi.js +5 -5
  64. package/src/api/OrganizationExportsApi.js +1 -1
  65. package/src/api/PortfolioMembershipsApi.js +1 -1
  66. package/src/api/PortfoliosApi.js +13 -13
  67. package/src/api/ProjectBriefsApi.js +1 -1
  68. package/src/api/ProjectMembershipsApi.js +1 -1
  69. package/src/api/ProjectStatusesApi.js +1 -1
  70. package/src/api/ProjectTemplatesApi.js +1 -1
  71. package/src/api/ProjectsApi.js +1 -1
  72. package/src/api/ReactionsApi.js +135 -0
  73. package/src/api/RulesApi.js +1 -1
  74. package/src/api/SectionsApi.js +1 -1
  75. package/src/api/StatusUpdatesApi.js +1 -1
  76. package/src/api/StoriesApi.js +5 -5
  77. package/src/api/TagsApi.js +15 -15
  78. package/src/api/TaskTemplatesApi.js +1 -1
  79. package/src/api/TasksApi.js +1 -1
  80. package/src/api/TeamMembershipsApi.js +9 -9
  81. package/src/api/TeamsApi.js +1 -1
  82. package/src/api/TimePeriodsApi.js +1 -1
  83. package/src/api/TimeTrackingEntriesApi.js +96 -1
  84. package/src/api/TypeaheadApi.js +1 -1
  85. package/src/api/UserTaskListsApi.js +1 -1
  86. package/src/api/UsersApi.js +1 -1
  87. package/src/api/WebhooksApi.js +11 -11
  88. package/src/api/WorkspaceMembershipsApi.js +1 -1
  89. package/src/api/WorkspacesApi.js +1 -1
  90. package/src/index.js +15 -1
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # asana [![GitHub release][release-image]][release-url] [![NPM Version][npm-image]][npm-url]
2
2
 
3
3
  - API version: 1.0
4
- - Package version: 3.1.0
4
+ - Package version: 3.1.2
5
5
 
6
6
  ## Installation
7
7
 
8
8
  ### For [Node.js](https://nodejs.org/)
9
9
 
10
- #### npm install from [npmjs](https://www.npmjs.com/package/asana)
10
+ #### npm install from [npm registry](https://www.npmjs.com/package/asana)
11
11
 
12
12
  ```shell
13
13
  npm install asana --save
@@ -18,7 +18,7 @@ npm install asana --save
18
18
  Include the latest release directly from GitHub:
19
19
 
20
20
  ```html
21
- <script src="https://github.com/Asana/node-asana/releases/download/v3.1.0/asana-min.js"></script>
21
+ <script src="https://github.com/Asana/node-asana/releases/download/v3.1.2/asana-min.js"></script>
22
22
  ```
23
23
 
24
24
  Example usage (**NOTE**: be careful not to expose your access token):
@@ -195,6 +195,10 @@ All URIs are relative to *https://app.asana.com/api/1.0*
195
195
 
196
196
  Class | Method | HTTP request | Description
197
197
  ------------ | ------------- | ------------- | -------------
198
+ *Asana.AccessRequestsApi* | [**approveAccessRequest**](docs/AccessRequestsApi.md#approveAccessRequest) | **POST** /access_requests/{access_request_gid}/approve | Approve an access request
199
+ *Asana.AccessRequestsApi* | [**createAccessRequest**](docs/AccessRequestsApi.md#createAccessRequest) | **POST** /access_requests | Create an access request
200
+ *Asana.AccessRequestsApi* | [**getAccessRequests**](docs/AccessRequestsApi.md#getAccessRequests) | **GET** /access_requests | Get access requests
201
+ *Asana.AccessRequestsApi* | [**rejectAccessRequest**](docs/AccessRequestsApi.md#rejectAccessRequest) | **POST** /access_requests/{access_request_gid}/reject | Reject an access request
198
202
  *Asana.AllocationsApi* | [**createAllocation**](docs/AllocationsApi.md#createAllocation) | **POST** /allocations | Create an allocation
199
203
  *Asana.AllocationsApi* | [**deleteAllocation**](docs/AllocationsApi.md#deleteAllocation) | **DELETE** /allocations/{allocation_gid} | Delete an allocation
200
204
  *Asana.AllocationsApi* | [**getAllocation**](docs/AllocationsApi.md#getAllocation) | **GET** /allocations/{allocation_gid} | Get an allocation
@@ -216,9 +220,11 @@ Class | Method | HTTP request | Description
216
220
  *Asana.CustomFieldsApi* | [**insertEnumOptionForCustomField**](docs/CustomFieldsApi.md#insertEnumOptionForCustomField) | **POST** /custom_fields/{custom_field_gid}/enum_options/insert | Reorder a custom field&#x27;s enum
217
221
  *Asana.CustomFieldsApi* | [**updateCustomField**](docs/CustomFieldsApi.md#updateCustomField) | **PUT** /custom_fields/{custom_field_gid} | Update a custom field
218
222
  *Asana.CustomFieldsApi* | [**updateEnumOption**](docs/CustomFieldsApi.md#updateEnumOption) | **PUT** /enum_options/{enum_option_gid} | Update an enum option
223
+ *Asana.CustomTypesApi* | [**getCustomType**](docs/CustomTypesApi.md#getCustomType) | **GET** /custom_types/{custom_type_gid} | Get a custom type
219
224
  *Asana.CustomTypesApi* | [**getCustomTypes**](docs/CustomTypesApi.md#getCustomTypes) | **GET** /custom_types | Get all custom types associated with an object
220
225
  *Asana.EventsApi* | [**getEvents**](docs/EventsApi.md#getEvents) | **GET** /events | Get events on a resource
221
- *Asana.ExportsApi* | [**createGraphExport**](docs/ExportsApi.md#createGraphExport) | **POST** /exports/graph | Initiate graph export
226
+ *Asana.ExportsApi* | [**createGraphExport**](docs/ExportsApi.md#createGraphExport) | **POST** /exports/graph | Initiate a graph export
227
+ *Asana.ExportsApi* | [**createResourceExport**](docs/ExportsApi.md#createResourceExport) | **POST** /exports/resource | Initiate a resource export
222
228
  *Asana.GoalRelationshipsApi* | [**addSupportingRelationship**](docs/GoalRelationshipsApi.md#addSupportingRelationship) | **POST** /goals/{goal_gid}/addSupportingRelationship | Add a supporting goal relationship
223
229
  *Asana.GoalRelationshipsApi* | [**getGoalRelationship**](docs/GoalRelationshipsApi.md#getGoalRelationship) | **GET** /goal_relationships/{goal_relationship_gid} | Get a goal relationship
224
230
  *Asana.GoalRelationshipsApi* | [**getGoalRelationships**](docs/GoalRelationshipsApi.md#getGoalRelationships) | **GET** /goal_relationships | Get goal relationships
@@ -291,6 +297,7 @@ Class | Method | HTTP request | Description
291
297
  *Asana.ProjectsApi* | [**removeFollowersForProject**](docs/ProjectsApi.md#removeFollowersForProject) | **POST** /projects/{project_gid}/removeFollowers | Remove followers from a project
292
298
  *Asana.ProjectsApi* | [**removeMembersForProject**](docs/ProjectsApi.md#removeMembersForProject) | **POST** /projects/{project_gid}/removeMembers | Remove users from a project
293
299
  *Asana.ProjectsApi* | [**updateProject**](docs/ProjectsApi.md#updateProject) | **PUT** /projects/{project_gid} | Update a project
300
+ *Asana.ReactionsApi* | [**getReactionsOnObject**](docs/ReactionsApi.md#getReactionsOnObject) | **GET** /reactions | Get reactions with an emoji base on an object.
294
301
  *Asana.RulesApi* | [**triggerRule**](docs/RulesApi.md#triggerRule) | **POST** /rule_triggers/{rule_trigger_gid}/run | Trigger a rule
295
302
  *Asana.SectionsApi* | [**addTaskForSection**](docs/SectionsApi.md#addTaskForSection) | **POST** /sections/{section_gid}/addTask | Add task to section
296
303
  *Asana.SectionsApi* | [**createSectionForProject**](docs/SectionsApi.md#createSectionForProject) | **POST** /projects/{project_gid}/sections | Create a section in a project
@@ -362,6 +369,7 @@ Class | Method | HTTP request | Description
362
369
  *Asana.TimePeriodsApi* | [**getTimePeriods**](docs/TimePeriodsApi.md#getTimePeriods) | **GET** /time_periods | Get time periods
363
370
  *Asana.TimeTrackingEntriesApi* | [**createTimeTrackingEntry**](docs/TimeTrackingEntriesApi.md#createTimeTrackingEntry) | **POST** /tasks/{task_gid}/time_tracking_entries | Create a time tracking entry
364
371
  *Asana.TimeTrackingEntriesApi* | [**deleteTimeTrackingEntry**](docs/TimeTrackingEntriesApi.md#deleteTimeTrackingEntry) | **DELETE** /time_tracking_entries/{time_tracking_entry_gid} | Delete a time tracking entry
372
+ *Asana.TimeTrackingEntriesApi* | [**getTimeTrackingEntries**](docs/TimeTrackingEntriesApi.md#getTimeTrackingEntries) | **GET** /time_tracking_entries | Get multiple time tracking entries
365
373
  *Asana.TimeTrackingEntriesApi* | [**getTimeTrackingEntriesForTask**](docs/TimeTrackingEntriesApi.md#getTimeTrackingEntriesForTask) | **GET** /tasks/{task_gid}/time_tracking_entries | Get time tracking entries for a task
366
374
  *Asana.TimeTrackingEntriesApi* | [**getTimeTrackingEntry**](docs/TimeTrackingEntriesApi.md#getTimeTrackingEntry) | **GET** /time_tracking_entries/{time_tracking_entry_gid} | Get a time tracking entry
367
375
  *Asana.TimeTrackingEntriesApi* | [**updateTimeTrackingEntry**](docs/TimeTrackingEntriesApi.md#updateTimeTrackingEntry) | **PUT** /time_tracking_entries/{time_tracking_entry_gid} | Update a time tracking entry
@@ -585,7 +593,7 @@ You may run into the following error when making a request to an endpoint that h
585
593
 
586
594
  > "The result is too large. You should use pagination (may require specifying a workspace)!"
587
595
 
588
- In this scenario you will want to use pagaintion to gather your results. To do this, you will need to provide a `limit` query parameter argument in your request. This `limit` query parameter represents the number of results per page. NOTE: the `limit` can only be between 1 and 100.
596
+ In this scenario you will want to use pagination to gather your results. To do this, you will need to provide a `limit` query parameter argument in your request. This `limit` query parameter represents the number of results per page. NOTE: the `limit` can only be between 1 and 100.
589
597
 
590
598
  EX: Pagination gather all resources
591
599
  ```javascript
@@ -863,7 +871,7 @@ const getEvents = async () => {
863
871
  getEvents();
864
872
  ```
865
873
 
866
- ## Accessing repsonse data
874
+ ## Accessing response data
867
875
 
868
876
  ```javascript
869
877
  .
@@ -1114,6 +1122,6 @@ client.callApi(
1114
1122
  ```
1115
1123
 
1116
1124
  [release-image]: https://img.shields.io/github/release/asana/node-asana.svg
1117
- [release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.0
1125
+ [release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.2
1118
1126
  [npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
1119
1127
  [npm-url]: https://www.npmjs.org/package/asana
@@ -181,6 +181,11 @@ export class ApiClient {
181
181
  }
182
182
  }
183
183
 
184
+ // For ES modules, check for ReadStream using duck typing
185
+ if (param && typeof param.pipe === 'function' && typeof param.read === 'function' && param.readable === true) {
186
+ return true;
187
+ }
188
+
184
189
  // Buffer in Node.js
185
190
  if (typeof Buffer === 'function' && param instanceof Buffer) {
186
191
  return true;
@@ -10,7 +10,7 @@
10
10
 
11
11
  ### For [Node.js](https://nodejs.org/)
12
12
 
13
- #### npm install from [npmjs](https://www.npmjs.com/package/asana)
13
+ #### npm install from [npm registry](https://www.npmjs.com/package/asana)
14
14
 
15
15
  ```shell
16
16
  npm install {{{projectName}}} --save
@@ -385,7 +385,7 @@ You may run into the following error when making a request to an endpoint that h
385
385
 
386
386
  > "The result is too large. You should use pagination (may require specifying a workspace)!"
387
387
 
388
- In this scenario you will want to use pagaintion to gather your results. To do this, you will need to provide a `limit` query parameter argument in your request. This `limit` query parameter represents the number of results per page. NOTE: the `limit` can only be between 1 and 100.
388
+ In this scenario you will want to use pagination to gather your results. To do this, you will need to provide a `limit` query parameter argument in your request. This `limit` query parameter represents the number of results per page. NOTE: the `limit` can only be between 1 and 100.
389
389
 
390
390
  EX: Pagination gather all resources
391
391
  ```javascript
@@ -647,7 +647,7 @@ const getEvents = async () => {
647
647
  getEvents();
648
648
  ```
649
649
 
650
- ## Accessing repsonse data
650
+ ## Accessing response data
651
651
 
652
652
  ```javascript
653
653
  .
@@ -57,7 +57,14 @@ export class {{classname}} {
57
57
  let queryParams = {};
58
58
  {{#hasOptionalParams}}
59
59
  opts = opts || {};
60
+ {{#vendorExtensions.x-codegen-isCreateAttachmentForObject}}
61
+ if (opts['opt_fields']) {
62
+ queryParams['opt_fields'] = opts['opt_fields'];
63
+ }
64
+ {{/vendorExtensions.x-codegen-isCreateAttachmentForObject}}
65
+ {{^vendorExtensions.x-codegen-isCreateAttachmentForObject}}
60
66
  queryParams = opts;
67
+ {{/vendorExtensions.x-codegen-isCreateAttachmentForObject}}
61
68
  {{/hasOptionalParams}}
62
69
  {{#queryParams}}{{#required}}
63
70
  queryParams['{{baseName}}'] = {{paramName}};
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@babel/cli": "^7.0.0",
20
- "superagent": "^5.3.0"
20
+ "superagent": "^6.1.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/core": "^7.0.0",
package/dist/ApiClient.js CHANGED
@@ -28,7 +28,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
28
28
  */
29
29
  /**
30
30
  * @module ApiClient
31
- * @version 3.1.0
31
+ * @version 3.1.2
32
32
  */
33
33
  /**
34
34
  * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
@@ -198,6 +198,11 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
198
198
  }
199
199
  }
200
200
 
201
+ // For ES modules, check for ReadStream using duck typing
202
+ if (param && typeof param.pipe === 'function' && typeof param.read === 'function' && param.readable === true) {
203
+ return true;
204
+ }
205
+
201
206
  // Buffer in Node.js
202
207
  if (typeof Buffer === 'function' && param instanceof Buffer) {
203
208
  return true;
@@ -400,14 +405,14 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
400
405
  // set header parameters
401
406
  if (typeof navigator === 'undefined' || typeof window === 'undefined') {
402
407
  headerParams['X-Asana-Client-Lib'] = new URLSearchParams({
403
- 'version': "3.1.0",
408
+ 'version': "3.1.2",
404
409
  'language': 'NodeJS',
405
410
  'language_version': process.version,
406
411
  'os': process.platform
407
412
  }).toString();
408
413
  } else {
409
414
  headerParams['X-Asana-Client-Lib'] = new URLSearchParams({
410
- 'version': "3.1.0",
415
+ 'version': "3.1.2",
411
416
  'language': 'BrowserJS'
412
417
  }).toString();
413
418
  }
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AccessRequestsApi = void 0;
7
+ var _ApiClient = require("../ApiClient");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
14
+ * Asana
15
+ * This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).
16
+ *
17
+ * OpenAPI spec version: 1.0
18
+ *
19
+ * NOTE: This class is auto generated by the swagger code generator program.
20
+ * https://github.com/swagger-api/swagger-codegen.git
21
+ *
22
+ * Swagger Codegen version: 3.0.54
23
+ *
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ var Collection = require('../utils/collection');
28
+
29
+ /**
30
+ * AccessRequests service.
31
+ * @module api/AccessRequestsApi
32
+ * @version 3.1.2
33
+ */
34
+ var AccessRequestsApi = exports.AccessRequestsApi = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new AccessRequestsApi.
37
+ * @alias module:api/AccessRequestsApi
38
+ * @class
39
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
40
+ * default to {@link module:ApiClient#instanc
41
+ e} if unspecified.
42
+ */
43
+ function AccessRequestsApi(apiClient) {
44
+ _classCallCheck(this, AccessRequestsApi);
45
+ this.apiClient = apiClient || _ApiClient.ApiClient.instance;
46
+ }
47
+
48
+ /**
49
+ * Approve an access request
50
+ * Approves an access request for a target object.
51
+ * @param {String} access_request_gid Globally unique identifier for the access request.
52
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response
53
+ */
54
+ return _createClass(AccessRequestsApi, [{
55
+ key: "approveAccessRequestWithHttpInfo",
56
+ value: function approveAccessRequestWithHttpInfo(access_request_gid) {
57
+ var postBody = null;
58
+ // verify the required parameter 'access_request_gid' is set
59
+ if (access_request_gid === undefined || access_request_gid === null) {
60
+ throw new Error("Missing the required parameter 'access_request_gid' when calling approveAccessRequest");
61
+ }
62
+ var pathParams = {
63
+ 'access_request_gid': access_request_gid
64
+ };
65
+ var queryParams = {};
66
+ var headerParams = {};
67
+ var formParams = {};
68
+ var authNames = ['personalAccessToken'];
69
+ var contentTypes = [];
70
+ var accepts = ['application/json; charset=UTF-8'];
71
+ var returnType = 'Blob';
72
+ return this.apiClient.callApi('/access_requests/{access_request_gid}/approve', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
73
+ }
74
+
75
+ /**
76
+ * Approve an access request
77
+ * Approves an access request for a target object.
78
+ * @param {<&vendorExtensions.x-jsdoc-type>} access_request_gid Globally unique identifier for the access request.
79
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmptyResponseData}
80
+ */
81
+ }, {
82
+ key: "approveAccessRequest",
83
+ value: function approveAccessRequest(access_request_gid) {
84
+ return this.approveAccessRequestWithHttpInfo(access_request_gid).then(function (response_and_data) {
85
+ return response_and_data.data;
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Create an access request
91
+ * Submits a new access request for a private object. Currently supports projects and portfolios.
92
+ * @param {module:model/Object} body
93
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response
94
+ */
95
+ }, {
96
+ key: "createAccessRequestWithHttpInfo",
97
+ value: function createAccessRequestWithHttpInfo(body) {
98
+ var postBody = body;
99
+ // verify the required parameter 'body' is set
100
+ if (body === undefined || body === null) {
101
+ throw new Error("Missing the required parameter 'body' when calling createAccessRequest");
102
+ }
103
+ var pathParams = {};
104
+ var queryParams = {};
105
+ var headerParams = {};
106
+ var formParams = {};
107
+ var authNames = ['personalAccessToken'];
108
+ var contentTypes = ['application/json; charset=UTF-8'];
109
+ var accepts = ['application/json; charset=UTF-8'];
110
+ var returnType = 'Blob';
111
+ return this.apiClient.callApi('/access_requests', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
112
+ }
113
+
114
+ /**
115
+ * Create an access request
116
+ * Submits a new access request for a private object. Currently supports projects and portfolios.
117
+ * @param {<&vendorExtensions.x-jsdoc-type>} body
118
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AccessRequestResponseData}
119
+ */
120
+ }, {
121
+ key: "createAccessRequest",
122
+ value: function createAccessRequest(body) {
123
+ return this.createAccessRequestWithHttpInfo(body).then(function (response_and_data) {
124
+ return response_and_data.data;
125
+ });
126
+ }
127
+
128
+ /**
129
+ * Get access requests
130
+ * Returns the pending access requests for a target object or a target object filtered by user.
131
+ * @param {String} target Globally unique identifier for the target object.
132
+ * @param {Object} opts Optional parameters
133
+ * @param {String} opts.user A string identifying a user. This can either be the string \&quot;me\&quot;, an email, or the gid of a user.
134
+ * @param {Array.<module:model/String>} opts.opt_fields This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
135
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response
136
+ */
137
+ }, {
138
+ key: "getAccessRequestsWithHttpInfo",
139
+ value: function getAccessRequestsWithHttpInfo(target, opts) {
140
+ opts = opts || {};
141
+ var postBody = null;
142
+ // verify the required parameter 'target' is set
143
+ if (target === undefined || target === null) {
144
+ throw new Error("Missing the required parameter 'target' when calling getAccessRequests");
145
+ }
146
+ var pathParams = {};
147
+ var queryParams = {};
148
+ opts = opts || {};
149
+ queryParams = opts;
150
+ queryParams['target'] = target;
151
+ var headerParams = {};
152
+ var formParams = {};
153
+ var authNames = ['personalAccessToken'];
154
+ var contentTypes = [];
155
+ var accepts = ['application/json; charset=UTF-8'];
156
+ var returnType = 'Blob';
157
+ // Check if RETURN_COLLECTION is set and return a collection object if it is
158
+ if (this.apiClient.RETURN_COLLECTION) {
159
+ return Collection.fromApiClient(this.apiClient.callApi('/access_requests', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType), this.apiClient, {
160
+ 'path': '/access_requests',
161
+ 'httpMethod': 'GET',
162
+ 'pathParams': pathParams,
163
+ 'queryParams': queryParams,
164
+ 'headerParams': headerParams,
165
+ 'formParams': formParams,
166
+ 'bodyParam': postBody,
167
+ 'authNames': authNames,
168
+ 'contentTypes': contentTypes,
169
+ 'accepts': accepts,
170
+ 'returnType': returnType
171
+ });
172
+ }
173
+ return this.apiClient.callApi('/access_requests', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
174
+ }
175
+
176
+ /**
177
+ * Get access requests
178
+ * Returns the pending access requests for a target object or a target object filtered by user.
179
+ * @param {<&vendorExtensions.x-jsdoc-type>} target Globally unique identifier for the target object.
180
+ * @param {Object} opts Optional parameters
181
+ * @param {String} opts.user A string identifying a user. This can either be the string \&quot;me\&quot;, an email, or the gid of a user.
182
+ * @param {Array.<module:model/String>} opts.opt_fields This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
183
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AccessRequestResponseArray}
184
+ */
185
+ }, {
186
+ key: "getAccessRequests",
187
+ value: function getAccessRequests(target, opts) {
188
+ // Check if RETURN_COLLECTION is set and return a collection object if it is
189
+ if (this.apiClient.RETURN_COLLECTION) {
190
+ return this.getAccessRequestsWithHttpInfo(target, opts);
191
+ }
192
+ return this.getAccessRequestsWithHttpInfo(target, opts).then(function (response_and_data) {
193
+ return response_and_data.data;
194
+ });
195
+ }
196
+
197
+ /**
198
+ * Reject an access request
199
+ * Rejects an access request for a target object.
200
+ * @param {String} access_request_gid Globally unique identifier for the access request.
201
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response
202
+ */
203
+ }, {
204
+ key: "rejectAccessRequestWithHttpInfo",
205
+ value: function rejectAccessRequestWithHttpInfo(access_request_gid) {
206
+ var postBody = null;
207
+ // verify the required parameter 'access_request_gid' is set
208
+ if (access_request_gid === undefined || access_request_gid === null) {
209
+ throw new Error("Missing the required parameter 'access_request_gid' when calling rejectAccessRequest");
210
+ }
211
+ var pathParams = {
212
+ 'access_request_gid': access_request_gid
213
+ };
214
+ var queryParams = {};
215
+ var headerParams = {};
216
+ var formParams = {};
217
+ var authNames = ['personalAccessToken'];
218
+ var contentTypes = [];
219
+ var accepts = ['application/json; charset=UTF-8'];
220
+ var returnType = 'Blob';
221
+ return this.apiClient.callApi('/access_requests/{access_request_gid}/reject', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
222
+ }
223
+
224
+ /**
225
+ * Reject an access request
226
+ * Rejects an access request for a target object.
227
+ * @param {<&vendorExtensions.x-jsdoc-type>} access_request_gid Globally unique identifier for the access request.
228
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmptyResponseData}
229
+ */
230
+ }, {
231
+ key: "rejectAccessRequest",
232
+ value: function rejectAccessRequest(access_request_gid) {
233
+ return this.rejectAccessRequestWithHttpInfo(access_request_gid).then(function (response_and_data) {
234
+ return response_and_data.data;
235
+ });
236
+ }
237
+ }]);
238
+ }();
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * Allocations service.
31
31
  * @module api/AllocationsApi
32
- * @version 3.1.0
32
+ * @version 3.1.2
33
33
  */
34
34
  var AllocationsApi = exports.AllocationsApi = /*#__PURE__*/function () {
35
35
  /**
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * Attachments service.
31
31
  * @module api/AttachmentsApi
32
- * @version 3.1.0
32
+ * @version 3.1.2
33
33
  */
34
34
  var AttachmentsApi = exports.AttachmentsApi = /*#__PURE__*/function () {
35
35
  /**
@@ -66,7 +66,9 @@ var AttachmentsApi = exports.AttachmentsApi = /*#__PURE__*/function () {
66
66
  var pathParams = {};
67
67
  var queryParams = {};
68
68
  opts = opts || {};
69
- queryParams = opts;
69
+ if (opts['opt_fields']) {
70
+ queryParams['opt_fields'] = opts['opt_fields'];
71
+ }
70
72
  var headerParams = {};
71
73
  var formParams = {
72
74
  'resource_subtype': opts['resource_subtype'],
@@ -106,7 +108,7 @@ var AttachmentsApi = exports.AttachmentsApi = /*#__PURE__*/function () {
106
108
 
107
109
  /**
108
110
  * Delete an attachment
109
- * Deletes a specific, existing attachment. Returns an empty data record.
111
+ * &lt;b&gt;Required scope: &lt;/b&gt;&lt;code&gt;attachments:delete&lt;/code&gt; Deletes a specific, existing attachment. Returns an empty data record.
110
112
  * @param {String} attachment_gid Globally unique identifier for the attachment.
111
113
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data and HTTP response
112
114
  */
@@ -133,7 +135,7 @@ var AttachmentsApi = exports.AttachmentsApi = /*#__PURE__*/function () {
133
135
 
134
136
  /**
135
137
  * Delete an attachment
136
- * Deletes a specific, existing attachment. Returns an empty data record.
138
+ * &lt;b&gt;Required scope: &lt;/b&gt;&lt;code&gt;attachments:delete&lt;/code&gt; Deletes a specific, existing attachment. Returns an empty data record.
137
139
  * @param {<&vendorExtensions.x-jsdoc-type>} attachment_gid Globally unique identifier for the attachment.
138
140
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EmptyResponseData}
139
141
  */
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * AuditLogAPI service.
31
31
  * @module api/AuditLogAPIApi
32
- * @version 3.1.0
32
+ * @version 3.1.2
33
33
  */
34
34
  var AuditLogAPIApi = exports.AuditLogAPIApi = /*#__PURE__*/function () {
35
35
  /**
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * BatchAPI service.
31
31
  * @module api/BatchAPIApi
32
- * @version 3.1.0
32
+ * @version 3.1.2
33
33
  */
34
34
  var BatchAPIApi = exports.BatchAPIApi = /*#__PURE__*/function () {
35
35
  /**
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * CustomFieldSettings service.
31
31
  * @module api/CustomFieldSettingsApi
32
- * @version 3.1.0
32
+ * @version 3.1.2
33
33
  */
34
34
  var CustomFieldSettingsApi = exports.CustomFieldSettingsApi = /*#__PURE__*/function () {
35
35
  /**