asana 3.1.3 → 3.1.5

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 (92) hide show
  1. package/README.md +63 -76
  2. package/codegen/templates/README.mustache +15 -16
  3. package/codegen/templates/code_sample.mustache +1 -1
  4. package/codegen/templates/code_sample_client.mustache +2 -3
  5. package/dist/ApiClient.js +3 -3
  6. package/dist/api/AccessRequestsApi.js +1 -1
  7. package/dist/api/AllocationsApi.js +1 -1
  8. package/dist/api/AttachmentsApi.js +1 -1
  9. package/dist/api/AuditLogAPIApi.js +1 -1
  10. package/dist/api/BatchAPIApi.js +1 -1
  11. package/dist/api/BudgetsApi.js +1 -1
  12. package/dist/api/CustomFieldSettingsApi.js +144 -4
  13. package/dist/api/CustomFieldsApi.js +1 -1
  14. package/dist/api/CustomTypesApi.js +1 -1
  15. package/dist/api/EventsApi.js +1 -1
  16. package/dist/api/ExportsApi.js +1 -1
  17. package/dist/api/GoalRelationshipsApi.js +1 -1
  18. package/dist/api/GoalsApi.js +100 -6
  19. package/dist/api/JobsApi.js +1 -1
  20. package/dist/api/MembershipsApi.js +1 -1
  21. package/dist/api/OrganizationExportsApi.js +1 -1
  22. package/dist/api/PortfolioMembershipsApi.js +1 -1
  23. package/dist/api/PortfoliosApi.js +1 -1
  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/RatesApi.js +1 -1
  30. package/dist/api/ReactionsApi.js +1 -1
  31. package/dist/api/RulesApi.js +1 -1
  32. package/dist/api/SectionsApi.js +1 -1
  33. package/dist/api/StatusUpdatesApi.js +1 -1
  34. package/dist/api/StoriesApi.js +1 -1
  35. package/dist/api/TagsApi.js +1 -1
  36. package/dist/api/TaskTemplatesApi.js +1 -1
  37. package/dist/api/TasksApi.js +1 -1
  38. package/dist/api/TeamMembershipsApi.js +1 -1
  39. package/dist/api/TeamsApi.js +1 -1
  40. package/dist/api/TimePeriodsApi.js +1 -1
  41. package/dist/api/TimeTrackingEntriesApi.js +7 -3
  42. package/dist/api/TypeaheadApi.js +1 -1
  43. package/dist/api/UserTaskListsApi.js +1 -1
  44. package/dist/api/UsersApi.js +175 -1
  45. package/dist/api/WebhooksApi.js +1 -1
  46. package/dist/api/WorkspaceMembershipsApi.js +1 -1
  47. package/dist/api/WorkspacesApi.js +1 -1
  48. package/package.json +1 -1
  49. package/src/ApiClient.js +3 -3
  50. package/src/api/AccessRequestsApi.js +1 -1
  51. package/src/api/AllocationsApi.js +1 -1
  52. package/src/api/AttachmentsApi.js +1 -1
  53. package/src/api/AuditLogAPIApi.js +1 -1
  54. package/src/api/BatchAPIApi.js +1 -1
  55. package/src/api/BudgetsApi.js +1 -1
  56. package/src/api/CustomFieldSettingsApi.js +179 -1
  57. package/src/api/CustomFieldsApi.js +1 -1
  58. package/src/api/CustomTypesApi.js +1 -1
  59. package/src/api/EventsApi.js +1 -1
  60. package/src/api/ExportsApi.js +1 -1
  61. package/src/api/GoalRelationshipsApi.js +1 -1
  62. package/src/api/GoalsApi.js +119 -1
  63. package/src/api/JobsApi.js +1 -1
  64. package/src/api/MembershipsApi.js +1 -1
  65. package/src/api/OrganizationExportsApi.js +1 -1
  66. package/src/api/PortfolioMembershipsApi.js +1 -1
  67. package/src/api/PortfoliosApi.js +1 -1
  68. package/src/api/ProjectBriefsApi.js +1 -1
  69. package/src/api/ProjectMembershipsApi.js +1 -1
  70. package/src/api/ProjectStatusesApi.js +1 -1
  71. package/src/api/ProjectTemplatesApi.js +1 -1
  72. package/src/api/ProjectsApi.js +1 -1
  73. package/src/api/RatesApi.js +1 -1
  74. package/src/api/ReactionsApi.js +1 -1
  75. package/src/api/RulesApi.js +1 -1
  76. package/src/api/SectionsApi.js +1 -1
  77. package/src/api/StatusUpdatesApi.js +1 -1
  78. package/src/api/StoriesApi.js +1 -1
  79. package/src/api/TagsApi.js +1 -1
  80. package/src/api/TaskTemplatesApi.js +1 -1
  81. package/src/api/TasksApi.js +1 -1
  82. package/src/api/TeamMembershipsApi.js +1 -1
  83. package/src/api/TeamsApi.js +1 -1
  84. package/src/api/TimePeriodsApi.js +1 -1
  85. package/src/api/TimeTrackingEntriesApi.js +7 -3
  86. package/src/api/TypeaheadApi.js +1 -1
  87. package/src/api/UserTaskListsApi.js +1 -1
  88. package/src/api/UsersApi.js +206 -1
  89. package/src/api/WebhooksApi.js +1 -1
  90. package/src/api/WorkspaceMembershipsApi.js +1 -1
  91. package/src/api/WorkspacesApi.js +1 -1
  92. package/src/index.js +1 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
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.3
4
+ - Package version: 3.1.5
5
5
 
6
6
  ## Installation
7
7
 
@@ -18,18 +18,17 @@ 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.3/asana-min.js"></script>
21
+ <script src="https://github.com/Asana/node-asana/releases/download/v3.1.5/asana-min.js"></script>
22
22
  ```
23
23
 
24
24
  Example usage (**NOTE**: be careful not to expose your access token):
25
25
 
26
26
  ```html
27
27
  <script>
28
- let client = Asana.ApiClient.instance;
29
- let token = client.authentications['token'];
30
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
28
+ let client = new Asana.ApiClient();
29
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
31
30
 
32
- let usersApiInstance = new Asana.UsersApi();
31
+ let usersApiInstance = new Asana.UsersApi(client);
33
32
  let user_gid = "me";
34
33
  let opts = {};
35
34
 
@@ -66,11 +65,10 @@ Please follow the [installation](#installation) instruction and execute the foll
66
65
  ```javascript
67
66
  const Asana = require('asana');
68
67
 
69
- let client = Asana.ApiClient.instance;
70
- let token = client.authentications['token'];
71
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
68
+ let client = new Asana.ApiClient();
69
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
72
70
 
73
- let usersApiInstance = new Asana.UsersApi();
71
+ let usersApiInstance = new Asana.UsersApi(client);
74
72
  let user_gid = "me"; // String | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
75
73
  let opts = {
76
74
  "opt_fields": "email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name" // [String] | This endpoint returns a compact 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.
@@ -89,11 +87,10 @@ usersApiInstance.getUser(user_gid, opts).then((result) => {
89
87
  ```javascript
90
88
  const Asana = require('asana');
91
89
 
92
- let client = Asana.ApiClient.instance;
93
- let token = client.authentications['token'];
94
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
90
+ let client = new Asana.ApiClient();
91
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
95
92
 
96
- let tasksApiInstance = new Asana.TasksApi();
93
+ let tasksApiInstance = new Asana.TasksApi(client);
97
94
  let opts = {
98
95
  "limit": 50, // Number | Results per page. The number of objects to return per page. The value must be between 1 and 100.
99
96
  "project": "<YOUR_PROJECT_GID>", // String | The project to filter tasks on.
@@ -113,11 +110,10 @@ tasksApiInstance.getTasks(opts).then((result) => {
113
110
  ```javascript
114
111
  const Asana = require('asana');
115
112
 
116
- let client = Asana.ApiClient.instance;
117
- let token = client.authentications['token'];
118
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
113
+ let client = new Asana.ApiClient();
114
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
119
115
 
120
- let tasksApiInstance = new Asana.TasksApi();
116
+ let tasksApiInstance = new Asana.TasksApi(client);
121
117
  let body = {
122
118
  "data": {
123
119
  "name": "New Task",
@@ -149,11 +145,10 @@ tasksApiInstance.createTask(body, opts).then((result) => {
149
145
  ```javascript
150
146
  const Asana = require('asana');
151
147
 
152
- let client = Asana.ApiClient.instance;
153
- let token = client.authentications['token'];
154
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
148
+ let client = new Asana.ApiClient();
149
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
155
150
 
156
- let tasksApiInstance = new Asana.TasksApi();
151
+ let tasksApiInstance = new Asana.TasksApi(client);
157
152
  let task_gid = "<YOUR_TASK_GID>";
158
153
  let body = {
159
154
  "data": {
@@ -174,11 +169,10 @@ tasksApiInstance.updateTask(body, task_gid, opts).then((result) => {
174
169
  ```javascript
175
170
  const Asana = require('asana');
176
171
 
177
- let client = Asana.ApiClient.instance;
178
- let token = client.authentications['token'];
179
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
172
+ let client = new Asana.ApiClient();
173
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
180
174
 
181
- let tasksApiInstance = new Asana.TasksApi();
175
+ let tasksApiInstance = new Asana.TasksApi(client);
182
176
  let task_gid = "<YOUR_TASK_GID>";
183
177
 
184
178
  // DELETE - Delete a task
@@ -215,8 +209,10 @@ Class | Method | HTTP request | Description
215
209
  *Asana.BudgetsApi* | [**getBudget**](docs/BudgetsApi.md#getBudget) | **GET** /budgets/{budget_gid} | Get a budget
216
210
  *Asana.BudgetsApi* | [**getBudgets**](docs/BudgetsApi.md#getBudgets) | **GET** /budgets | Get all budgets
217
211
  *Asana.BudgetsApi* | [**updateBudget**](docs/BudgetsApi.md#updateBudget) | **PUT** /budgets/{budget_gid} | Update a budget
212
+ *Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForGoal**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForGoal) | **GET** /goals/{goal_gid}/custom_field_settings | Get a goal&#x27;s custom fields
218
213
  *Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForPortfolio**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForPortfolio) | **GET** /portfolios/{portfolio_gid}/custom_field_settings | Get a portfolio&#x27;s custom fields
219
214
  *Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForProject**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForProject) | **GET** /projects/{project_gid}/custom_field_settings | Get a project&#x27;s custom fields
215
+ *Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForTeam**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForTeam) | **GET** /teams/{team_gid}/custom_field_settings | Get a team&#x27;s custom fields
220
216
  *Asana.CustomFieldsApi* | [**createCustomField**](docs/CustomFieldsApi.md#createCustomField) | **POST** /custom_fields | Create a custom field
221
217
  *Asana.CustomFieldsApi* | [**createEnumOptionForCustomField**](docs/CustomFieldsApi.md#createEnumOptionForCustomField) | **POST** /custom_fields/{custom_field_gid}/enum_options | Create an enum option
222
218
  *Asana.CustomFieldsApi* | [**deleteCustomField**](docs/CustomFieldsApi.md#deleteCustomField) | **DELETE** /custom_fields/{custom_field_gid} | Delete a custom field
@@ -235,6 +231,7 @@ Class | Method | HTTP request | Description
235
231
  *Asana.GoalRelationshipsApi* | [**getGoalRelationships**](docs/GoalRelationshipsApi.md#getGoalRelationships) | **GET** /goal_relationships | Get goal relationships
236
232
  *Asana.GoalRelationshipsApi* | [**removeSupportingRelationship**](docs/GoalRelationshipsApi.md#removeSupportingRelationship) | **POST** /goals/{goal_gid}/removeSupportingRelationship | Removes a supporting goal relationship
237
233
  *Asana.GoalRelationshipsApi* | [**updateGoalRelationship**](docs/GoalRelationshipsApi.md#updateGoalRelationship) | **PUT** /goal_relationships/{goal_relationship_gid} | Update a goal relationship
234
+ *Asana.GoalsApi* | [**addCustomFieldSettingForGoal**](docs/GoalsApi.md#addCustomFieldSettingForGoal) | **POST** /goals/{goal_gid}/addCustomFieldSetting | Add a custom field to a goal
238
235
  *Asana.GoalsApi* | [**addFollowers**](docs/GoalsApi.md#addFollowers) | **POST** /goals/{goal_gid}/addFollowers | Add a collaborator to a goal
239
236
  *Asana.GoalsApi* | [**createGoal**](docs/GoalsApi.md#createGoal) | **POST** /goals | Create a goal
240
237
  *Asana.GoalsApi* | [**createGoalMetric**](docs/GoalsApi.md#createGoalMetric) | **POST** /goals/{goal_gid}/setMetric | Create a goal metric
@@ -242,6 +239,7 @@ Class | Method | HTTP request | Description
242
239
  *Asana.GoalsApi* | [**getGoal**](docs/GoalsApi.md#getGoal) | **GET** /goals/{goal_gid} | Get a goal
243
240
  *Asana.GoalsApi* | [**getGoals**](docs/GoalsApi.md#getGoals) | **GET** /goals | Get goals
244
241
  *Asana.GoalsApi* | [**getParentGoalsForGoal**](docs/GoalsApi.md#getParentGoalsForGoal) | **GET** /goals/{goal_gid}/parentGoals | Get parent goals from a goal
242
+ *Asana.GoalsApi* | [**removeCustomFieldSettingForGoal**](docs/GoalsApi.md#removeCustomFieldSettingForGoal) | **POST** /goals/{goal_gid}/removeCustomFieldSetting | Remove a custom field from a goal
245
243
  *Asana.GoalsApi* | [**removeFollowers**](docs/GoalsApi.md#removeFollowers) | **POST** /goals/{goal_gid}/removeFollowers | Remove a collaborator from a goal
246
244
  *Asana.GoalsApi* | [**updateGoal**](docs/GoalsApi.md#updateGoal) | **PUT** /goals/{goal_gid} | Update a goal
247
245
  *Asana.GoalsApi* | [**updateGoalMetric**](docs/GoalsApi.md#updateGoalMetric) | **POST** /goals/{goal_gid}/setMetricCurrentValue | Update a goal metric
@@ -388,9 +386,12 @@ Class | Method | HTTP request | Description
388
386
  *Asana.UserTaskListsApi* | [**getUserTaskListForUser**](docs/UserTaskListsApi.md#getUserTaskListForUser) | **GET** /users/{user_gid}/user_task_list | Get a user&#x27;s task list
389
387
  *Asana.UsersApi* | [**getFavoritesForUser**](docs/UsersApi.md#getFavoritesForUser) | **GET** /users/{user_gid}/favorites | Get a user&#x27;s favorites
390
388
  *Asana.UsersApi* | [**getUser**](docs/UsersApi.md#getUser) | **GET** /users/{user_gid} | Get a user
389
+ *Asana.UsersApi* | [**getUserForWorkspace**](docs/UsersApi.md#getUserForWorkspace) | **GET** /workspaces/{workspace_gid}/users/{user_gid} | Get a user in a workspace or organization
391
390
  *Asana.UsersApi* | [**getUsers**](docs/UsersApi.md#getUsers) | **GET** /users | Get multiple users
392
391
  *Asana.UsersApi* | [**getUsersForTeam**](docs/UsersApi.md#getUsersForTeam) | **GET** /teams/{team_gid}/users | Get users in a team
393
392
  *Asana.UsersApi* | [**getUsersForWorkspace**](docs/UsersApi.md#getUsersForWorkspace) | **GET** /workspaces/{workspace_gid}/users | Get users in a workspace or organization
393
+ *Asana.UsersApi* | [**updateUser**](docs/UsersApi.md#updateUser) | **PUT** /users/{user_gid} | Update a user
394
+ *Asana.UsersApi* | [**updateUserForWorkspace**](docs/UsersApi.md#updateUserForWorkspace) | **PUT** /workspaces/{workspace_gid}/users/{user_gid} | Update a user in a workspace or organization
394
395
  *Asana.WebhooksApi* | [**createWebhook**](docs/WebhooksApi.md#createWebhook) | **POST** /webhooks | Establish a webhook
395
396
  *Asana.WebhooksApi* | [**deleteWebhook**](docs/WebhooksApi.md#deleteWebhook) | **DELETE** /webhooks/{webhook_gid} | Delete a webhook
396
397
  *Asana.WebhooksApi* | [**getWebhook**](docs/WebhooksApi.md#getWebhook) | **GET** /webhooks/{webhook_gid} | Get a webhook
@@ -418,11 +419,10 @@ Our `opt_fields` feature allows you to request for properties of a resource that
418
419
  ```javascript
419
420
  const Asana = require('asana');
420
421
 
421
- let client = Asana.ApiClient.instance;
422
- let token = client.authentications['token'];
423
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
422
+ let client = new Asana.ApiClient();
423
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
424
424
 
425
- let tasksApiInstance = new Asana.TasksApi();
425
+ let tasksApiInstance = new Asana.TasksApi(client);
426
426
  let opts = {
427
427
  "limit": 2,
428
428
  "project": "<YOUR_PROJECT_GID>"
@@ -460,11 +460,10 @@ tasksApiInstance.getTasks(opts).then((result) => {
460
460
  ```javascript
461
461
  const Asana = require('asana');
462
462
 
463
- let client = Asana.ApiClient.instance;
464
- let token = client.authentications['token'];
465
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
463
+ let client = new Asana.ApiClient();
464
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
466
465
 
467
- let tasksApiInstance = new Asana.TasksApi();
466
+ let tasksApiInstance = new Asana.TasksApi(client);
468
467
  let opts = {
469
468
  "limit": 1,
470
469
  "project": "<YOUR_PROJECT_GID>",
@@ -609,11 +608,10 @@ EX: Pagination gather all resources
609
608
  ```javascript
610
609
  const Asana = require('asana');
611
610
 
612
- let client = Asana.ApiClient.instance;
613
- let token = client.authentications['token'];
614
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
611
+ let client = new Asana.ApiClient();
612
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
615
613
 
616
- let tasksApiInstance = new Asana.TasksApi();
614
+ let tasksApiInstance = new Asana.TasksApi(client);
617
615
  let opts = {
618
616
  "project": "<YOUR_PROJECT_GID>",
619
617
  "limit": 100,
@@ -721,11 +719,10 @@ EX: Pagination do something per page
721
719
  ```javascript
722
720
  const Asana = require('asana');
723
721
 
724
- let client = Asana.ApiClient.instance;
725
- let token = client.authentications['token'];
726
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
722
+ let client = new Asana.ApiClient();
723
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
727
724
 
728
- let tasksApiInstance = new Asana.TasksApi();
725
+ let tasksApiInstance = new Asana.TasksApi(client);
729
726
  let opts = {
730
727
  'project': "<YOUR_PROJECT_GID>",
731
728
  "limit": 5,
@@ -787,14 +784,13 @@ EX: Turning off pagination
787
784
  ```javascript
788
785
  const Asana = require('asana');
789
786
 
790
- let client = Asana.ApiClient.instance;
791
- let token = client.authentications['token'];
792
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
787
+ let client = new Asana.ApiClient();
788
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
793
789
 
794
790
  // Turn off pagination
795
791
  client.RETURN_COLLECTION = false;
796
792
 
797
- let tasksApiInstance = new Asana.TasksApi();
793
+ let tasksApiInstance = new Asana.TasksApi(client);
798
794
  let opts = {
799
795
  'project': "<YOUR_PROJECT_GID>",
800
796
  'limit': 1
@@ -831,11 +827,10 @@ request to [getEvents](docs/EventsApi.md#getEvents).
831
827
  ```javascript
832
828
  const Asana = require('asana');
833
829
 
834
- let client = Asana.ApiClient.instance;
835
- let token = client.authentications['token'];
836
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
830
+ let client = new Asana.ApiClient();
831
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
837
832
 
838
- let eventsApiInstance = new Asana.EventsApi();
833
+ let eventsApiInstance = new Asana.EventsApi(client);
839
834
  let resource = "<YOUR_TASK_OR_PROJECT_GID>"; // String | A resource ID to subscribe to. The resource can be a task or project.
840
835
  let opts = {
841
836
  "sync": ""
@@ -903,11 +898,10 @@ Use the `<METHOD_NAME>WithHttpInfo` (EX: `getTaskWithHttpInfo`) method to make a
903
898
  ```javascript
904
899
  const Asana = require('asana');
905
900
 
906
- let client = Asana.ApiClient.instance;
907
- let token = client.authentications['token'];
908
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
901
+ let client = new Asana.ApiClient();
902
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
909
903
 
910
- let tasksApiInstance = new Asana.TasksApi();
904
+ let tasksApiInstance = new Asana.TasksApi(client);
911
905
  let task_gid = "<YOUR_TASK_GID>";
912
906
  let opts = {};
913
907
 
@@ -929,9 +923,8 @@ EX: Asana-Enable header
929
923
  ```javascript
930
924
  const Asana = require('asana');
931
925
 
932
- let client = Asana.ApiClient.instance;
933
- let token = client.authentications['token'];
934
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
926
+ let client = new Asana.ApiClient();
927
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
935
928
 
936
929
  // Add asana-enable header for the client
937
930
  client.defaultHeaders['asana-enable'] = 'new_goal_memberships';
@@ -941,9 +934,8 @@ EX: Asana-Disable header
941
934
  ```javascript
942
935
  const Asana = require('asana');
943
936
 
944
- let client = Asana.ApiClient.instance;
945
- let token = client.authentications['token'];
946
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
937
+ let client = new Asana.ApiClient();
938
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
947
939
 
948
940
  // Add asana-disable header for the client
949
941
  client.defaultHeaders['asana-disable'] = 'new_goal_memberships';
@@ -959,9 +951,8 @@ Use the `callApi` method to make http calls when the endpoint does not exist in
959
951
  ```javascript
960
952
  const Asana = require('asana');
961
953
 
962
- let client = Asana.ApiClient.instance;
963
- let token = client.authentications['token'];
964
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
954
+ let client = new Asana.ApiClient();
955
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
965
956
 
966
957
  // GET - get a task
967
958
  client.callApi(
@@ -989,9 +980,8 @@ client.callApi(
989
980
  ```javascript
990
981
  const Asana = require('asana');
991
982
 
992
- let client = Asana.ApiClient.instance;
993
- let token = client.authentications['token'];
994
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
983
+ let client = new Asana.ApiClient();
984
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
995
985
 
996
986
  // GET - get multiple tasks -> with opt_fields
997
987
  client.callApi(
@@ -1027,9 +1017,8 @@ client.callApi(
1027
1017
  ```javascript
1028
1018
  const Asana = require('asana');
1029
1019
 
1030
- let client = Asana.ApiClient.instance;
1031
- let token = client.authentications['token'];
1032
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
1020
+ let client = new Asana.ApiClient();
1021
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
1033
1022
 
1034
1023
  // POST - create a task
1035
1024
  client.callApi(
@@ -1069,9 +1058,8 @@ client.callApi(
1069
1058
  ```javascript
1070
1059
  const Asana = require('asana');
1071
1060
 
1072
- let client = Asana.ApiClient.instance;
1073
- let token = client.authentications['token'];
1074
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
1061
+ let client = new Asana.ApiClient();
1062
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
1075
1063
 
1076
1064
  // PUT - update a task
1077
1065
  client.callApi(
@@ -1105,9 +1093,8 @@ client.callApi(
1105
1093
  ```javascript
1106
1094
  const Asana = require('asana');
1107
1095
 
1108
- let client = Asana.ApiClient.instance;
1109
- let token = client.authentications['token'];
1110
- token.accessToken = '<YOUR_ACCESS_TOKEN>';
1096
+ let client = new Asana.ApiClient();
1097
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
1111
1098
 
1112
1099
  // DELETE - delete a task
1113
1100
  client.callApi(
@@ -1132,6 +1119,6 @@ client.callApi(
1132
1119
  ```
1133
1120
 
1134
1121
  [release-image]: https://img.shields.io/github/release/asana/node-asana.svg
1135
- [release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.3
1122
+ [release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.5
1136
1123
  [npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
1137
1124
  [npm-url]: https://www.npmjs.org/package/asana
@@ -29,7 +29,7 @@ Example usage (**NOTE**: be careful not to expose your access token):
29
29
  ```html
30
30
  <script>
31
31
  {{#hasAuthMethods}}
32
- let client = {{{moduleName}}}.ApiClient.instance;{{#authMethods}}{{#isBasic}}
32
+ let client = new {{{moduleName}}}.ApiClient();{{#authMethods}}{{#isBasic}}
33
33
  // Configure HTTP basic authorization: {{{name}}}
34
34
  let {{{name}}} = client.authentications['{{{name}}}'];
35
35
  {{{name}}}.username = 'YOUR USERNAME';
@@ -42,12 +42,11 @@ Example usage (**NOTE**: be careful not to expose your access token):
42
42
  // Configure OAuth2 access token for authorization: {{{name}}}
43
43
  let {{{name}}} = client.authentications['{{{name}}}'];
44
44
  {{{name}}}.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isOAuth}}{{#isBearer}}
45
- let token = client.authentications['token'];
46
- token.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isBearer}}
45
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isBearer}}
47
46
  {{/authMethods}}
48
47
  {{/hasAuthMethods}}
49
48
 
50
- let usersApiInstance = new {{{moduleName}}}.UsersApi();
49
+ let usersApiInstance = new {{{moduleName}}}.UsersApi(client);
51
50
  let user_gid = "me";
52
51
  let opts = {};
53
52
 
@@ -84,7 +83,7 @@ Please follow the [installation](#installation) instruction and execute the foll
84
83
  ```javascript
85
84
  {{>code_sample_client}}
86
85
 
87
- let usersApiInstance = new {{{moduleName}}}.UsersApi();
86
+ let usersApiInstance = new {{{moduleName}}}.UsersApi(client);
88
87
  let user_gid = "me"; // String | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
89
88
  let opts = {
90
89
  "opt_fields": "email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name" // [String] | This endpoint returns a compact 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.
@@ -103,7 +102,7 @@ usersApiInstance.getUser(user_gid, opts).then((result) => {
103
102
  ```javascript
104
103
  {{>code_sample_client}}
105
104
 
106
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
105
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
107
106
  let opts = {
108
107
  "limit": 50, // Number | Results per page. The number of objects to return per page. The value must be between 1 and 100.
109
108
  "project": "<YOUR_PROJECT_GID>", // String | The project to filter tasks on.
@@ -123,7 +122,7 @@ tasksApiInstance.getTasks(opts).then((result) => {
123
122
  ```javascript
124
123
  {{>code_sample_client}}
125
124
 
126
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
125
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
127
126
  let body = {
128
127
  "data": {
129
128
  "name": "New Task",
@@ -155,7 +154,7 @@ tasksApiInstance.createTask(body, opts).then((result) => {
155
154
  ```javascript
156
155
  {{>code_sample_client}}
157
156
 
158
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
157
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
159
158
  let task_gid = "<YOUR_TASK_GID>";
160
159
  let body = {
161
160
  "data": {
@@ -176,7 +175,7 @@ tasksApiInstance.updateTask(body, task_gid, opts).then((result) => {
176
175
  ```javascript
177
176
  {{>code_sample_client}}
178
177
 
179
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
178
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
180
179
  let task_gid = "<YOUR_TASK_GID>";
181
180
 
182
181
  // DELETE - Delete a task
@@ -208,7 +207,7 @@ Our `opt_fields` feature allows you to request for properties of a resource that
208
207
  ```javascript
209
208
  {{>code_sample_client}}
210
209
 
211
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
210
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
212
211
  let opts = {
213
212
  "limit": 2,
214
213
  "project": "<YOUR_PROJECT_GID>"
@@ -246,7 +245,7 @@ tasksApiInstance.getTasks(opts).then((result) => {
246
245
  ```javascript
247
246
  {{>code_sample_client}}
248
247
 
249
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
248
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
250
249
  let opts = {
251
250
  "limit": 1,
252
251
  "project": "<YOUR_PROJECT_GID>",
@@ -391,7 +390,7 @@ EX: Pagination gather all resources
391
390
  ```javascript
392
391
  {{>code_sample_client}}
393
392
 
394
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
393
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
395
394
  let opts = {
396
395
  "project": "<YOUR_PROJECT_GID>",
397
396
  "limit": 100,
@@ -499,7 +498,7 @@ EX: Pagination do something per page
499
498
  ```javascript
500
499
  {{>code_sample_client}}
501
500
 
502
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
501
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
503
502
  let opts = {
504
503
  'project': "<YOUR_PROJECT_GID>",
505
504
  "limit": 5,
@@ -564,7 +563,7 @@ EX: Turning off pagination
564
563
  // Turn off pagination
565
564
  client.RETURN_COLLECTION = false;
566
565
 
567
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
566
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
568
567
  let opts = {
569
568
  'project': "<YOUR_PROJECT_GID>",
570
569
  'limit': 1
@@ -601,7 +600,7 @@ request to [getEvents](docs/EventsApi.md#getEvents).
601
600
  ```javascript
602
601
  {{>code_sample_client}}
603
602
 
604
- let eventsApiInstance = new {{{moduleName}}}.EventsApi();
603
+ let eventsApiInstance = new {{{moduleName}}}.EventsApi(client);
605
604
  let resource = "<YOUR_TASK_OR_PROJECT_GID>"; // String | A resource ID to subscribe to. The resource can be a task or project.
606
605
  let opts = {
607
606
  "sync": ""
@@ -669,7 +668,7 @@ Use the `<METHOD_NAME>WithHttpInfo` (EX: `getTaskWithHttpInfo`) method to make a
669
668
  ```javascript
670
669
  {{>code_sample_client}}
671
670
 
672
- let tasksApiInstance = new {{{moduleName}}}.TasksApi();
671
+ let tasksApiInstance = new {{{moduleName}}}.TasksApi(client);
673
672
  let task_gid = "<YOUR_TASK_GID>";
674
673
  let opts = {};
675
674
 
@@ -1,6 +1,6 @@
1
1
  {{>code_sample_client}}
2
2
 
3
- let {{{vendorExtensions.x-codegen-resourceInstanceName}}} = new {{{moduleName}}}.{{{classname}}}();{{#hasParams}}
3
+ let {{{vendorExtensions.x-codegen-resourceInstanceName}}} = new {{{moduleName}}}.{{{classname}}}(client);{{#hasParams}}
4
4
  {{#vendorExtensions.x-codegen-hasRequiredParams}}{{#parameters}}{{#required}}
5
5
  let {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
6
6
  {{/required}}{{/parameters}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}}
@@ -6,7 +6,7 @@ const fs = require("fs");
6
6
  {{/hasParams}}
7
7
 
8
8
  {{#hasAuthMethods}}
9
- let client = {{{moduleName}}}.ApiClient.instance;{{#authMethods}}{{#isBasic}}
9
+ let client = new {{{moduleName}}}.ApiClient();{{#authMethods}}{{#isBasic}}
10
10
  // Configure HTTP basic authorization: {{{name}}}
11
11
  let {{{name}}} = client.authentications['{{{name}}}'];
12
12
  {{{name}}}.username = 'YOUR USERNAME';
@@ -19,7 +19,6 @@ let {{{name}}} = client.authentications['{{{name}}}'];
19
19
  // Configure OAuth2 access token for authorization: {{{name}}}
20
20
  let {{{name}}} = client.authentications['{{{name}}}'];
21
21
  {{{name}}}.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isOAuth}}{{#isBearer}}
22
- let token = client.authentications['token'];
23
- token.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isBearer}}
22
+ client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';{{/isBearer}}
24
23
  {{/authMethods}}
25
24
  {{/hasAuthMethods}}
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.3
31
+ * @version 3.1.5
32
32
  */
33
33
  /**
34
34
  * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
@@ -405,14 +405,14 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
405
405
  // set header parameters
406
406
  if (typeof navigator === 'undefined' || typeof window === 'undefined') {
407
407
  headerParams['X-Asana-Client-Lib'] = new URLSearchParams({
408
- 'version': "3.1.3",
408
+ 'version': "3.1.5",
409
409
  'language': 'NodeJS',
410
410
  'language_version': process.version,
411
411
  'os': process.platform
412
412
  }).toString();
413
413
  } else {
414
414
  headerParams['X-Asana-Client-Lib'] = new URLSearchParams({
415
- 'version': "3.1.3",
415
+ 'version': "3.1.5",
416
416
  'language': 'BrowserJS'
417
417
  }).toString();
418
418
  }
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * AccessRequests service.
31
31
  * @module api/AccessRequestsApi
32
- * @version 3.1.3
32
+ * @version 3.1.5
33
33
  */
34
34
  var AccessRequestsApi = exports.AccessRequestsApi = /*#__PURE__*/function () {
35
35
  /**
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * Allocations service.
31
31
  * @module api/AllocationsApi
32
- * @version 3.1.3
32
+ * @version 3.1.5
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.3
32
+ * @version 3.1.5
33
33
  */
34
34
  var AttachmentsApi = exports.AttachmentsApi = /*#__PURE__*/function () {
35
35
  /**
@@ -29,7 +29,7 @@ var Collection = require('../utils/collection');
29
29
  /**
30
30
  * AuditLogAPI service.
31
31
  * @module api/AuditLogAPIApi
32
- * @version 3.1.3
32
+ * @version 3.1.5
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.3
32
+ * @version 3.1.5
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
  * Budgets service.
31
31
  * @module api/BudgetsApi
32
- * @version 3.1.3
32
+ * @version 3.1.5
33
33
  */
34
34
  var BudgetsApi = exports.BudgetsApi = /*#__PURE__*/function () {
35
35
  /**