npm.io
0.0.2 • Published 3 years ago

narwhalyeti

Licence
Apache 2.0
Version
0.0.2
Deps
2
Size
4.0 MB
Vulns
0
Weekly
0

narwhalyeti

Narwhalyeti - JavaScript client for narwhalyeti This is the interface for interacting with the Asana Platform. Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml). This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0
  • Package version: 0.0.2
  • Build package: com.asana.codegen.JavascriptClientCodegenGenerator For more information, please visit https://asana.com/support

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install narwhalyeti --save
git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var Narwhalyeti = require('narwhalyeti');
var defaultClient = Narwhalyeti.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new Narwhalyeti.AttachmentsApi()
var opts = { 
  'resource_subtype': "external", // {String} 
  'file': "file_example", // {Blob} 
  'parent': "parent_example", // {String} 
  'url': "url_example", // {String} 
  'name': "name_example", // {String} 
  'connect_to_app': true, // {Boolean} 
  'opt_fields': ["[\"connected_to_app\",\"created_at\",\"download_url\",\"host\",\"name\",\"parent\",\"parent.name\",\"parent.resource_subtype\",\"permanent_url\",\"resource_subtype\",\"size\",\"view_url\"]"] // {[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.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createAttachmentForObject(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://app.asana.com/api/1.0

Class Method HTTP request Description
Narwhalyeti.AttachmentsApi createAttachmentForObject POST /attachments Upload an attachment
Narwhalyeti.AttachmentsApi deleteAttachment DELETE /attachments/{attachment_gid} Delete an attachment
Narwhalyeti.AttachmentsApi getAttachment GET /attachments/{attachment_gid} Get an attachment
Narwhalyeti.AttachmentsApi getAttachmentsForObject GET /attachments Get attachments from an object
Narwhalyeti.AuditLogAPIApi getAuditLogEvents GET /workspaces/{workspace_gid}/audit_log_events Get audit log events
Narwhalyeti.BatchAPIApi createBatchRequest POST /batch Submit parallel requests
Narwhalyeti.CustomFieldSettingsApi getCustomFieldSettingsForPortfolio GET /portfolios/{portfolio_gid}/custom_field_settings Get a portfolio's custom fields
Narwhalyeti.CustomFieldSettingsApi getCustomFieldSettingsForProject GET /projects/{project_gid}/custom_field_settings Get a project's custom fields
Narwhalyeti.CustomFieldsApi createCustomField POST /custom_fields Create a custom field
Narwhalyeti.CustomFieldsApi createEnumOptionForCustomField POST /custom_fields/{custom_field_gid}/enum_options Create an enum option
Narwhalyeti.CustomFieldsApi deleteCustomField DELETE /custom_fields/{custom_field_gid} Delete a custom field
Narwhalyeti.CustomFieldsApi getCustomField GET /custom_fields/{custom_field_gid} Get a custom field
Narwhalyeti.CustomFieldsApi getCustomFieldsForWorkspace GET /workspaces/{workspace_gid}/custom_fields Get a workspace's custom fields
Narwhalyeti.CustomFieldsApi insertEnumOptionForCustomField POST /custom_fields/{custom_field_gid}/enum_options/insert Reorder a custom field's enum
Narwhalyeti.CustomFieldsApi updateCustomField PUT /custom_fields/{custom_field_gid} Update a custom field
Narwhalyeti.CustomFieldsApi updateEnumOption PUT /enum_options/{enum_option_gid} Update an enum option
Narwhalyeti.EventsApi getEvents GET /events Get events on a resource
Narwhalyeti.GoalRelationshipsApi addSupportingRelationship POST /goals/{goal_gid}/addSupportingRelationship Add a supporting goal relationship
Narwhalyeti.GoalRelationshipsApi getGoalRelationship GET /goal_relationships/{goal_relationship_gid} Get a goal relationship
Narwhalyeti.GoalRelationshipsApi getGoalRelationships GET /goal_relationships Get goal relationships
Narwhalyeti.GoalRelationshipsApi removeSupportingRelationship POST /goals/{goal_gid}/removeSupportingRelationship Removes a supporting goal relationship
Narwhalyeti.GoalRelationshipsApi updateGoalRelationship PUT /goal_relationships/{goal_relationship_gid} Update a goal relationship
Narwhalyeti.GoalsApi addFollowers POST /goals/{goal_gid}/addFollowers Add a collaborator to a goal
Narwhalyeti.GoalsApi createGoal POST /goals Create a goal
Narwhalyeti.GoalsApi createGoalMetric POST /goals/{goal_gid}/setMetric Create a goal metric
Narwhalyeti.GoalsApi deleteGoal DELETE /goals/{goal_gid} Delete a goal
Narwhalyeti.GoalsApi getGoal GET /goals/{goal_gid} Get a goal
Narwhalyeti.GoalsApi getGoals GET /goals Get goals
Narwhalyeti.GoalsApi getParentGoalsForGoal GET /goals/{goal_gid}/parentGoals Get parent goals from a goal
Narwhalyeti.GoalsApi removeFollowers POST /goals/{goal_gid}/removeFollowers Remove a collaborator from a goal
Narwhalyeti.GoalsApi updateGoal PUT /goals/{goal_gid} Update a goal
Narwhalyeti.GoalsApi updateGoalMetric POST /goals/{goal_gid}/setMetricCurrentValue Update a goal metric
Narwhalyeti.JobsApi getJob GET /jobs/{job_gid} Get a job by id
Narwhalyeti.MembershipsApi createMembership POST /memberships Create a membership
Narwhalyeti.MembershipsApi deleteMembership DELETE /memberships/{membership_gid} Delete a membership
Narwhalyeti.MembershipsApi getMemberships GET /memberships Get multiple memberships
Narwhalyeti.MembershipsApi updateMembership PUT /memberships/{membership_gid} Update a membership
Narwhalyeti.OrganizationExportsApi createOrganizationExport POST /organization_exports Create an organization export request
Narwhalyeti.OrganizationExportsApi getOrganizationExport GET /organization_exports/{organization_export_gid} Get details on an org export request
Narwhalyeti.PortfolioMembershipsApi getPortfolioMembership GET /portfolio_memberships/{portfolio_membership_gid} Get a portfolio membership
Narwhalyeti.PortfolioMembershipsApi getPortfolioMemberships GET /portfolio_memberships Get multiple portfolio memberships
Narwhalyeti.PortfolioMembershipsApi getPortfolioMembershipsForPortfolio GET /portfolios/{portfolio_gid}/portfolio_memberships Get memberships from a portfolio
Narwhalyeti.PortfoliosApi addCustomFieldSettingForPortfolio POST /portfolios/{portfolio_gid}/addCustomFieldSetting Add a custom field to a portfolio
Narwhalyeti.PortfoliosApi addItemForPortfolio POST /portfolios/{portfolio_gid}/addItem Add a portfolio item
Narwhalyeti.PortfoliosApi addMembersForPortfolio POST /portfolios/{portfolio_gid}/addMembers Add users to a portfolio
Narwhalyeti.PortfoliosApi createPortfolio POST /portfolios Create a portfolio
Narwhalyeti.PortfoliosApi deletePortfolio DELETE /portfolios/{portfolio_gid} Delete a portfolio
Narwhalyeti.PortfoliosApi getItemsForPortfolio GET /portfolios/{portfolio_gid}/items Get portfolio items
Narwhalyeti.PortfoliosApi getPortfolio GET /portfolios/{portfolio_gid} Get a portfolio
Narwhalyeti.PortfoliosApi getPortfolios GET /portfolios Get multiple portfolios
Narwhalyeti.PortfoliosApi removeCustomFieldSettingForPortfolio POST /portfolios/{portfolio_gid}/removeCustomFieldSetting Remove a custom field from a portfolio
Narwhalyeti.PortfoliosApi removeItemForPortfolio POST /portfolios/{portfolio_gid}/removeItem Remove a portfolio item
Narwhalyeti.PortfoliosApi removeMembersForPortfolio POST /portfolios/{portfolio_gid}/removeMembers Remove users from a portfolio
Narwhalyeti.PortfoliosApi updatePortfolio PUT /portfolios/{portfolio_gid} Update a portfolio
Narwhalyeti.ProjectBriefsApi createProjectBrief POST /projects/{project_gid}/project_briefs Create a project brief
Narwhalyeti.ProjectBriefsApi deleteProjectBrief DELETE /project_briefs/{project_brief_gid} Delete a project brief
Narwhalyeti.ProjectBriefsApi getProjectBrief GET /project_briefs/{project_brief_gid} Get a project brief
Narwhalyeti.ProjectBriefsApi updateProjectBrief PUT /project_briefs/{project_brief_gid} Update a project brief
Narwhalyeti.ProjectMembershipsApi getProjectMembership GET /project_memberships/{project_membership_gid} Get a project membership
Narwhalyeti.ProjectMembershipsApi getProjectMembershipsForProject GET /projects/{project_gid}/project_memberships Get memberships from a project
Narwhalyeti.ProjectStatusesApi createProjectStatusForProject POST /projects/{project_gid}/project_statuses Create a project status
Narwhalyeti.ProjectStatusesApi deleteProjectStatus DELETE /project_statuses/{project_status_gid} Delete a project status
Narwhalyeti.ProjectStatusesApi getProjectStatus GET /project_statuses/{project_status_gid} Get a project status
Narwhalyeti.ProjectStatusesApi getProjectStatusesForProject GET /projects/{project_gid}/project_statuses Get statuses from a project
Narwhalyeti.ProjectTemplatesApi deleteProjectTemplate DELETE /project_templates/{project_template_gid} Delete a project template
Narwhalyeti.ProjectTemplatesApi getProjectTemplate GET /project_templates/{project_template_gid} Get a project template
Narwhalyeti.ProjectTemplatesApi getProjectTemplates GET /project_templates Get multiple project templates
Narwhalyeti.ProjectTemplatesApi getProjectTemplatesForTeam GET /teams/{team_gid}/project_templates Get a team's project templates
Narwhalyeti.ProjectTemplatesApi instantiateProject POST /project_templates/{project_template_gid}/instantiateProject Instantiate a project from a project template
Narwhalyeti.ProjectsApi addCustomFieldSettingForProject POST /projects/{project_gid}/addCustomFieldSetting Add a custom field to a project
Narwhalyeti.ProjectsApi addFollowersForProject POST /projects/{project_gid}/addFollowers Add followers to a project
Narwhalyeti.ProjectsApi addMembersForProject POST /projects/{project_gid}/addMembers Add users to a project
Narwhalyeti.ProjectsApi createProject POST /projects Create a project
Narwhalyeti.ProjectsApi createProjectForTeam POST /teams/{team_gid}/projects Create a project in a team
Narwhalyeti.ProjectsApi createProjectForWorkspace POST /workspaces/{workspace_gid}/projects Create a project in a workspace
Narwhalyeti.ProjectsApi deleteProject DELETE /projects/{project_gid} Delete a project
Narwhalyeti.ProjectsApi duplicateProject POST /projects/{project_gid}/duplicate Duplicate a project
Narwhalyeti.ProjectsApi getProject GET /projects/{project_gid} Get a project
Narwhalyeti.ProjectsApi getProjects GET /projects Get multiple projects
Narwhalyeti.ProjectsApi getProjectsForTask GET /tasks/{task_gid}/projects Get projects a task is in
Narwhalyeti.ProjectsApi getProjectsForTeam GET /teams/{team_gid}/projects Get a team's projects
Narwhalyeti.ProjectsApi getProjectsForWorkspace GET /workspaces/{workspace_gid}/projects Get all projects in a workspace
Narwhalyeti.ProjectsApi getTaskCountsForProject GET /projects/{project_gid}/task_counts Get task count of a project
Narwhalyeti.ProjectsApi projectSaveAsTemplate POST /projects/{project_gid}/saveAsTemplate Create a project template from a project
Narwhalyeti.ProjectsApi removeCustomFieldSettingForProject POST /projects/{project_gid}/removeCustomFieldSetting Remove a custom field from a project
Narwhalyeti.ProjectsApi removeFollowersForProject POST /projects/{project_gid}/removeFollowers Remove followers from a project
Narwhalyeti.ProjectsApi removeMembersForProject POST /projects/{project_gid}/removeMembers Remove users from a project
Narwhalyeti.ProjectsApi updateProject PUT /projects/{project_gid} Update a project
Narwhalyeti.RulesApi triggerRule POST /rule_triggers/{rule_trigger_gid}/run Trigger a rule
Narwhalyeti.SectionsApi addTaskForSection POST /sections/{section_gid}/addTask Add task to section
Narwhalyeti.SectionsApi createSectionForProject POST /projects/{project_gid}/sections Create a section in a project
Narwhalyeti.SectionsApi deleteSection DELETE /sections/{section_gid} Delete a section
Narwhalyeti.SectionsApi getSection GET /sections/{section_gid} Get a section
Narwhalyeti.SectionsApi getSectionsForProject GET /projects/{project_gid}/sections Get sections in a project
Narwhalyeti.SectionsApi insertSectionForProject POST /projects/{project_gid}/sections/insert Move or Insert sections
Narwhalyeti.SectionsApi updateSection PUT /sections/{section_gid} Update a section
Narwhalyeti.StatusUpdatesApi createStatusForObject POST /status_updates Create a status update
Narwhalyeti.StatusUpdatesApi deleteStatus DELETE /status_updates/{status_update_gid} Delete a status update
Narwhalyeti.StatusUpdatesApi getStatus GET /status_updates/{status_update_gid} Get a status update
Narwhalyeti.StatusUpdatesApi getStatusesForObject GET /status_updates Get status updates from an object
Narwhalyeti.StoriesApi createStoryForTask POST /tasks/{task_gid}/stories Create a story on a task
Narwhalyeti.StoriesApi deleteStory DELETE /stories/{story_gid} Delete a story
Narwhalyeti.StoriesApi getStoriesForTask GET /tasks/{task_gid}/stories Get stories from a task
Narwhalyeti.StoriesApi getStory GET /stories/{story_gid} Get a story
Narwhalyeti.StoriesApi updateStory PUT /stories/{story_gid} Update a story
Narwhalyeti.TagsApi createTag POST /tags Create a tag
Narwhalyeti.TagsApi createTagForWorkspace POST /workspaces/{workspace_gid}/tags Create a tag in a workspace
Narwhalyeti.TagsApi deleteTag DELETE /tags/{tag_gid} Delete a tag
Narwhalyeti.TagsApi getTag GET /tags/{tag_gid} Get a tag
Narwhalyeti.TagsApi getTags GET /tags Get multiple tags
Narwhalyeti.TagsApi getTagsForTask GET /tasks/{task_gid}/tags Get a task's tags
Narwhalyeti.TagsApi getTagsForWorkspace GET /workspaces/{workspace_gid}/tags Get tags in a workspace
Narwhalyeti.TagsApi updateTag PUT /tags/{tag_gid} Update a tag
Narwhalyeti.TasksApi addDependenciesForTask POST /tasks/{task_gid}/addDependencies Set dependencies for a task
Narwhalyeti.TasksApi addDependentsForTask POST /tasks/{task_gid}/addDependents Set dependents for a task
Narwhalyeti.TasksApi addFollowersForTask POST /tasks/{task_gid}/addFollowers Add followers to a task
Narwhalyeti.TasksApi addProjectForTask POST /tasks/{task_gid}/addProject Add a project to a task
Narwhalyeti.TasksApi addTagForTask POST /tasks/{task_gid}/addTag Add a tag to a task
Narwhalyeti.TasksApi createSubtaskForTask POST /tasks/{task_gid}/subtasks Create a subtask
Narwhalyeti.TasksApi createTask POST /tasks Create a task
Narwhalyeti.TasksApi deleteTask DELETE /tasks/{task_gid} Delete a task
Narwhalyeti.TasksApi duplicateTask POST /tasks/{task_gid}/duplicate Duplicate a task
Narwhalyeti.TasksApi getDependenciesForTask GET /tasks/{task_gid}/dependencies Get dependencies from a task
Narwhalyeti.TasksApi getDependentsForTask GET /tasks/{task_gid}/dependents Get dependents from a task
Narwhalyeti.TasksApi getSubtasksForTask GET /tasks/{task_gid}/subtasks Get subtasks from a task
Narwhalyeti.TasksApi getTask GET /tasks/{task_gid} Get a task
Narwhalyeti.TasksApi getTasks GET /tasks Get multiple tasks
Narwhalyeti.TasksApi getTasksForProject GET /projects/{project_gid}/tasks Get tasks from a project
Narwhalyeti.TasksApi getTasksForSection GET /sections/{section_gid}/tasks Get tasks from a section
Narwhalyeti.TasksApi getTasksForTag GET /tags/{tag_gid}/tasks Get tasks from a tag
Narwhalyeti.TasksApi getTasksForUserTaskList GET /user_task_lists/{user_task_list_gid}/tasks Get tasks from a user task list
Narwhalyeti.TasksApi removeDependenciesForTask POST /tasks/{task_gid}/removeDependencies Unlink dependencies from a task
Narwhalyeti.TasksApi removeDependentsForTask POST /tasks/{task_gid}/removeDependents Unlink dependents from a task
Narwhalyeti.TasksApi removeFollowerForTask POST /tasks/{task_gid}/removeFollowers Remove followers from a task
Narwhalyeti.TasksApi removeProjectForTask POST /tasks/{task_gid}/removeProject Remove a project from a task
Narwhalyeti.TasksApi removeTagForTask POST /tasks/{task_gid}/removeTag Remove a tag from a task
Narwhalyeti.TasksApi searchTasksForWorkspace GET /workspaces/{workspace_gid}/tasks/search Search tasks in a workspace
Narwhalyeti.TasksApi setParentForTask POST /tasks/{task_gid}/setParent Set the parent of a task
Narwhalyeti.TasksApi updateTask PUT /tasks/{task_gid} Update a task
Narwhalyeti.TeamMembershipsApi getTeamMembership GET /team_memberships/{team_membership_gid} Get a team membership
Narwhalyeti.TeamMembershipsApi getTeamMemberships GET /team_memberships Get team memberships
Narwhalyeti.TeamMembershipsApi getTeamMembershipsForTeam GET /teams/{team_gid}/team_memberships Get memberships from a team
Narwhalyeti.TeamMembershipsApi getTeamMembershipsForUser GET /users/{user_gid}/team_memberships Get memberships from a user
Narwhalyeti.TeamsApi addUserForTeam POST /teams/{team_gid}/addUser Add a user to a team
Narwhalyeti.TeamsApi createTeam POST /teams Create a team
Narwhalyeti.TeamsApi getTeam GET /teams/{team_gid} Get a team
Narwhalyeti.TeamsApi getTeamsForUser GET /users/{user_gid}/teams Get teams for a user
Narwhalyeti.TeamsApi getTeamsForWorkspace GET /workspaces/{workspace_gid}/teams Get teams in a workspace
Narwhalyeti.TeamsApi removeUserForTeam POST /teams/{team_gid}/removeUser Remove a user from a team
Narwhalyeti.TeamsApi updateTeam PUT /teams Update a team
Narwhalyeti.TimePeriodsApi getTimePeriod GET /time_periods/{time_period_gid} Get a time period
Narwhalyeti.TimePeriodsApi getTimePeriods GET /time_periods Get time periods
Narwhalyeti.TimeTrackingEntriesApi createTimeTrackingEntry POST /tasks/{task_gid}/time_tracking_entries Create a time tracking entry
Narwhalyeti.TimeTrackingEntriesApi deleteTimeTrackingEntry DELETE /time_tracking_entries/{time_tracking_entry_gid} Delete a time tracking entry
Narwhalyeti.TimeTrackingEntriesApi getTimeTrackingEntriesForTask GET /tasks/{task_gid}/time_tracking_entries Get time tracking entries for a task
Narwhalyeti.TimeTrackingEntriesApi getTimeTrackingEntry GET /time_tracking_entries/{time_tracking_entry_gid} Get a time tracking entry
Narwhalyeti.TimeTrackingEntriesApi updateTimeTrackingEntry PUT /time_tracking_entries/{time_tracking_entry_gid} Update a time tracking entry
Narwhalyeti.TypeaheadApi typeaheadForWorkspace GET /workspaces/{workspace_gid}/typeahead Get objects via typeahead
Narwhalyeti.UserTaskListsApi getUserTaskList GET /user_task_lists/{user_task_list_gid} Get a user task list
Narwhalyeti.UserTaskListsApi getUserTaskListForUser GET /users/{user_gid}/user_task_list Get a user's task list
Narwhalyeti.UsersApi getFavoritesForUser GET /users/{user_gid}/favorites Get a user's favorites
Narwhalyeti.UsersApi getUser GET /users/{user_gid} Get a user
Narwhalyeti.UsersApi getUsers GET /users Get multiple users
Narwhalyeti.UsersApi getUsersForTeam GET /teams/{team_gid}/users Get users in a team
Narwhalyeti.UsersApi getUsersForWorkspace GET /workspaces/{workspace_gid}/users Get users in a workspace or organization
Narwhalyeti.WebhooksApi createWebhook POST /webhooks Establish a webhook
Narwhalyeti.WebhooksApi deleteWebhook DELETE /webhooks/{webhook_gid} Delete a webhook
Narwhalyeti.WebhooksApi getWebhook GET /webhooks/{webhook_gid} Get a webhook
Narwhalyeti.WebhooksApi getWebhooks GET /webhooks Get multiple webhooks
Narwhalyeti.WebhooksApi updateWebhook PUT /webhooks/{webhook_gid} Update a webhook
Narwhalyeti.WorkspaceMembershipsApi getWorkspaceMembership GET /workspace_memberships/{workspace_membership_gid} Get a workspace membership
Narwhalyeti.WorkspaceMembershipsApi getWorkspaceMembershipsForUser GET /users/{user_gid}/workspace_memberships Get workspace memberships for a user
Narwhalyeti.WorkspaceMembershipsApi getWorkspaceMembershipsForWorkspace GET /workspaces/{workspace_gid}/workspace_memberships Get the workspace memberships for a workspace
Narwhalyeti.WorkspacesApi addUserForWorkspace POST /workspaces/{workspace_gid}/addUser Add a user to a workspace or organization
Narwhalyeti.WorkspacesApi getWorkspace GET /workspaces/{workspace_gid} Get a workspace
Narwhalyeti.WorkspacesApi getWorkspaces GET /workspaces Get multiple workspaces
Narwhalyeti.WorkspacesApi removeUserForWorkspace POST /workspaces/{workspace_gid}/removeUser Remove a user from a workspace or organization
Narwhalyeti.WorkspacesApi updateWorkspace PUT /workspaces/{workspace_gid} Update a workspace

Documentation for Models

Documentation for Authorization

oauth2