Skip to content

Commit

Permalink
Update v1 to v1.0.3 + Add important message in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jv-asana committed Apr 25, 2024
1 parent 581d6dd commit e5c13ff
Show file tree
Hide file tree
Showing 64 changed files with 1,238 additions and 377 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-github-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '8.x'
node-version: '10.x'
- name: Bundle the code, full version to asana.js and minified to asana-min.js
run: |
npm i gulp
npm i gulp@4.0.2
gulp bundle
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@v1
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Asana [![GitHub release][release-image]]() [![Build Status][github-actions-image]][github-actions-url] [![NPM Version][npm-image]][npm-url]
# Asana
> **Important:**
> Versions 1.X.X and earlier of this package are no longer supported. For new features and support, please upgrade to [the latest version](https://www.npmjs.com/package/asana).
>
>To view sample code for version 1, select the `node-sdk-v1` tab on a specific endpoint's page in the [Asana API reference](https://developers.asana.com/reference/rest-api-reference), or check the [v1 samples](https://github.com/Asana/node-asana/tree/v1.0.3/samples) directory on GitHub.
A JavaScript client (for both Node and browser) for the Asana API v1.0.

Expand All @@ -9,20 +13,20 @@ A JavaScript client (for both Node and browser) for the Asana API v1.0.
Install with npm:

```sh
npm install asana --save
npm install asana@1.0.3 --save
```

### Browser

Include the latest release directly from GitHub.
Include the v1.0.3 release directly from GitHub.

```html
<script src="https://github.com/Asana/node-asana/releases/download/<LATEST_RELEASE>/asana-min.js"></script>
<script src="https://github.com/Asana/node-asana/releases/download/v1.03/asana-min.js"></script>
```

**OR:**

1. Download the latest distribution in [releases](https://github.com/Asana/node-asana/releases).
1. Download the v1.0.3 distribution in [releases](https://github.com/Asana/node-asana/releases).
2. Make sure to serve it from your webserver.
3. Include it on the client from a `<script>` tag.

Expand Down Expand Up @@ -338,14 +342,6 @@ GitHub Actions will automatically build and deploy the tagged release.

:reminder_ribbon: Make sure to edit the [new release](https://github.com/Asana/node-asana/releases) description on GitHub after it has been deployed. Please use bullet points to indicate notable changes since the last version.

[release-image]: https://img.shields.io/github/release/asana/node-asana.svg

[github-actions-url]: https://github.com/Asana/node-asana/actions
[github-actions-image]: https://github.com/Asana/node-asana/workflows/Build/badge.svg

[npm-url]: https://www.npmjs.org/package/asana
[npm-image]: http://img.shields.io/npm/v/asana.svg?style=flat-square

[bluebird]: https://github.com/petkaantonov/bluebird
[co]: https://github.com/visionmedia/co
[highland]: http://highlandjs.org/
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "asana",
"main": "dist/asana.js",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/Asana/node-asana",
"authors": [
"Greg Slovacek <greg@asana.com>",
Expand Down
106 changes: 75 additions & 31 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function Client(dispatcher, options) {
* @type {Dispatcher}
*/
this.dispatcher = dispatcher;
/**
* An instance of the Allocations resource.
* @type {Allocations}
*/
this.allocations = new resources.Allocations(this.dispatcher);
/**
* An instance of the Attachments resource.
* @type {Attachments}
Expand All @@ -36,68 +41,98 @@ function Client(dispatcher, options) {
* An instance of the AuditLogAPI resource.
* @type {AuditLogAPI}
*/
this.auditLogAPI = new resources.AuditLogAPI(this.dispatcher);
this.auditlogapi = new resources.AuditLogAPI(this.dispatcher);
/**
* An instance of the BatchAPI resource.
* @type {BatchAPI}
*/
this.batchAPI = new resources.BatchAPI(this.dispatcher);
this.batchapi = new resources.BatchAPI(this.dispatcher);
/**
* An instance of the CustomFieldSettings resource.
* @type {CustomFieldSettings}
*/
this.customFieldSettings = new resources.CustomFieldSettings(this.dispatcher);
this.customfieldsettings = new resources.CustomFieldSettings(this.dispatcher);
/**
* An instance of the CustomFields resource.
* @type {CustomFields}
*/
this.customFields = new resources.CustomFields(this.dispatcher);
this.customfields = new resources.CustomFields(this.dispatcher);
/**
* An instance of the Events resource.
* @type {Events}
*/
this.events = new resources.Events(this.dispatcher);
/**
* An instance of the GoalRelationships resource.
* @type {GoalRelationships}
*/
this.goalrelationships = new resources.GoalRelationships(this.dispatcher);
/**
* An instance of the Goals resource.
* @type {Goals}
*/
this.goals = new resources.Goals(this.dispatcher);
/**
* An instance of the Jobs resource.
* @type {Jobs}
*/
this.jobs = new resources.Jobs(this.dispatcher);
/**
* An instance of the OrganizationExports resource.
* @type {Events}
* An instance of the Memberships resource.
* @type {Memberships}
*/
this.organizationExports = new resources.OrganizationExports(this.dispatcher);
this.memberships = new resources.Memberships(this.dispatcher);
/**
* An instance of the Portfolios resource.
* @type {Portfolios}
* An instance of the OrganizationExports resource.
* @type {OrganizationExports}
*/
this.portfolios = new resources.Portfolios(this.dispatcher);
this.organizationexports = new resources.OrganizationExports(this.dispatcher);
/**
* An instance of the PortfolioMemberships resource.
* @type {PortfolioMemberships}
*/
this.portfolioMemberships =
this.portfoliomemberships =
new resources.PortfolioMemberships(this.dispatcher);
/**
* An instance of the Projects resource.
* @type {Projects}
* An instance of the Portfolios resource.
* @type {Portfolios}
*/
this.projects = new resources.Projects(this.dispatcher);
this.portfolios = new resources.Portfolios(this.dispatcher);
/**
* An instance of the ProjectBriefs resource.
* @type {ProjectBriefs}
*/
this.projectbriefs = new resources.ProjectBriefs(this.dispatcher);
/**
* An instance of the ProjectMemberships resource.
* @type {ProjectMemberships}
*/
this.projectMemberships = new resources.ProjectMemberships(this.dispatcher);
this.projectmemberships = new resources.ProjectMemberships(this.dispatcher);
/**
* An instance of the ProjectStatuses resource.
* @type {ProjectStatuses}
*/
this.projectStatuses = new resources.ProjectStatuses(this.dispatcher);
this.projectstatuses = new resources.ProjectStatuses(this.dispatcher);
/**
* An instance of the ProjectTemplates resource.
* @type {ProjectTemplates}
*/
this.projecttemplates = new resources.ProjectTemplates(this.dispatcher);
/**
* An instance of the Projects resource.
* @type {Projects}
*/
this.projects = new resources.Projects(this.dispatcher);
/**
* An instance of the Sections resource.
* @type {Sections}
*/
this.sections = new resources.Sections(this.dispatcher);
/**
* An instance of the StatusUpdates resource.
* @type {StatusUpdates}
*/
this.statusupdates = new resources.StatusUpdates(this.dispatcher);
/**
* An instance of the Stories resource.
* @type {Stories}
Expand All @@ -118,38 +153,47 @@ function Client(dispatcher, options) {
* @type {Teams}
*/
this.teams = new resources.Teams(this.dispatcher);
/**
* An instance of the TimePeriods resource.
* @type {TimePeriods}
*/
this.timeperiods = new resources.TimePeriods(this.dispatcher);
/**
* An instance of the TimeTrackingEntries resource.
* @type {TimeTrackingEntries}
*/
this.timetrackingentries = new resources.TimeTrackingEntries(this.dispatcher);
/**
* An instance of the Typeahead resource.
* @type {Teams}
* @type {Typeahead}
*/
this.typeahead = new resources.Typeahead(this.dispatcher);
/**
* An instance of the UserTaskLists resource.
* @type {UserTaskLists}
*/
this.usertasklists = new resources.UserTaskLists(this.dispatcher);
/**
* An instance of the Users resource.
* @type {Users}
*/
this.users = new resources.Users(this.dispatcher);
/**
* An instance of the UserTaskLists resource.
* @type {UserTaskLists}
*/
this.userTaskLists = new resources.UserTaskLists(this.dispatcher);
/**
* An instance of the Workspaces resource.
* @type {Workspaces}
* An instance of the Webhooks resource.
* @type {Webhooks}
*/
this.workspaces = new resources.Workspaces(this.dispatcher);
this.webhooks = new resources.Webhooks(this.dispatcher);
/**
* An instance of the WorkspaceMemberships resource.
* @type {Workspaces}
* @type {WorkspaceMemberships}
*/
this.workspaceMemberships =
this.workspacememberships =
new resources.WorkspaceMemberships(this.dispatcher);
/**
* An instance of the Webhooks resource.
* @type {Webhooks}
* An instance of the Workspaces resource.
* @type {Workspaces}
*/
this.webhooks = new resources.Webhooks(this.dispatcher);

this.workspaces = new resources.Workspaces(this.dispatcher);
// Store off Oauth info.
this.app = new App(options);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/resources/allocations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var Allocations = require('./gen/allocations');

module.exports = Allocations;
114 changes: 114 additions & 0 deletions lib/resources/gen/allocations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/**
* This file is auto-generated by our openapi spec.
* We try to keep the generated code pretty clean but there will be lint
* errors that are just not worth fixing (like unused requires).
* TODO: maybe we can just disable those specifically and keep this code
* pretty lint-free too!
*/
/* jshint ignore:start */
var Resource = require('../resource');
var util = require('util');
var _ = require('lodash');

function Allocations(dispatcher) {
Resource.call(this, dispatcher);
}
util.inherits(Allocations, Resource);


/**
* Create an allocation
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
Allocations.prototype.createAllocation = function(
data,
dispatchOptions
) {
var path = "/allocations";

return this.dispatchPost(path, data, dispatchOptions)
};


/**
* Delete an allocation
* @param {String} allocationGid: (required) Globally unique identifier for the allocation.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
Allocations.prototype.deleteAllocation = function(
allocationGid,
data,
dispatchOptions
) {
var path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocationGid);

return this.dispatchDelete(path, data, dispatchOptions)
};


/**
* Get an allocation
* @param {String} allocationGid: (required) Globally unique identifier for the allocation.
* @param {Object} params: Parameters for the request
- optFields {[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.
- optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
Allocations.prototype.getAllocation = function(
allocationGid,
params,
dispatchOptions
) {
var path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocationGid);

return this.dispatchGet(path, params, dispatchOptions)
};


/**
* Get multiple allocations
* @param {Object} params: Parameters for the request
- parent {String}: Globally unique identifier for the project to filter allocations by.
- assignee {String}: Globally unique identifier for the user the allocation is assigned to.
- workspace {String}: Globally unique identifier for the workspace.
- offset {String}: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. *Note: You can only pass in an offset that was returned to you via a previously paginated request.*
- limit {Number}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- optFields {[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.
- optPretty {Boolean}: Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
Allocations.prototype.getAllocations = function(
params,
dispatchOptions
) {
var path = "/allocations";

return this.dispatchGetCollection(path, params, dispatchOptions)
};


/**
* Update an allocation
* @param {String} allocationGid: (required) Globally unique identifier for the allocation.
* @param {Object} data: Data for the request
* @param {Object} [dispatchOptions]: Options, if any, to pass the dispatcher for the request
* @return {Promise} The requested resource
*/
Allocations.prototype.updateAllocation = function(
allocationGid,
data,
dispatchOptions
) {
var path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocationGid);

return this.dispatchPut(path, data, dispatchOptions)
};

module.exports = Allocations;
/* jshint ignore:end */

0 comments on commit e5c13ff

Please sign in to comment.