asana 3.1.2 → 3.1.4
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.
- package/README.md +58 -60
- package/codegen/templates/code_sample.mustache +1 -1
- package/codegen/templates/code_sample_client.mustache +2 -3
- package/dist/ApiClient.js +3 -3
- package/dist/api/AccessRequestsApi.js +1 -1
- package/dist/api/AllocationsApi.js +1 -1
- package/dist/api/AttachmentsApi.js +1 -1
- package/dist/api/AuditLogAPIApi.js +1 -1
- package/dist/api/BatchAPIApi.js +1 -1
- package/dist/api/BudgetsApi.js +290 -0
- package/dist/api/CustomFieldSettingsApi.js +144 -4
- package/dist/api/CustomFieldsApi.js +1 -1
- package/dist/api/CustomTypesApi.js +1 -1
- package/dist/api/EventsApi.js +1 -1
- package/dist/api/ExportsApi.js +1 -1
- package/dist/api/GoalRelationshipsApi.js +1 -1
- package/dist/api/GoalsApi.js +100 -6
- package/dist/api/JobsApi.js +1 -1
- package/dist/api/MembershipsApi.js +1 -1
- package/dist/api/OrganizationExportsApi.js +1 -1
- package/dist/api/PortfolioMembershipsApi.js +1 -1
- package/dist/api/PortfoliosApi.js +1 -1
- package/dist/api/ProjectBriefsApi.js +1 -1
- package/dist/api/ProjectMembershipsApi.js +1 -1
- package/dist/api/ProjectStatusesApi.js +1 -1
- package/dist/api/ProjectTemplatesApi.js +1 -1
- package/dist/api/ProjectsApi.js +1 -1
- package/dist/api/RatesApi.js +305 -0
- package/dist/api/ReactionsApi.js +1 -1
- package/dist/api/RulesApi.js +1 -1
- package/dist/api/SectionsApi.js +1 -1
- package/dist/api/StatusUpdatesApi.js +1 -1
- package/dist/api/StoriesApi.js +1 -1
- package/dist/api/TagsApi.js +1 -1
- package/dist/api/TaskTemplatesApi.js +1 -1
- package/dist/api/TasksApi.js +3 -3
- package/dist/api/TeamMembershipsApi.js +1 -1
- package/dist/api/TeamsApi.js +1 -1
- package/dist/api/TimePeriodsApi.js +1 -1
- package/dist/api/TimeTrackingEntriesApi.js +13 -9
- package/dist/api/TypeaheadApi.js +1 -1
- package/dist/api/UserTaskListsApi.js +1 -1
- package/dist/api/UsersApi.js +175 -1
- package/dist/api/WebhooksApi.js +1 -1
- package/dist/api/WorkspaceMembershipsApi.js +1 -1
- package/dist/api/WorkspacesApi.js +3 -3
- package/dist/index.js +14 -0
- package/package.json +1 -1
- package/src/ApiClient.js +3 -3
- package/src/api/AccessRequestsApi.js +1 -1
- package/src/api/AllocationsApi.js +1 -1
- package/src/api/AttachmentsApi.js +1 -1
- package/src/api/AuditLogAPIApi.js +1 -1
- package/src/api/BatchAPIApi.js +1 -1
- package/src/api/BudgetsApi.js +350 -0
- package/src/api/CustomFieldSettingsApi.js +179 -1
- package/src/api/CustomFieldsApi.js +1 -1
- package/src/api/CustomTypesApi.js +1 -1
- package/src/api/EventsApi.js +1 -1
- package/src/api/ExportsApi.js +1 -1
- package/src/api/GoalRelationshipsApi.js +1 -1
- package/src/api/GoalsApi.js +119 -1
- package/src/api/JobsApi.js +1 -1
- package/src/api/MembershipsApi.js +1 -1
- package/src/api/OrganizationExportsApi.js +1 -1
- package/src/api/PortfolioMembershipsApi.js +1 -1
- package/src/api/PortfoliosApi.js +1 -1
- package/src/api/ProjectBriefsApi.js +1 -1
- package/src/api/ProjectMembershipsApi.js +1 -1
- package/src/api/ProjectStatusesApi.js +1 -1
- package/src/api/ProjectTemplatesApi.js +1 -1
- package/src/api/ProjectsApi.js +1 -1
- package/src/api/RatesApi.js +363 -0
- package/src/api/ReactionsApi.js +1 -1
- package/src/api/RulesApi.js +1 -1
- package/src/api/SectionsApi.js +1 -1
- package/src/api/StatusUpdatesApi.js +1 -1
- package/src/api/StoriesApi.js +1 -1
- package/src/api/TagsApi.js +1 -1
- package/src/api/TaskTemplatesApi.js +1 -1
- package/src/api/TasksApi.js +3 -3
- package/src/api/TeamMembershipsApi.js +1 -1
- package/src/api/TeamsApi.js +1 -1
- package/src/api/TimePeriodsApi.js +1 -1
- package/src/api/TimeTrackingEntriesApi.js +13 -9
- package/src/api/TypeaheadApi.js +1 -1
- package/src/api/UserTaskListsApi.js +1 -1
- package/src/api/UsersApi.js +206 -1
- package/src/api/WebhooksApi.js +1 -1
- package/src/api/WorkspaceMembershipsApi.js +1 -1
- package/src/api/WorkspacesApi.js +3 -3
- package/src/index.js +15 -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.
|
|
4
|
+
- Package version: 3.1.4
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -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.
|
|
21
|
+
<script src="https://github.com/Asana/node-asana/releases/download/v3.1.4/asana-min.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Example usage (**NOTE**: be careful not to expose your access token):
|
|
@@ -66,9 +66,8 @@ Please follow the [installation](#installation) instruction and execute the foll
|
|
|
66
66
|
```javascript
|
|
67
67
|
const Asana = require('asana');
|
|
68
68
|
|
|
69
|
-
let client = Asana.ApiClient
|
|
70
|
-
|
|
71
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
69
|
+
let client = new Asana.ApiClient();
|
|
70
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
72
71
|
|
|
73
72
|
let usersApiInstance = new Asana.UsersApi();
|
|
74
73
|
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,9 +88,8 @@ usersApiInstance.getUser(user_gid, opts).then((result) => {
|
|
|
89
88
|
```javascript
|
|
90
89
|
const Asana = require('asana');
|
|
91
90
|
|
|
92
|
-
let client = Asana.ApiClient
|
|
93
|
-
|
|
94
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
91
|
+
let client = new Asana.ApiClient();
|
|
92
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
95
93
|
|
|
96
94
|
let tasksApiInstance = new Asana.TasksApi();
|
|
97
95
|
let opts = {
|
|
@@ -113,9 +111,8 @@ tasksApiInstance.getTasks(opts).then((result) => {
|
|
|
113
111
|
```javascript
|
|
114
112
|
const Asana = require('asana');
|
|
115
113
|
|
|
116
|
-
let client = Asana.ApiClient
|
|
117
|
-
|
|
118
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
114
|
+
let client = new Asana.ApiClient();
|
|
115
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
119
116
|
|
|
120
117
|
let tasksApiInstance = new Asana.TasksApi();
|
|
121
118
|
let body = {
|
|
@@ -149,9 +146,8 @@ tasksApiInstance.createTask(body, opts).then((result) => {
|
|
|
149
146
|
```javascript
|
|
150
147
|
const Asana = require('asana');
|
|
151
148
|
|
|
152
|
-
let client = Asana.ApiClient
|
|
153
|
-
|
|
154
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
149
|
+
let client = new Asana.ApiClient();
|
|
150
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
155
151
|
|
|
156
152
|
let tasksApiInstance = new Asana.TasksApi();
|
|
157
153
|
let task_gid = "<YOUR_TASK_GID>";
|
|
@@ -174,9 +170,8 @@ tasksApiInstance.updateTask(body, task_gid, opts).then((result) => {
|
|
|
174
170
|
```javascript
|
|
175
171
|
const Asana = require('asana');
|
|
176
172
|
|
|
177
|
-
let client = Asana.ApiClient
|
|
178
|
-
|
|
179
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
173
|
+
let client = new Asana.ApiClient();
|
|
174
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
180
175
|
|
|
181
176
|
let tasksApiInstance = new Asana.TasksApi();
|
|
182
177
|
let task_gid = "<YOUR_TASK_GID>";
|
|
@@ -210,8 +205,15 @@ Class | Method | HTTP request | Description
|
|
|
210
205
|
*Asana.AttachmentsApi* | [**getAttachmentsForObject**](docs/AttachmentsApi.md#getAttachmentsForObject) | **GET** /attachments | Get attachments from an object
|
|
211
206
|
*Asana.AuditLogAPIApi* | [**getAuditLogEvents**](docs/AuditLogAPIApi.md#getAuditLogEvents) | **GET** /workspaces/{workspace_gid}/audit_log_events | Get audit log events
|
|
212
207
|
*Asana.BatchAPIApi* | [**createBatchRequest**](docs/BatchAPIApi.md#createBatchRequest) | **POST** /batch | Submit parallel requests
|
|
208
|
+
*Asana.BudgetsApi* | [**createBudget**](docs/BudgetsApi.md#createBudget) | **POST** /budgets | Create a budget
|
|
209
|
+
*Asana.BudgetsApi* | [**deleteBudget**](docs/BudgetsApi.md#deleteBudget) | **DELETE** /budgets/{budget_gid} | Delete a budget
|
|
210
|
+
*Asana.BudgetsApi* | [**getBudget**](docs/BudgetsApi.md#getBudget) | **GET** /budgets/{budget_gid} | Get a budget
|
|
211
|
+
*Asana.BudgetsApi* | [**getBudgets**](docs/BudgetsApi.md#getBudgets) | **GET** /budgets | Get all budgets
|
|
212
|
+
*Asana.BudgetsApi* | [**updateBudget**](docs/BudgetsApi.md#updateBudget) | **PUT** /budgets/{budget_gid} | Update a budget
|
|
213
|
+
*Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForGoal**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForGoal) | **GET** /goals/{goal_gid}/custom_field_settings | Get a goal's custom fields
|
|
213
214
|
*Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForPortfolio**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForPortfolio) | **GET** /portfolios/{portfolio_gid}/custom_field_settings | Get a portfolio's custom fields
|
|
214
215
|
*Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForProject**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForProject) | **GET** /projects/{project_gid}/custom_field_settings | Get a project's custom fields
|
|
216
|
+
*Asana.CustomFieldSettingsApi* | [**getCustomFieldSettingsForTeam**](docs/CustomFieldSettingsApi.md#getCustomFieldSettingsForTeam) | **GET** /teams/{team_gid}/custom_field_settings | Get a team's custom fields
|
|
215
217
|
*Asana.CustomFieldsApi* | [**createCustomField**](docs/CustomFieldsApi.md#createCustomField) | **POST** /custom_fields | Create a custom field
|
|
216
218
|
*Asana.CustomFieldsApi* | [**createEnumOptionForCustomField**](docs/CustomFieldsApi.md#createEnumOptionForCustomField) | **POST** /custom_fields/{custom_field_gid}/enum_options | Create an enum option
|
|
217
219
|
*Asana.CustomFieldsApi* | [**deleteCustomField**](docs/CustomFieldsApi.md#deleteCustomField) | **DELETE** /custom_fields/{custom_field_gid} | Delete a custom field
|
|
@@ -230,6 +232,7 @@ Class | Method | HTTP request | Description
|
|
|
230
232
|
*Asana.GoalRelationshipsApi* | [**getGoalRelationships**](docs/GoalRelationshipsApi.md#getGoalRelationships) | **GET** /goal_relationships | Get goal relationships
|
|
231
233
|
*Asana.GoalRelationshipsApi* | [**removeSupportingRelationship**](docs/GoalRelationshipsApi.md#removeSupportingRelationship) | **POST** /goals/{goal_gid}/removeSupportingRelationship | Removes a supporting goal relationship
|
|
232
234
|
*Asana.GoalRelationshipsApi* | [**updateGoalRelationship**](docs/GoalRelationshipsApi.md#updateGoalRelationship) | **PUT** /goal_relationships/{goal_relationship_gid} | Update a goal relationship
|
|
235
|
+
*Asana.GoalsApi* | [**addCustomFieldSettingForGoal**](docs/GoalsApi.md#addCustomFieldSettingForGoal) | **POST** /goals/{goal_gid}/addCustomFieldSetting | Add a custom field to a goal
|
|
233
236
|
*Asana.GoalsApi* | [**addFollowers**](docs/GoalsApi.md#addFollowers) | **POST** /goals/{goal_gid}/addFollowers | Add a collaborator to a goal
|
|
234
237
|
*Asana.GoalsApi* | [**createGoal**](docs/GoalsApi.md#createGoal) | **POST** /goals | Create a goal
|
|
235
238
|
*Asana.GoalsApi* | [**createGoalMetric**](docs/GoalsApi.md#createGoalMetric) | **POST** /goals/{goal_gid}/setMetric | Create a goal metric
|
|
@@ -237,6 +240,7 @@ Class | Method | HTTP request | Description
|
|
|
237
240
|
*Asana.GoalsApi* | [**getGoal**](docs/GoalsApi.md#getGoal) | **GET** /goals/{goal_gid} | Get a goal
|
|
238
241
|
*Asana.GoalsApi* | [**getGoals**](docs/GoalsApi.md#getGoals) | **GET** /goals | Get goals
|
|
239
242
|
*Asana.GoalsApi* | [**getParentGoalsForGoal**](docs/GoalsApi.md#getParentGoalsForGoal) | **GET** /goals/{goal_gid}/parentGoals | Get parent goals from a goal
|
|
243
|
+
*Asana.GoalsApi* | [**removeCustomFieldSettingForGoal**](docs/GoalsApi.md#removeCustomFieldSettingForGoal) | **POST** /goals/{goal_gid}/removeCustomFieldSetting | Remove a custom field from a goal
|
|
240
244
|
*Asana.GoalsApi* | [**removeFollowers**](docs/GoalsApi.md#removeFollowers) | **POST** /goals/{goal_gid}/removeFollowers | Remove a collaborator from a goal
|
|
241
245
|
*Asana.GoalsApi* | [**updateGoal**](docs/GoalsApi.md#updateGoal) | **PUT** /goals/{goal_gid} | Update a goal
|
|
242
246
|
*Asana.GoalsApi* | [**updateGoalMetric**](docs/GoalsApi.md#updateGoalMetric) | **POST** /goals/{goal_gid}/setMetricCurrentValue | Update a goal metric
|
|
@@ -297,6 +301,11 @@ Class | Method | HTTP request | Description
|
|
|
297
301
|
*Asana.ProjectsApi* | [**removeFollowersForProject**](docs/ProjectsApi.md#removeFollowersForProject) | **POST** /projects/{project_gid}/removeFollowers | Remove followers from a project
|
|
298
302
|
*Asana.ProjectsApi* | [**removeMembersForProject**](docs/ProjectsApi.md#removeMembersForProject) | **POST** /projects/{project_gid}/removeMembers | Remove users from a project
|
|
299
303
|
*Asana.ProjectsApi* | [**updateProject**](docs/ProjectsApi.md#updateProject) | **PUT** /projects/{project_gid} | Update a project
|
|
304
|
+
*Asana.RatesApi* | [**createRate**](docs/RatesApi.md#createRate) | **POST** /rates | Create a rate
|
|
305
|
+
*Asana.RatesApi* | [**deleteRate**](docs/RatesApi.md#deleteRate) | **DELETE** /rates/{rate_gid} | Delete a rate
|
|
306
|
+
*Asana.RatesApi* | [**getRate**](docs/RatesApi.md#getRate) | **GET** /rates/{rate_gid} | Get a rate
|
|
307
|
+
*Asana.RatesApi* | [**getRates**](docs/RatesApi.md#getRates) | **GET** /rates | Get multiple rates
|
|
308
|
+
*Asana.RatesApi* | [**updateRate**](docs/RatesApi.md#updateRate) | **PUT** /rates/{rate_gid} | Update a rate
|
|
300
309
|
*Asana.ReactionsApi* | [**getReactionsOnObject**](docs/ReactionsApi.md#getReactionsOnObject) | **GET** /reactions | Get reactions with an emoji base on an object.
|
|
301
310
|
*Asana.RulesApi* | [**triggerRule**](docs/RulesApi.md#triggerRule) | **POST** /rule_triggers/{rule_trigger_gid}/run | Trigger a rule
|
|
302
311
|
*Asana.SectionsApi* | [**addTaskForSection**](docs/SectionsApi.md#addTaskForSection) | **POST** /sections/{section_gid}/addTask | Add task to section
|
|
@@ -378,9 +387,12 @@ Class | Method | HTTP request | Description
|
|
|
378
387
|
*Asana.UserTaskListsApi* | [**getUserTaskListForUser**](docs/UserTaskListsApi.md#getUserTaskListForUser) | **GET** /users/{user_gid}/user_task_list | Get a user's task list
|
|
379
388
|
*Asana.UsersApi* | [**getFavoritesForUser**](docs/UsersApi.md#getFavoritesForUser) | **GET** /users/{user_gid}/favorites | Get a user's favorites
|
|
380
389
|
*Asana.UsersApi* | [**getUser**](docs/UsersApi.md#getUser) | **GET** /users/{user_gid} | Get a user
|
|
390
|
+
*Asana.UsersApi* | [**getUserForWorkspace**](docs/UsersApi.md#getUserForWorkspace) | **GET** /workspaces/{workspace_gid}/users/{user_gid} | Get a user in a workspace or organization
|
|
381
391
|
*Asana.UsersApi* | [**getUsers**](docs/UsersApi.md#getUsers) | **GET** /users | Get multiple users
|
|
382
392
|
*Asana.UsersApi* | [**getUsersForTeam**](docs/UsersApi.md#getUsersForTeam) | **GET** /teams/{team_gid}/users | Get users in a team
|
|
383
393
|
*Asana.UsersApi* | [**getUsersForWorkspace**](docs/UsersApi.md#getUsersForWorkspace) | **GET** /workspaces/{workspace_gid}/users | Get users in a workspace or organization
|
|
394
|
+
*Asana.UsersApi* | [**updateUser**](docs/UsersApi.md#updateUser) | **PUT** /users/{user_gid} | Update a user
|
|
395
|
+
*Asana.UsersApi* | [**updateUserForWorkspace**](docs/UsersApi.md#updateUserForWorkspace) | **PUT** /workspaces/{workspace_gid}/users/{user_gid} | Update a user in a workspace or organization
|
|
384
396
|
*Asana.WebhooksApi* | [**createWebhook**](docs/WebhooksApi.md#createWebhook) | **POST** /webhooks | Establish a webhook
|
|
385
397
|
*Asana.WebhooksApi* | [**deleteWebhook**](docs/WebhooksApi.md#deleteWebhook) | **DELETE** /webhooks/{webhook_gid} | Delete a webhook
|
|
386
398
|
*Asana.WebhooksApi* | [**getWebhook**](docs/WebhooksApi.md#getWebhook) | **GET** /webhooks/{webhook_gid} | Get a webhook
|
|
@@ -408,9 +420,8 @@ Our `opt_fields` feature allows you to request for properties of a resource that
|
|
|
408
420
|
```javascript
|
|
409
421
|
const Asana = require('asana');
|
|
410
422
|
|
|
411
|
-
let client = Asana.ApiClient
|
|
412
|
-
|
|
413
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
423
|
+
let client = new Asana.ApiClient();
|
|
424
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
414
425
|
|
|
415
426
|
let tasksApiInstance = new Asana.TasksApi();
|
|
416
427
|
let opts = {
|
|
@@ -450,9 +461,8 @@ tasksApiInstance.getTasks(opts).then((result) => {
|
|
|
450
461
|
```javascript
|
|
451
462
|
const Asana = require('asana');
|
|
452
463
|
|
|
453
|
-
let client = Asana.ApiClient
|
|
454
|
-
|
|
455
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
464
|
+
let client = new Asana.ApiClient();
|
|
465
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
456
466
|
|
|
457
467
|
let tasksApiInstance = new Asana.TasksApi();
|
|
458
468
|
let opts = {
|
|
@@ -599,9 +609,8 @@ EX: Pagination gather all resources
|
|
|
599
609
|
```javascript
|
|
600
610
|
const Asana = require('asana');
|
|
601
611
|
|
|
602
|
-
let client = Asana.ApiClient
|
|
603
|
-
|
|
604
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
612
|
+
let client = new Asana.ApiClient();
|
|
613
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
605
614
|
|
|
606
615
|
let tasksApiInstance = new Asana.TasksApi();
|
|
607
616
|
let opts = {
|
|
@@ -711,9 +720,8 @@ EX: Pagination do something per page
|
|
|
711
720
|
```javascript
|
|
712
721
|
const Asana = require('asana');
|
|
713
722
|
|
|
714
|
-
let client = Asana.ApiClient
|
|
715
|
-
|
|
716
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
723
|
+
let client = new Asana.ApiClient();
|
|
724
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
717
725
|
|
|
718
726
|
let tasksApiInstance = new Asana.TasksApi();
|
|
719
727
|
let opts = {
|
|
@@ -777,9 +785,8 @@ EX: Turning off pagination
|
|
|
777
785
|
```javascript
|
|
778
786
|
const Asana = require('asana');
|
|
779
787
|
|
|
780
|
-
let client = Asana.ApiClient
|
|
781
|
-
|
|
782
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
788
|
+
let client = new Asana.ApiClient();
|
|
789
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
783
790
|
|
|
784
791
|
// Turn off pagination
|
|
785
792
|
client.RETURN_COLLECTION = false;
|
|
@@ -821,9 +828,8 @@ request to [getEvents](docs/EventsApi.md#getEvents).
|
|
|
821
828
|
```javascript
|
|
822
829
|
const Asana = require('asana');
|
|
823
830
|
|
|
824
|
-
let client = Asana.ApiClient
|
|
825
|
-
|
|
826
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
831
|
+
let client = new Asana.ApiClient();
|
|
832
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
827
833
|
|
|
828
834
|
let eventsApiInstance = new Asana.EventsApi();
|
|
829
835
|
let resource = "<YOUR_TASK_OR_PROJECT_GID>"; // String | A resource ID to subscribe to. The resource can be a task or project.
|
|
@@ -893,9 +899,8 @@ Use the `<METHOD_NAME>WithHttpInfo` (EX: `getTaskWithHttpInfo`) method to make a
|
|
|
893
899
|
```javascript
|
|
894
900
|
const Asana = require('asana');
|
|
895
901
|
|
|
896
|
-
let client = Asana.ApiClient
|
|
897
|
-
|
|
898
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
902
|
+
let client = new Asana.ApiClient();
|
|
903
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
899
904
|
|
|
900
905
|
let tasksApiInstance = new Asana.TasksApi();
|
|
901
906
|
let task_gid = "<YOUR_TASK_GID>";
|
|
@@ -919,9 +924,8 @@ EX: Asana-Enable header
|
|
|
919
924
|
```javascript
|
|
920
925
|
const Asana = require('asana');
|
|
921
926
|
|
|
922
|
-
let client = Asana.ApiClient
|
|
923
|
-
|
|
924
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
927
|
+
let client = new Asana.ApiClient();
|
|
928
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
925
929
|
|
|
926
930
|
// Add asana-enable header for the client
|
|
927
931
|
client.defaultHeaders['asana-enable'] = 'new_goal_memberships';
|
|
@@ -931,9 +935,8 @@ EX: Asana-Disable header
|
|
|
931
935
|
```javascript
|
|
932
936
|
const Asana = require('asana');
|
|
933
937
|
|
|
934
|
-
let client = Asana.ApiClient
|
|
935
|
-
|
|
936
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
938
|
+
let client = new Asana.ApiClient();
|
|
939
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
937
940
|
|
|
938
941
|
// Add asana-disable header for the client
|
|
939
942
|
client.defaultHeaders['asana-disable'] = 'new_goal_memberships';
|
|
@@ -949,9 +952,8 @@ Use the `callApi` method to make http calls when the endpoint does not exist in
|
|
|
949
952
|
```javascript
|
|
950
953
|
const Asana = require('asana');
|
|
951
954
|
|
|
952
|
-
let client = Asana.ApiClient
|
|
953
|
-
|
|
954
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
955
|
+
let client = new Asana.ApiClient();
|
|
956
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
955
957
|
|
|
956
958
|
// GET - get a task
|
|
957
959
|
client.callApi(
|
|
@@ -979,9 +981,8 @@ client.callApi(
|
|
|
979
981
|
```javascript
|
|
980
982
|
const Asana = require('asana');
|
|
981
983
|
|
|
982
|
-
let client = Asana.ApiClient
|
|
983
|
-
|
|
984
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
984
|
+
let client = new Asana.ApiClient();
|
|
985
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
985
986
|
|
|
986
987
|
// GET - get multiple tasks -> with opt_fields
|
|
987
988
|
client.callApi(
|
|
@@ -1017,9 +1018,8 @@ client.callApi(
|
|
|
1017
1018
|
```javascript
|
|
1018
1019
|
const Asana = require('asana');
|
|
1019
1020
|
|
|
1020
|
-
let client = Asana.ApiClient
|
|
1021
|
-
|
|
1022
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1021
|
+
let client = new Asana.ApiClient();
|
|
1022
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1023
1023
|
|
|
1024
1024
|
// POST - create a task
|
|
1025
1025
|
client.callApi(
|
|
@@ -1059,9 +1059,8 @@ client.callApi(
|
|
|
1059
1059
|
```javascript
|
|
1060
1060
|
const Asana = require('asana');
|
|
1061
1061
|
|
|
1062
|
-
let client = Asana.ApiClient
|
|
1063
|
-
|
|
1064
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1062
|
+
let client = new Asana.ApiClient();
|
|
1063
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1065
1064
|
|
|
1066
1065
|
// PUT - update a task
|
|
1067
1066
|
client.callApi(
|
|
@@ -1095,9 +1094,8 @@ client.callApi(
|
|
|
1095
1094
|
```javascript
|
|
1096
1095
|
const Asana = require('asana');
|
|
1097
1096
|
|
|
1098
|
-
let client = Asana.ApiClient
|
|
1099
|
-
|
|
1100
|
-
token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1097
|
+
let client = new Asana.ApiClient();
|
|
1098
|
+
client.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';
|
|
1101
1099
|
|
|
1102
1100
|
// DELETE - delete a task
|
|
1103
1101
|
client.callApi(
|
|
@@ -1122,6 +1120,6 @@ client.callApi(
|
|
|
1122
1120
|
```
|
|
1123
1121
|
|
|
1124
1122
|
[release-image]: https://img.shields.io/github/release/asana/node-asana.svg
|
|
1125
|
-
[release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.
|
|
1123
|
+
[release-url]: https://github.com/Asana/node-asana/releases/tag/v3.1.4
|
|
1126
1124
|
[npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square
|
|
1127
1125
|
[npm-url]: https://www.npmjs.org/package/asana
|
|
@@ -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
|
|
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
|
-
|
|
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.
|
|
31
|
+
* @version 3.1.4
|
|
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.
|
|
408
|
+
'version': "3.1.4",
|
|
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.
|
|
415
|
+
'version': "3.1.4",
|
|
416
416
|
'language': 'BrowserJS'
|
|
417
417
|
}).toString();
|
|
418
418
|
}
|
package/dist/api/BatchAPIApi.js
CHANGED