diff --git a/lib/auth/native_flow.js b/lib/auth/native_flow.js index 7374c874..ed126a29 100644 --- a/lib/auth/native_flow.js +++ b/lib/auth/native_flow.js @@ -1,4 +1,3 @@ -var readline = require('readline'); var Bluebird = require('bluebird'); var oauthUtil = require('./oauth_util'); @@ -103,4 +102,4 @@ NativeFlow.prototype.promptForCode = function(url) { }); }; -module.exports = NativeFlow; \ No newline at end of file +module.exports = NativeFlow; diff --git a/lib/dispatcher.js b/lib/dispatcher.js index 40dfc423..a52db43c 100644 --- a/lib/dispatcher.js +++ b/lib/dispatcher.js @@ -286,13 +286,11 @@ Dispatcher.prototype._addVersionInfo = function(request) { */ Dispatcher.prototype._generateVersionInfo = function() { if (typeof(navigator) === 'undefined' || typeof(window) === 'undefined') { - var os = require('os'); return { 'version': VERSION, 'language': 'NodeJS', 'language_version': process.version, - 'os': os.type(), - 'os_version': os.release() + 'os': process.platform }; } else { return { diff --git a/lib/resources/gen/attachments.js b/lib/resources/gen/attachments.js index e65eb946..7ec08c4f 100644 --- a/lib/resources/gen/attachments.js +++ b/lib/resources/gen/attachments.js @@ -26,7 +26,7 @@ util.inherits(Attachments, Resource); /** * Returns the full record for a single attachment. - * @param {String} attachment Globally unique identifier for the attachment. + * @param {Gid} attachment Globally unique identifier for the attachment. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -43,7 +43,7 @@ Attachments.prototype.findById = function( /** * Returns the compact records for all attachments on the task. - * @param {String} task Globally unique identifier for the task. + * @param {Gid} task Globally unique identifier for the task. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API diff --git a/lib/resources/gen/custom_field_settings.js b/lib/resources/gen/custom_field_settings.js index 8bb61fd9..74caa935 100644 --- a/lib/resources/gen/custom_field_settings.js +++ b/lib/resources/gen/custom_field_settings.js @@ -12,11 +12,12 @@ var util = require('util'); var _ = require('lodash'); /** - * Custom fields are attached to a particular project with the Custom - * Field Settings resource. This resource both represents the many-to-many join - * of the Custom Field and Project as well as stores information that is relevant to that - * particular pairing; for instance, the `is_important` property determines - * some possible application-specific handling of that custom field (see below) + * Custom fields are applied to a particular project or portfolio with the + * Custom Field Settings resource. This resource both represents the + * many-to-many join of the Custom Field and Project or Portfolio as well as + * stores information that is relevant to that particular pairing; for instance, + * the `is_important` property determines some possible application-specific + * handling of that custom field and parent. * @class * @param {Dispatcher} dispatcher The API dispatcher */ @@ -27,8 +28,8 @@ util.inherits(CustomFieldSettings, Resource); /** - * Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` and `opt_expand` can be used to include more data than is returned in the compact representation. See the getting started guide on [input/output options](/developers/documentation/getting-started/input-output-options) for more information. - * @param {String} project The ID of the project for which to list custom field settings + * Returns a list of all of the custom fields settings on a project. + * @param {Gid} project The ID of the project for which to list custom field settings * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -43,6 +44,23 @@ CustomFieldSettings.prototype.findByProject = function( return this.dispatchGetCollection(path, params, dispatchOptions); }; +/** + * Returns a list of all of the custom fields settings on a portfolio. + * @param {Gid} portfolio The ID of the portfolio for which to list custom field settings + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +CustomFieldSettings.prototype.findByPortfolio = function( + portfolio, + params, + dispatchOptions +) { + var path = util.format('/portfolios/%s/custom_field_settings', portfolio); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + module.exports = CustomFieldSettings; /* jshint ignore:end */ diff --git a/lib/resources/gen/custom_fields.js b/lib/resources/gen/custom_fields.js index 51738c60..063f6d18 100644 --- a/lib/resources/gen/custom_fields.js +++ b/lib/resources/gen/custom_fields.js @@ -17,6 +17,11 @@ var _ = require('lodash'); * Fields](/developers/documentation/getting-started/custom-fields) developer * documentation for more information about how custom fields relate to various * resources in Asana. + * + * Users in Asana can [lock custom + * fields](/guide/help/premium/custom-fields#gl-lock-fields), which will make + * them read-only when accessed by other users. Attempting to edit a locked + * custom field will return HTTP error code `403 Forbidden`. * @class * @param {Dispatcher} dispatcher The API dispatcher */ @@ -33,8 +38,9 @@ util.inherits(CustomFields, Resource); * * Returns the full record of the newly created custom field. * @param {Object} data Data for the request - * @param {String} data.workspace The workspace to create a custom field in. - * @param {String} data.type The type of the custom field. + * @param {Gid} data.workspace The workspace to create a custom field in. + * @param {String} data.resource_subtype The type of the custom field. Must be one of the given values. + * @param {String} [data.type] **Deprecated: New integrations should prefer the `resource_subtype` parameter.** * @param {String} data.name The name of the custom field. * @param {String} [data.description] The description of the custom field. * @param {Integer} [data.precision] The number of decimal places for the numerical values. Required if the custom field is of type 'number'. @@ -53,7 +59,7 @@ CustomFields.prototype.create = function( /** * Returns the complete definition of a custom field's metadata. - * @param {String} custom_field Globally unique identifier for the custom field. + * @param {Gid} custom_field Globally unique identifier for the custom field. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -70,7 +76,7 @@ CustomFields.prototype.findById = function( /** * Returns a list of the compact representation of all of the custom fields in a workspace. - * @param {String} workspace The workspace or organization to find custom field definitions in. + * @param {Gid} workspace The workspace or organization to find custom field definitions in. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -90,12 +96,12 @@ CustomFields.prototype.findByWorkspace = function( * * When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. * - * A custom field's `type` cannot be updated. - * * An enum custom field's `enum_options` cannot be updated with this endpoint. Instead see "Work With Enum Options" for information on how to update `enum_options`. * + * Locked custom fields can only be updated by the user who locked the field. + * * Returns the complete updated custom field record. - * @param {String} custom_field Globally unique identifier for the custom field. + * @param {Gid} custom_field Globally unique identifier for the custom field. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -113,8 +119,10 @@ CustomFields.prototype.update = function( /** * A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. * + * Locked custom fields can only be deleted by the user who locked the field. + * * Returns an empty data record. - * @param {String} custom_field Globally unique identifier for the custom field. + * @param {Gid} custom_field Globally unique identifier for the custom field. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -130,17 +138,19 @@ CustomFields.prototype.delete = function( /** * Creates an enum option and adds it to this custom field's list of enum options. A custom field can have at most 50 enum options (including disabled options). By default new enum options are inserted at the end of a custom field's list. * + * Locked custom fields can only have enum options added by the user who locked the field. + * * Returns the full record of the newly created enum option. - * @param {String} custom_field Globally unique identifier for the custom field. + * @param {Gid} custom_field Globally unique identifier for the custom field. * @param {Object} data Data for the request * @param {String} data.name The name of the enum option. * @param {String} [data.color] The color of the enum option. Defaults to 'none'. - * @param {String} [data.insert_before] An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - * @param {String} [data.insert_after] An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. + * @param {Gid} [data.insert_before] An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. + * @param {Gid} [data.insert_after] An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ -CustomFields.prototype.addEnumOption = function( +CustomFields.prototype.createEnumOption = function( customField, data, dispatchOptions @@ -153,8 +163,10 @@ CustomFields.prototype.addEnumOption = function( /** * Updates an existing enum option. Enum custom fields require at least one enabled enum option. * + * Locked custom fields can only be updated by the user who locked the field. + * * Returns the full record of the updated enum option. - * @param {String} enum_option Globally unique identifier for the enum option. + * @param {Gid} enum_option Globally unique identifier for the enum option. * @param {Object} data Data for the request * @param {String} data.name The name of the enum option. * @param {String} [data.color] The color of the enum option. Defaults to 'none'. @@ -174,17 +186,19 @@ CustomFields.prototype.updateEnumOption = function( /** * Moves a particular enum option to be either before or after another specified enum option in the custom field. - * @param {String} custom_field Globally unique identifier for the custom field. + * + * Locked custom fields can only be reordered by the user who locked the field. + * @param {Gid} custom_field Globally unique identifier for the custom field. * @param {Object} data Data for the request - * @param {String} data.enum_option The ID of the enum option to relocate. + * @param {Gid} data.enum_option The ID of the enum option to relocate. * @param {String} data.name The name of the enum option. * @param {String} [data.color] The color of the enum option. Defaults to 'none'. - * @param {String} [data.before_enum_option] An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - * @param {String} [data.after_enum_option] An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. + * @param {Gid} [data.before_enum_option] An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. + * @param {Gid} [data.after_enum_option] An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ -CustomFields.prototype.reorderEnumOption = function( +CustomFields.prototype.insertEnumOption = function( customField, data, dispatchOptions diff --git a/lib/resources/gen/jobs.js b/lib/resources/gen/jobs.js new file mode 100644 index 00000000..1fa894d6 --- /dev/null +++ b/lib/resources/gen/jobs.js @@ -0,0 +1,47 @@ + +/** + * This file is auto-generated by the `asana-api-meta` NodeJS package. + * 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'); + +/** + * A _job_ represents a process that handles asynchronous work. + * + * Jobs are created when an endpoint requests an action that will be handled asynchronously. + * Such as project or task duplication. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ +function Jobs(dispatcher) { + Resource.call(this, dispatcher); +} +util.inherits(Jobs, Resource); + + +/** + * Returns the complete job record for a single job. + * @param {Gid} job The job to get. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +Jobs.prototype.findById = function( + job, + params, + dispatchOptions +) { + var path = util.format('/jobs/%s', job); + + return this.dispatchGet(path, params, dispatchOptions); +}; + + +module.exports = Jobs; +/* jshint ignore:end */ diff --git a/lib/resources/gen/organization_exports.js b/lib/resources/gen/organization_exports.js index 0af8a3d7..67a1f0b0 100644 --- a/lib/resources/gen/organization_exports.js +++ b/lib/resources/gen/organization_exports.js @@ -36,7 +36,7 @@ util.inherits(OrganizationExports, Resource); /** * Returns details of a previously-requested Organization export. - * @param {String} organization_export Globally unique identifier for the Organization export. + * @param {Gid} organization_export Globally unique identifier for the Organization export. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -55,7 +55,7 @@ OrganizationExports.prototype.findById = function( * This method creates a request to export an Organization. Asana will complete the export at some * point after you create the request. * @param {Object} data Data for the request - * @param {String} data.organization Globally unique identifier for the workspace or organization. + * @param {Gid} data.organization Globally unique identifier for the workspace or organization. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ diff --git a/lib/resources/gen/portfolio_memberships.js b/lib/resources/gen/portfolio_memberships.js new file mode 100644 index 00000000..f88cf527 --- /dev/null +++ b/lib/resources/gen/portfolio_memberships.js @@ -0,0 +1,81 @@ + +/** + * This file is auto-generated by the `asana-api-meta` NodeJS package. + * 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'); + +/** + * This object determines if a user is a member of a portfolio. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ +function PortfolioMemberships(dispatcher) { + Resource.call(this, dispatcher); +} +util.inherits(PortfolioMemberships, Resource); + + +/** + * Returns the compact portfolio membership records for the portfolio. You must + * specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. + * @param {Object} [params] Parameters for the request + * @param {Gid} [params.portfolio] The portfolio for which to fetch memberships. + * @param {Gid} [params.workspace] The workspace for which to fetch memberships. + * @param {String} [params.user] The user to filter the memberships to. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +PortfolioMemberships.prototype.findAll = function( + params, + dispatchOptions +) { + var path = util.format('/portfolio_memberships'); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + +/** + * Returns the compact portfolio membership records for the portfolio. + * @param {Gid} portfolio The portfolio for which to fetch memberships. + * @param {Object} [params] Parameters for the request + * @param {String} [params.user] If present, the user to filter the memberships to. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +PortfolioMemberships.prototype.findByPortfolio = function( + portfolio, + params, + dispatchOptions +) { + var path = util.format('/portfolios/%s/portfolio_memberships', portfolio); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + +/** + * Returns the portfolio membership record. + * @param {Gid} portfolio_membership Globally unique identifier for the portfolio membership. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +PortfolioMemberships.prototype.findById = function( + portfolioMembership, + params, + dispatchOptions +) { + var path = util.format('/portfolio_memberships/%s', portfolioMembership); + + return this.dispatchGet(path, params, dispatchOptions); +}; + + +module.exports = PortfolioMemberships; +/* jshint ignore:end */ diff --git a/lib/resources/gen/portfolios.js b/lib/resources/gen/portfolios.js new file mode 100644 index 00000000..997127a1 --- /dev/null +++ b/lib/resources/gen/portfolios.js @@ -0,0 +1,289 @@ + +/** + * This file is auto-generated by the `asana-api-meta` NodeJS package. + * 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'); + +/** + * A _portfolio_ gives a high-level overview of the status of multiple + * initiatives in Asana. Portfolios provide a dashboard overview of the state + * of multiple items, including a progress report and the most recent + * [project status](/developers/api-reference/project_statuses) update. + * + * Portfolios have some restrictions on size. Each portfolio has a maximum of 250 + * items and, like projects, a maximum of 20 custom fields. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ +function Portfolios(dispatcher) { + Resource.call(this, dispatcher); +} +util.inherits(Portfolios, Resource); + + +/** + * Creates a new portfolio in the given workspace with the supplied name. + * + * Note that portfolios created in the Asana UI may have some state + * (like the "Priority" custom field) which is automatically added to the + * portfolio when it is created. Portfolios created via our API will **not** + * be created with the same initial state to allow integrations to create + * their own starting state on a portfolio. + * @param {Object} data Data for the request + * @param {Gid} data.workspace The workspace or organization in which to create the portfolio. + * @param {String} data.name The name of the newly-created portfolio + * @param {String} [data.color] An optional color for the portfolio + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.create = function( + data, + dispatchOptions +) { + var path = util.format('/portfolios'); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Returns the complete record for a single portfolio. + * @param {Gid} portfolio The portfolio to get. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +Portfolios.prototype.findById = function( + portfolio, + params, + dispatchOptions +) { + var path = util.format('/portfolios/%s', portfolio); + + return this.dispatchGet(path, params, dispatchOptions); +}; + +/** + * An existing portfolio can be updated by making a PUT request on the + * URL for that portfolio. Only the fields provided in the `data` block will be + * updated; any unspecified fields will remain unchanged. + * + * Returns the complete updated portfolio record. + * @param {Gid} portfolio The portfolio to update. + * @param {Object} data Data for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.update = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s', portfolio); + + return this.dispatchPut(path, data, dispatchOptions); +}; + +/** + * An existing portfolio can be deleted by making a DELETE request + * on the URL for that portfolio. + * + * Returns an empty data record. + * @param {Gid} portfolio The portfolio to delete. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.delete = function( + portfolio, + dispatchOptions +) { + var path = util.format('/portfolios/%s', portfolio); + + return this.dispatchDelete(path, dispatchOptions); +}; + +/** + * Returns a list of the portfolios in compact representation that are owned + * by the current API user. + * @param {Object} [params] Parameters for the request + * @param {Gid} params.workspace The workspace or organization to filter portfolios on. + * @param {String} params.owner The user who owns the portfolio. Currently, API users can only get a + * list of portfolios that they themselves own. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.findAll = function( + params, + dispatchOptions +) { + var path = util.format('/portfolios'); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + +/** + * Get a list of the items in compact form in a portfolio. + * @param {Gid} portfolio The portfolio from which to get the list of items. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +Portfolios.prototype.getItems = function( + portfolio, + params, + dispatchOptions +) { + var path = util.format('/portfolios/%s/items', portfolio); + + return this.dispatchGet(path, params, dispatchOptions); +}; + +/** + * Add an item to a portfolio. + * + * Returns an empty data block. + * @param {Gid} portfolio The portfolio to which to add an item. + * @param {Object} data Data for the request + * @param {Gid} data.item The item to add to the portfolio. + * @param {Gid} [data.insert_before] An id of an item in this portfolio. The new item will be added before the one specified here. + * `insert_before` and `insert_after` parameters cannot both be specified. + * @param {Gid} [data.insert_after] An id of an item in this portfolio. The new item will be added after the one specified here. + * `insert_before` and `insert_after` parameters cannot both be specified. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.addItem = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/addItem', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Remove an item to a portfolio. + * + * Returns an empty data block. + * @param {Gid} portfolio The portfolio from which to remove the item. + * @param {Object} data Data for the request + * @param {Gid} data.item The item to remove from the portfolio. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.removeItem = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/removeItem', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Adds the specified list of users as members of the portfolio. Returns the updated portfolio record. + * @param {Gid} portfolio The portfolio to add members to. + * @param {Object} data Data for the request + * @param {Array} data.members An array of user ids. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.addMembers = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/addMembers', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Removes the specified list of members from the portfolio. Returns the updated portfolio record. + * @param {Gid} portfolio The portfolio to remove members from. + * @param {Object} data Data for the request + * @param {Array} data.members An array of user ids. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.removeMembers = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/removeMembers', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Get the custom field settings on a portfolio. + * @param {Gid} portfolio The portfolio from which to get the custom field settings. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +Portfolios.prototype.customFieldSettings = function( + portfolio, + params, + dispatchOptions +) { + var path = util.format('/portfolios/%s/custom_field_settings', portfolio); + + return this.dispatchGet(path, params, dispatchOptions); +}; + +/** + * Create a new custom field setting on the portfolio. Returns the full + * record for the new custom field setting. + * @param {Gid} portfolio The portfolio onto which to add the custom field. + * @param {Object} data Data for the request + * @param {Gid} data.custom_field The id of the custom field to add to the portfolio. + * @param {Boolean} [data.is_important] Whether this field should be considered important to this portfolio (for instance, to display in the list view of items in the portfolio). + * @param {Gid} [data.insert_before] An id of a custom field setting on this portfolio. The new custom field setting will be added before this one. + * `insert_before` and `insert_after` parameters cannot both be specified. + * @param {Gid} [data.insert_after] An id of a custom field setting on this portfolio. The new custom field setting will be added after this one. + * `insert_before` and `insert_after` parameters cannot both be specified. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.addCustomFieldSetting = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/addCustomFieldSetting', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + +/** + * Remove a custom field setting on the portfolio. Returns an empty data + * block. + * @param {Gid} portfolio The portfolio from which to remove the custom field. + * @param {Object} data Data for the request + * @param {Gid} data.custom_field The id of the custom field to remove from this portfolio. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Portfolios.prototype.removeCustomFieldSetting = function( + portfolio, + data, + dispatchOptions +) { + var path = util.format('/portfolios/%s/removeCustomFieldSetting', portfolio); + + return this.dispatchPost(path, data, dispatchOptions); +}; + + +module.exports = Portfolios; +/* jshint ignore:end */ diff --git a/lib/resources/gen/project_memberships.js b/lib/resources/gen/project_memberships.js index 6e3d588d..214ea582 100644 --- a/lib/resources/gen/project_memberships.js +++ b/lib/resources/gen/project_memberships.js @@ -27,13 +27,13 @@ util.inherits(ProjectMemberships, Resource); /** * Returns the compact project membership records for the project. - * @param {String} project The project for which to fetch memberships. + * @param {Gid} project The project for which to fetch memberships. * @param {Object} [params] Parameters for the request * @param {String} [params.user] If present, the user to filter the memberships to. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ -ProjectMemberships.prototype.getMany = function( +ProjectMemberships.prototype.findByProject = function( project, params, dispatchOptions @@ -45,17 +45,17 @@ ProjectMemberships.prototype.getMany = function( /** * Returns the project membership record. - * @param {String} project Globally unique identifier for the project membership. + * @param {Gid} project_membership Globally unique identifier for the project membership. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource */ -ProjectMemberships.prototype.getSingle = function( - project, +ProjectMemberships.prototype.findById = function( + projectMembership, params, dispatchOptions ) { - var path = util.format('/project_memberships/%s', project); + var path = util.format('/project_memberships/%s', projectMembership); return this.dispatchGet(path, params, dispatchOptions); }; diff --git a/lib/resources/gen/project_statuses.js b/lib/resources/gen/project_statuses.js index 63b7fc48..736c037a 100644 --- a/lib/resources/gen/project_statuses.js +++ b/lib/resources/gen/project_statuses.js @@ -31,14 +31,14 @@ util.inherits(ProjectStatuses, Resource); * Creates a new status update on the project. * * Returns the full record of the newly created project status update. - * @param {String} project The project on which to create a status update. + * @param {Gid} project The project on which to create a status update. * @param {Object} data Data for the request * @param {String} data.text The text of the project status update. * @param {String} data.color The color to associate with the status update. Must be one of `"red"`, `"yellow"`, or `"green"`. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ -ProjectStatuses.prototype.create = function( +ProjectStatuses.prototype.createInProject = function( project, data, dispatchOptions @@ -50,7 +50,7 @@ ProjectStatuses.prototype.create = function( /** * Returns the compact project status update records for all updates on the project. - * @param {String} project The project to find status updates for. + * @param {Gid} project The project to find status updates for. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -67,7 +67,7 @@ ProjectStatuses.prototype.findByProject = function( /** * Returns the complete record for a single status update. - * @param {String} project-status The project status update to get. + * @param {Gid} project-status The project status update to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -86,7 +86,7 @@ ProjectStatuses.prototype.findById = function( * Deletes a specific, existing project status update. * * Returns an empty data record. - * @param {String} project-status The project status update to delete. + * @param {Gid} project-status The project status update to delete. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ diff --git a/lib/resources/gen/projects.js b/lib/resources/gen/projects.js index d2798242..081687a1 100644 --- a/lib/resources/gen/projects.js +++ b/lib/resources/gen/projects.js @@ -43,8 +43,8 @@ util.inherits(Projects, Resource); * * Returns the full record of the newly created project. * @param {Object} data Data for the request - * @param {String} data.workspace The workspace or organization to create the project in. - * @param {String} [data.team] If creating in an organization, the specific team to create the + * @param {Gid} data.workspace The workspace or organization to create the project in. + * @param {Gid} [data.team] If creating in an organization, the specific team to create the * project in. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -63,7 +63,7 @@ Projects.prototype.create = function( * supply a `team` to share the project with. * * Returns the full record of the newly created project. - * @param {String} workspace The workspace or organization to create the project in. + * @param {Gid} workspace The workspace or organization to create the project in. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -82,7 +82,7 @@ Projects.prototype.createInWorkspace = function( * Creates a project shared with the given team. * * Returns the full record of the newly created project. - * @param {String} team The team to create the project in. + * @param {Gid} team The team to create the project in. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -99,7 +99,7 @@ Projects.prototype.createInTeam = function( /** * Returns the complete project record for a single project. - * @param {String} project The project to get. + * @param {Gid} project The project to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -124,7 +124,7 @@ Projects.prototype.findById = function( * you last retrieved the task. * * Returns the complete updated project record. - * @param {String} project The project to update. + * @param {Gid} project The project to update. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -144,7 +144,7 @@ Projects.prototype.update = function( * on the URL for that project. * * Returns an empty data record. - * @param {String} project The project to delete. + * @param {Gid} project The project to delete. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -157,12 +157,43 @@ Projects.prototype.delete = function( return this.dispatchDelete(path, dispatchOptions); }; +/** + * Creates and returns a job that will asynchronously handle the duplication. + * @param {Gid} project The project to duplicate. + * @param {Object} data Data for the request + * @param {String} data.name The name of the new project. + * @param {Gid} [data.team] Sets the team of the new project. If team is not defined, the new project + * will be in the same team as the the original project. + * @param {Array} [data.include] The elements that will be duplicated to the new project. + * Tasks are always included. + * @param {String} [data.schedule_dates] A dictionary of options to auto-shift dates. + * `task_dates` must be included to use this option. + * Requires either `start_on` or `due_on`, but not both. + * `start_on` will set the first start date of the new + * project to the given date, while `due_on` will set the last due date + * to the given date. Both will offset the remaining dates by the same amount + * of the original project. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Projects.prototype.duplicateProject = function( + project, + data, + dispatchOptions +) { + var path = util.format('/projects/%s/duplicate', project); + + return this.dispatchPost(path, data, dispatchOptions); +}; + /** * Returns the compact project records for some filtered set of projects. * Use one or more of the parameters provided to filter the projects returned. * @param {Object} [params] Parameters for the request - * @param {String} [params.workspace] The workspace or organization to filter projects on. - * @param {String} [params.team] The team to filter projects on. + * @param {Gid} [params.workspace] The workspace or organization to filter projects on. + * @param {Gid} [params.team] The team to filter projects on. + * @param {Boolean} [params.is_template] **Note: This parameter can only be included if a team is also defined, or the workspace is not an organization** + * Filters results to include only template projects. * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of * this parameter. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -179,8 +210,10 @@ Projects.prototype.findAll = function( /** * Returns the compact project records for all projects in the workspace. - * @param {String} workspace The workspace or organization to find projects in. + * @param {Gid} workspace The workspace or organization to find projects in. * @param {Object} [params] Parameters for the request + * @param {Boolean} [params.is_template] **Note: This parameter can only be included if a team is also defined, or the workspace is not an organization** + * Filters results to include only template projects. * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of * this parameter. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -198,8 +231,9 @@ Projects.prototype.findByWorkspace = function( /** * Returns the compact project records for all projects in the team. - * @param {String} team The team to find projects in. + * @param {Gid} team The team to find projects in. * @param {Object} [params] Parameters for the request + * @param {Boolean} [params.is_template] Filters results to include only template projects. * @param {Boolean} [params.archived] Only return projects whose `archived` field takes on the value of * this parameter. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -218,7 +252,7 @@ Projects.prototype.findByTeam = function( /** * Returns the compact task records for all tasks within the given project, * ordered by their priority within the project. Tasks can exist in more than one project at a time. - * @param {String} project The project in which to search for tasks. + * @param {Gid} project The project in which to search for tasks. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -237,7 +271,7 @@ Projects.prototype.tasks = function( * Adds the specified list of users as followers to the project. Followers are a subset of members, therefore if * the users are not already members of the project they will also become members as a result of this operation. * Returns the updated project record. - * @param {String} project The project to add followers to. + * @param {Gid} project The project to add followers to. * @param {Object} data Data for the request * @param {Array} data.followers An array of followers to add to the project. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -256,7 +290,7 @@ Projects.prototype.addFollowers = function( /** * Removes the specified list of users from following the project, this will not affect project membership status. * Returns the updated project record. - * @param {String} project The project to remove followers from. + * @param {Gid} project The project to remove followers from. * @param {Object} data Data for the request * @param {Array} data.followers An array of followers to remove from the project. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -274,9 +308,9 @@ Projects.prototype.removeFollowers = function( /** * Adds the specified list of users as members of the project. Returns the updated project record. - * @param {String} project The project to add members to. + * @param {Gid} project The project to add members to. * @param {Object} data Data for the request - * @param {Array} data.members An array of members to add to the project. + * @param {Array} data.members An array of user ids. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -292,9 +326,9 @@ Projects.prototype.addMembers = function( /** * Removes the specified list of members from the project. Returns the updated project record. - * @param {String} project The project to remove members from. + * @param {Gid} project The project to remove members from. * @param {Object} data Data for the request - * @param {Array} data.members An array of members to remove from the project. + * @param {Array} data.members An array of user ids. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -310,13 +344,13 @@ Projects.prototype.removeMembers = function( /** * Create a new custom field setting on the project. - * @param {String} project The project to associate the custom field with + * @param {Gid} project The project to associate the custom field with * @param {Object} data Data for the request - * @param {String} data.custom_field The id of the custom field to associate with this project. + * @param {Gid} data.custom_field The id of the custom field to associate with this project. * @param {Boolean} [data.is_important] Whether this field should be considered important to this project. - * @param {String} [data.insert_before] An id of a Custom Field Settings on this project, before which the new Custom Field Settings will be added. + * @param {Gid} [data.insert_before] An id of a Custom Field Settings on this project, before which the new Custom Field Settings will be added. * `insert_before` and `insert_after` parameters cannot both be specified. - * @param {String} [data.insert_after] An id of a Custom Field Settings on this project, after which the new Custom Field Settings will be added. + * @param {Gid} [data.insert_after] An id of a Custom Field Settings on this project, after which the new Custom Field Settings will be added. * `insert_before` and `insert_after` parameters cannot both be specified. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -333,9 +367,9 @@ Projects.prototype.addCustomFieldSetting = function( /** * Remove a custom field setting on the project. - * @param {String} project The project to associate the custom field with + * @param {Gid} project The project to associate the custom field with * @param {Object} data Data for the request - * @param {String} [data.custom_field] The id of the custom field to remove from this project. + * @param {Gid} [data.custom_field] The id of the custom field to remove from this project. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ diff --git a/lib/resources/gen/sections.js b/lib/resources/gen/sections.js index 29685f76..7bcc32f0 100644 --- a/lib/resources/gen/sections.js +++ b/lib/resources/gen/sections.js @@ -28,7 +28,7 @@ util.inherits(Sections, Resource); * Creates a new section in a project. * * Returns the full record of the newly created section. - * @param {String} project The project to create the section in + * @param {Gid} project The project to create the section in * @param {Object} data Data for the request * @param {String} data.name The text to be displayed as the section name. This cannot be an empty string. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -46,10 +46,10 @@ Sections.prototype.createInProject = function( /** * Returns the compact records for all sections in the specified project. - * @param {String} project The project to get sections from. + * @param {Gid} project The project to get sections from. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request - * @return {Promise} The requested resource + * @return {Promise} The response from the API */ Sections.prototype.findByProject = function( project, @@ -58,12 +58,12 @@ Sections.prototype.findByProject = function( ) { var path = util.format('/projects/%s/sections', project); - return this.dispatchGet(path, params, dispatchOptions); + return this.dispatchGetCollection(path, params, dispatchOptions); }; /** * Returns the complete record for a single section. - * @param {String} section The section to get. + * @param {Gid} section The section to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -89,7 +89,7 @@ Sections.prototype.findById = function( * you last retrieved the task. * * Returns the complete updated section record. - * @param {String} section The section to update. + * @param {Gid} section The section to update. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -113,7 +113,7 @@ Sections.prototype.update = function( * The last remaining section in a board view cannot be deleted. * * Returns an empty data block. - * @param {String} section The section to delete. + * @param {Gid} section The section to delete. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -126,6 +126,29 @@ Sections.prototype.delete = function( return this.dispatchDelete(path, dispatchOptions); }; +/** + * Add a task to a specific, existing section. This will remove the task from other sections of the project. + * + * The task will be inserted at the top of a section unless an `insert_before` or `insert_after` parameter is declared. + * + * This does not work for separators (tasks with the `resource_subtype` of section). + * @param {Gid} task The task to add to this section + * @param {Object} data Data for the request + * @param {Gid} [data.insert_before] Insert the given task immediately before the task specified by this parameter. Cannot be provided together with `insert_after`. + * @param {Gid} [data.insert_after] Insert the given task immediately after the task specified by this parameter. Cannot be provided together with `insert_before`. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Sections.prototype.addTask = function( + task, + data, + dispatchOptions +) { + var path = util.format('/sections/%s/addTask', task); + + return this.dispatchPost(path, data, dispatchOptions); +}; + /** * Move sections relative to each other in a board view. One of * `before_section` or `after_section` is required. @@ -135,11 +158,11 @@ Sections.prototype.delete = function( * At this point in time, moving sections is not supported in list views, only board views. * * Returns an empty data block. - * @param {String} project The project in which to reorder the given section + * @param {Gid} project The project in which to reorder the given section * @param {Object} data Data for the request - * @param {String} data.section The section to reorder - * @param {String} [data.before_section] Insert the given section immediately before the section specified by this parameter. - * @param {String} [data.after_section] Insert the given section immediately after the section specified by this parameter. + * @param {Gid} data.section The section to reorder + * @param {Gid} [data.before_section] Insert the given section immediately before the section specified by this parameter. + * @param {Gid} [data.after_section] Insert the given section immediately after the section specified by this parameter. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ diff --git a/lib/resources/gen/stories.js b/lib/resources/gen/stories.js index 724001cf..1f92624f 100644 --- a/lib/resources/gen/stories.js +++ b/lib/resources/gen/stories.js @@ -16,9 +16,6 @@ var _ = require('lodash'); * system. Stories are generated by the system whenever users take actions such * as creating or assigning tasks, or moving tasks between projects. _Comments_ * are also a form of user-generated story. - * - * Stories are a form of history in the system, and as such they are read-only. - * Once generated, it is not possible to modify a story. * @class * @param {Dispatcher} dispatcher The API dispatcher */ @@ -30,7 +27,7 @@ util.inherits(Stories, Resource); /** * Returns the compact records for all stories on the task. - * @param {String} task Globally unique identifier for the task. + * @param {Gid} task Globally unique identifier for the task. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -47,7 +44,7 @@ Stories.prototype.findByTask = function( /** * Returns the full record for a single story. - * @param {String} story Globally unique identifier for the story. + * @param {Gid} story Globally unique identifier for the story. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -88,7 +85,7 @@ Stories.prototype.createOnTask = function( * Updates the story and returns the full record for the updated story. * Only comment stories can have their text updated, and only comment stories and * attachment stories can be pinned. Only one of `text` and `html_text` can be specified. - * @param {String} story Globally unique identifier for the story. + * @param {Gid} story Globally unique identifier for the story. * @param {Object} data Data for the request * @param {String} [data.text] The plain text with which to update the comment. * @param {String} [data.html_text] The rich text with which to update the comment. @@ -108,7 +105,7 @@ Stories.prototype.update = function( /** * Deletes a story. A user can only delete stories they have created. Returns an empty data record. - * @param {String} story Globally unique identifier for the story. + * @param {Gid} story Globally unique identifier for the story. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ diff --git a/lib/resources/gen/tags.js b/lib/resources/gen/tags.js index 03961d87..83717b7a 100644 --- a/lib/resources/gen/tags.js +++ b/lib/resources/gen/tags.js @@ -38,7 +38,7 @@ util.inherits(Tags, Resource); * * Returns the full record of the newly created tag. * @param {Object} data Data for the request - * @param {String} data.workspace The workspace or organization to create the tag in. + * @param {Gid} data.workspace The workspace or organization to create the tag in. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -60,7 +60,7 @@ Tags.prototype.create = function( * organization. * * Returns the full record of the newly created tag. - * @param {String} workspace The workspace or organization to create the tag in. + * @param {Gid} workspace The workspace or organization to create the tag in. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -77,7 +77,7 @@ Tags.prototype.createInWorkspace = function( /** * Returns the complete tag record for a single tag. - * @param {String} tag The tag to get. + * @param {Gid} tag The tag to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -101,7 +101,7 @@ Tags.prototype.findById = function( * you last retrieved the task. * * Returns the complete updated tag record. - * @param {String} tag The tag to update. + * @param {Gid} tag The tag to update. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -121,7 +121,7 @@ Tags.prototype.update = function( * on the URL for that tag. * * Returns an empty data record. - * @param {String} tag The tag to delete. + * @param {Gid} tag The tag to delete. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -138,8 +138,8 @@ Tags.prototype.delete = function( * Returns the compact tag records for some filtered set of tags. * Use one or more of the parameters provided to filter the tags returned. * @param {Object} [params] Parameters for the request - * @param {String} [params.workspace] The workspace or organization to filter tags on. - * @param {String} [params.team] The team to filter tags on. + * @param {Gid} [params.workspace] The workspace or organization to filter tags on. + * @param {Gid} [params.team] The team to filter tags on. * @param {Boolean} [params.archived] Only return tags whose `archived` field takes on the value of * this parameter. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -156,7 +156,7 @@ Tags.prototype.findAll = function( /** * Returns the compact tag records for all tags in the workspace. - * @param {String} workspace The workspace or organization to find tags in. + * @param {Gid} workspace The workspace or organization to find tags in. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -171,24 +171,6 @@ Tags.prototype.findByWorkspace = function( return this.dispatchGetCollection(path, params, dispatchOptions); }; -/** - * Returns the compact task records for all tasks with the given tag. - * Tasks can have more than one tag at a time. - * @param {String} tag The tag to fetch tasks from. - * @param {Object} [params] Parameters for the request - * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request - * @return {Promise} The response from the API - */ -Tags.prototype.getTasksWithTag = function( - tag, - params, - dispatchOptions -) { - var path = util.format('/tags/%s/tasks', tag); - - return this.dispatchGetCollection(path, params, dispatchOptions); -}; - module.exports = Tags; /* jshint ignore:end */ diff --git a/lib/resources/gen/tasks.js b/lib/resources/gen/tasks.js index c075ff95..b0c59691 100644 --- a/lib/resources/gen/tasks.js +++ b/lib/resources/gen/tasks.js @@ -37,7 +37,7 @@ util.inherits(Tasks, Resource); * `projects` can be a comma separated list of projects, or just a single * project the task should belong to. * @param {Object} data Data for the request - * @param {String} [data.workspace] The workspace to create a task in. + * @param {Gid} [data.workspace] The workspace to create a task in. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -58,7 +58,7 @@ Tasks.prototype.create = function( * Every task is required to be created in a specific workspace, and this * workspace cannot be changed once set. The workspace need not be set * explicitly if you specify a `project` or a `parent` task instead. - * @param {String} workspace The workspace to create a task in. + * @param {Gid} workspace The workspace to create a task in. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -75,7 +75,7 @@ Tasks.prototype.createInWorkspace = function( /** * Returns the complete task record for a single task. - * @param {String} task The task to get. + * @param {Gid} task The task to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -100,7 +100,7 @@ Tasks.prototype.findById = function( * you last retrieved the task. * * Returns the complete updated task record. - * @param {String} task The task to update. + * @param {Gid} task The task to update. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -122,7 +122,7 @@ Tasks.prototype.update = function( * of 30 days; afterward they are completely removed from the system. * * Returns an empty data record. - * @param {String} task The task to delete. + * @param {Gid} task The task to delete. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -135,27 +135,46 @@ Tasks.prototype.delete = function( return this.dispatchDelete(path, dispatchOptions); }; +/** + * Creates and returns a job that will asynchronously handle the duplication. + * @param {Gid} task The task to duplicate. + * @param {Object} data Data for the request + * @param {String} data.name The name of the new task. + * @param {Array} [data.include] The fields that will be duplicated to the new task. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Tasks.prototype.duplicateTask = function( + task, + data, + dispatchOptions +) { + var path = util.format('/tasks/%s/duplicate', task); + + return this.dispatchPost(path, data, dispatchOptions); +}; + /** * Returns the compact task records for all tasks within the given project, * ordered by their priority within the project. - * @param {String} projectId The project in which to search for tasks. + * @param {Gid} project The project in which to search for tasks. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ Tasks.prototype.findByProject = function( - projectId, + project, params, dispatchOptions ) { - var path = util.format('/projects/%s/tasks', projectId); + var path = util.format('/projects/%s/tasks', project); return this.dispatchGetCollection(path, params, dispatchOptions); }; /** * Returns the compact task records for all tasks with the given tag. - * @param {String} tag The tag in which to search for tasks. + * @param {Gid} tag The tag in which to search for tasks. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -172,7 +191,7 @@ Tasks.prototype.findByTag = function( /** * Board view only: Returns the compact section records for all tasks within the given section. - * @param {String} section The section in which to search for tasks. + * @param {Gid} section The section in which to search for tasks. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -187,15 +206,53 @@ Tasks.prototype.findBySection = function( return this.dispatchGetCollection(path, params, dispatchOptions); }; +/** + * Returns the compact list of tasks in a user's My Tasks list. The returned + * tasks will be in order within each assignee status group of `Inbox`, + * `Today`, and `Upcoming`. + * + * **Note:** tasks in `Later` have a different ordering in the Asana web app + * than the other assignee status groups; this endpoint will still return + * them in list order in `Later` (differently than they show up in Asana, + * but the same order as in Asana's mobile apps). + * + * **Note:** Access control is enforced for this endpoint as with all Asana + * API endpoints, meaning a user's private tasks will be filtered out if the + * API-authenticated user does not have access to them. + * + * **Note:** Both complete and incomplete tasks are returned by default + * unless they are filtered out (for example, setting `completed_since=now` + * will return only incomplete tasks, which is the default view for "My + * Tasks" in Asana.) + * @param {Gid} user_task_list The user task list in which to search for tasks. + * @param {Object} [params] Parameters for the request + * @param {String} [params.completed_since] Only return tasks that are either incomplete or that have been + * completed since this time. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Tasks.prototype.findByUserTaskList = function( + userTaskList, + params, + dispatchOptions +) { + var path = util.format('/user_task_lists/%s/tasks', userTaskList); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + /** * Returns the compact task records for some filtered set of tasks. Use one * or more of the parameters provided to filter the tasks returned. You must - * specify a `project` or `tag` if you do not specify `assignee` and `workspace`. + * specify a `project`, `section`, `tag`, or `user_task_list` if you do not + * specify `assignee` and `workspace`. * @param {Object} [params] Parameters for the request * @param {String} [params.assignee] The assignee to filter tasks on. - * @param {String} [params.project] The project to filter tasks on. - * @param {String} [params.section] The section to filter tasks on. - * @param {String} [params.workspace] The workspace or organization to filter tasks on. + * @param {Gid} [params.workspace] The workspace or organization to filter tasks on. + * @param {Gid} [params.project] The project to filter tasks on. + * @param {Gid} [params.section] The section to filter tasks on. + * @param {Gid} [params.tag] The tag to filter tasks on. + * @param {Gid} [params.user_task_list] The user task list to filter tasks on. * @param {String} [params.completed_since] Only return tasks that are either incomplete or that have been * completed since this time. * @param {String} [params.modified_since] Only return tasks that have been modified since the given time. @@ -211,14 +268,33 @@ Tasks.prototype.findAll = function( return this.dispatchGetCollection(path, params, dispatchOptions); }; +/** + * Returns the compact task records for all tasks with the given tag. + * Tasks can have more than one tag at a time. + * @param {String} tag The tag to fetch tasks from. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Tasks.prototype.getTasksWithTag = function( + tag, + params, + dispatchOptions +) { + var path = util.format('/tags/%s/tasks', tag); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + /** * The search endpoint allows you to build complex queries to find and fetch exactly the data you need from Asana. For a more comprehensive description of all the query parameters and limitations of this endpoint, see our [long-form documentation](/developers/documentation/getting-started/search-api) for this feature. - * @param {String} workspace The workspace or organization in which to search for tasks. + * @param {Gid} workspace The workspace or organization in which to search for tasks. * @param {Object} [params] Parameters for the request + * @param {String} [params.resource_subtype] Filters results by the task's resource_subtype. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ -Tasks.prototype.search = function( +Tasks.prototype.searchInWorkspace = function( workspace, params, dispatchOptions @@ -230,7 +306,7 @@ Tasks.prototype.search = function( /** * Returns the compact representations of all of the dependencies of a task. - * @param {String} task The task to get dependencies on. + * @param {Gid} task The task to get dependencies on. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -247,7 +323,7 @@ Tasks.prototype.dependencies = function( /** * Returns the compact representations of all of the dependents of a task. - * @param {String} task The task to get dependents on. + * @param {Gid} task The task to get dependents on. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The requested resource @@ -265,7 +341,7 @@ Tasks.prototype.dependents = function( /** * Marks a set of tasks as dependencies of this task, if they are not * already dependencies. *A task can have at most 15 dependencies.* - * @param {String} task The task to add dependencies to. + * @param {Gid} task The task to add dependencies to. * @param {Object} data Data for the request * @param {Array} data.dependencies An array of task IDs that this task should depend on. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -284,7 +360,7 @@ Tasks.prototype.addDependencies = function( /** * Marks a set of tasks as dependents of this task, if they are not already * dependents. *A task can have at most 30 dependents.* - * @param {String} task The task to add dependents to. + * @param {Gid} task The task to add dependents to. * @param {Object} data Data for the request * @param {Array} data.dependents An array of task IDs that should depend on this task. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -302,7 +378,7 @@ Tasks.prototype.addDependents = function( /** * Unlinks a set of dependencies from this task. - * @param {String} task The task to remove dependencies from. + * @param {Gid} task The task to remove dependencies from. * @param {Object} data Data for the request * @param {Array} data.dependencies An array of task IDs to remove as dependencies. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -320,7 +396,7 @@ Tasks.prototype.removeDependencies = function( /** * Unlinks a set of dependents from this task. - * @param {String} task The task to remove dependents from. + * @param {Gid} task The task to remove dependents from. * @param {Object} data Data for the request * @param {Array} data.dependents An array of task IDs to remove as dependents. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -339,7 +415,7 @@ Tasks.prototype.removeDependents = function( /** * Adds each of the specified followers to the task, if they are not already * following. Returns the complete, updated record for the affected task. - * @param {String} task The task to add followers to. + * @param {Gid} task The task to add followers to. * @param {Object} data Data for the request * @param {Array} data.followers An array of followers to add to the task. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -358,7 +434,7 @@ Tasks.prototype.addFollowers = function( /** * Removes each of the specified followers from the task if they are * following. Returns the complete, updated record for the affected task. - * @param {String} task The task to remove followers from. + * @param {Gid} task The task to remove followers from. * @param {Object} data Data for the request * @param {Array} data.followers An array of followers to remove from the task. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request @@ -376,7 +452,7 @@ Tasks.prototype.removeFollowers = function( /** * Returns a compact representation of all of the projects the task is in. - * @param {String} task The task to get projects on. + * @param {Gid} task The task to get projects on. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -406,14 +482,14 @@ Tasks.prototype.projects = function( * within the section to anchor the position of this task. * * Returns an empty data block. - * @param {String} task The task to add to a project. + * @param {Gid} task The task to add to a project. * @param {Object} data Data for the request - * @param {String} data.project The project to add the task to. - * @param {String} [data.insert_after] A task in the project to insert the task after, or `null` to + * @param {Gid} data.project The project to add the task to. + * @param {Gid} [data.insert_after] A task in the project to insert the task after, or `null` to * insert at the beginning of the list. - * @param {String} [data.insert_before] A task in the project to insert the task before, or `null` to + * @param {Gid} [data.insert_before] A task in the project to insert the task before, or `null` to * insert at the end of the list. - * @param {String} [data.section] A section in the project to insert the task into. The task will be + * @param {Gid} [data.section] A section in the project to insert the task into. The task will be * inserted at the bottom of the section. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -433,9 +509,9 @@ Tasks.prototype.addProject = function( * in the system, but it will not be in the project anymore. * * Returns an empty data block. - * @param {String} task The task to remove from a project. + * @param {Gid} task The task to remove from a project. * @param {Object} data Data for the request - * @param {String} data.project The project to remove the task from. + * @param {Gid} data.project The project to remove the task from. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -451,7 +527,7 @@ Tasks.prototype.removeProject = function( /** * Returns a compact representation of all of the tags the task has. - * @param {String} task The task to get tags on. + * @param {Gid} task The task to get tags on. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -468,9 +544,9 @@ Tasks.prototype.tags = function( /** * Adds a tag to a task. Returns an empty data block. - * @param {String} task The task to add a tag to. + * @param {Gid} task The task to add a tag to. * @param {Object} data Data for the request - * @param {String} data.tag The tag to add to the task. + * @param {Gid} data.tag The tag to add to the task. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -486,9 +562,9 @@ Tasks.prototype.addTag = function( /** * Removes a tag from the task. Returns an empty data block. - * @param {String} task The task to remove a tag from. + * @param {Gid} task The task to remove a tag from. * @param {Object} data Data for the request - * @param {String} data.tag The tag to remove from the task. + * @param {Gid} data.tag The tag to remove from the task. * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API */ @@ -504,7 +580,7 @@ Tasks.prototype.removeTag = function( /** * Returns a compact representation of all of the subtasks of a task. - * @param {String} task The task to get the subtasks of. + * @param {Gid} task The task to get the subtasks of. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -522,7 +598,7 @@ Tasks.prototype.subtasks = function( /** * Creates a new subtask and adds it to the parent task. Returns the full record * for the newly created subtask. - * @param {String} task The task to add a subtask to. + * @param {Gid} task The task to add a subtask to. * @param {Object} data Data for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -539,7 +615,7 @@ Tasks.prototype.addSubtask = function( /** * Returns a compact representation of all of the stories on the task. - * @param {String} task The task containing the stories to get. + * @param {Gid} task The task containing the stories to get. * @param {Object} [params] Parameters for the request * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request * @return {Promise} The response from the API @@ -576,6 +652,36 @@ Tasks.prototype.addComment = function( return this.dispatchPost(path, data, dispatchOptions); }; +/** + * Insert or reorder tasks in a user's My Tasks list. If the task was not + * assigned to the owner of the user task list it will be reassigned when + * this endpoint is called. If neither `insert_before` nor `insert_after` + * are provided the task will be inserted at the top of the assignee's + * inbox. + * + * Returns an empty data block. + * @param {Gid} user_task_list Globally unique identifier for the user task list. + * @param {Object} data Data for the request + * @param {Gid} data.task Globally unique identifier for the task. + * @param {Gid} [data.insert_before] Insert the task before the task specified by this field. The inserted + * task will inherit the `assignee_status` of this task. `insert_before` + * and `insert_after` parameters cannot both be specified. + * @param {Gid} [data.insert_after] Insert the task after the task specified by this field. The inserted + * task will inherit the `assignee_status` of this task. `insert_before` + * and `insert_after` parameters cannot both be specified. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +Tasks.prototype.insertInUserTaskList = function( + userTaskList, + data, + dispatchOptions +) { + var path = util.format('/user_task_lists/%s/tasks/insert', userTaskList); + + return this.dispatchPost(path, data, dispatchOptions); +}; + module.exports = Tasks; /* jshint ignore:end */ diff --git a/lib/resources/gen/user_task_lists.js b/lib/resources/gen/user_task_lists.js new file mode 100644 index 00000000..d4a91841 --- /dev/null +++ b/lib/resources/gen/user_task_lists.js @@ -0,0 +1,109 @@ + +/** + * This file is auto-generated by the `asana-api-meta` NodeJS package. + * 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'); + +/** + * A _user task list_ represents the tasks assigned to a particular user. It provides API access to a user's "My Tasks" view in Asana. + * + * A user's "My Tasks" represent all of the tasks assigned to that user. It is + * visually divided into regions based on the task's + * [`assignee_status`](/developers/api-reference/tasks#field-assignee_status) + * for Asana users to triage their tasks based on when they can address them. + * When building an integration it's worth noting that tasks with due dates will + * automatically move through `assignee_status` states as their due dates + * approach; read up on [task + * auto-promotion](/guide/help/fundamentals/my-tasks#gl-auto-promote) for more + * infomation. + * @class + * @param {Dispatcher} dispatcher The API dispatcher + */ +function UserTaskLists(dispatcher) { + Resource.call(this, dispatcher); +} +util.inherits(UserTaskLists, Resource); + + +/** + * Returns the full record for the user task list for the given user + * @param {String} user An identifier for the user. Can be one of an email address, + * the globally unique identifier for the user, or the keyword `me` + * to indicate the current user making the request. + * @param {Object} [params] Parameters for the request + * @param {Gid} params.workspace Globally unique identifier for the workspace or organization. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +UserTaskLists.prototype.findByUser = function( + user, + params, + dispatchOptions +) { + var path = util.format('/users/%s/user_task_list', user); + + return this.dispatchGet(path, params, dispatchOptions); +}; + +/** + * Returns the full record for a user task list. + * @param {Gid} user_task_list Globally unique identifier for the user task list. + * @param {Object} [params] Parameters for the request + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +UserTaskLists.prototype.findById = function( + userTaskList, + params, + dispatchOptions +) { + var path = util.format('/user_task_lists/%s', userTaskList); + + return this.dispatchGet(path, params, dispatchOptions); +}; + +/** + * Returns the compact list of tasks in a user's My Tasks list. The returned + * tasks will be in order within each assignee status group of `Inbox`, + * `Today`, and `Upcoming`. + * + * **Note:** tasks in `Later` have a different ordering in the Asana web app + * than the other assignee status groups; this endpoint will still return + * them in list order in `Later` (differently than they show up in Asana, + * but the same order as in Asana's mobile apps). + * + * **Note:** Access control is enforced for this endpoint as with all Asana + * API endpoints, meaning a user's private tasks will be filtered out if the + * API-authenticated user does not have access to them. + * + * **Note:** Both complete and incomplete tasks are returned by default + * unless they are filtered out (for example, setting `completed_since=now` + * will return only incomplete tasks, which is the default view for "My + * Tasks" in Asana.) + * @param {Gid} user_task_list The user task list in which to search for tasks. + * @param {Object} [params] Parameters for the request + * @param {String} [params.completed_since] Only return tasks that are either incomplete or that have been + * completed since this time. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ +UserTaskLists.prototype.tasks = function( + userTaskList, + params, + dispatchOptions +) { + var path = util.format('/user_task_lists/%s/tasks', userTaskList); + + return this.dispatchGetCollection(path, params, dispatchOptions); +}; + + +module.exports = UserTaskLists; +/* jshint ignore:end */ diff --git a/lib/resources/gen/users.js b/lib/resources/gen/users.js index caab4b98..e52be27d 100644 --- a/lib/resources/gen/users.js +++ b/lib/resources/gen/users.js @@ -61,6 +61,28 @@ Users.prototype.findById = function( return this.dispatchGet(path, params, dispatchOptions); }; +/** + * Returns all of a user's favorites in the given workspace, of the given type. + * Results are given in order (The same order as Asana's sidebar). + * @param {String} user An identifier for the user. Can be one of an email address, + * the globally unique identifier for the user, or the keyword `me` + * to indicate the current user making the request. + * @param {Object} [params] Parameters for the request + * @param {String} params.workspace The workspace in which to get favorites. + * @param {String} params.resource_type The resource type of favorites to be returned. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The requested resource + */ +Users.prototype.getUserFavorites = function( + user, + params, + dispatchOptions +) { + var path = util.format('/users/%s/favorites', user); + + return this.dispatchGet(path, params, dispatchOptions); +}; + /** * Returns the user records for all users in the specified workspace or * organization. diff --git a/lib/resources/gen/webhooks.js b/lib/resources/gen/webhooks.js index 297b8d33..744f1d92 100644 --- a/lib/resources/gen/webhooks.js +++ b/lib/resources/gen/webhooks.js @@ -31,12 +31,14 @@ var _ = require('lodash'); * {\ * "resource": {\ * "id": 1337,\ + * "resource_type": "task",\ * "name": "My Task"\ * },\ * "parent": null,\ * "created_at": "2013-08-21T18:20:37.972Z",\ * "user": {\ * "id": 1123,\ + * "resource_type": "user",\ * "name": "Tom Bizarro"\ * },\ * "action": "changed",\ diff --git a/lib/resources/gen/workspaces.js b/lib/resources/gen/workspaces.js index 7fa1810d..6e06eb9d 100644 --- a/lib/resources/gen/workspaces.js +++ b/lib/resources/gen/workspaces.js @@ -98,10 +98,11 @@ Workspaces.prototype.update = function( * so you won't be able to fetch large numbers of results. * @param {String} workspace The workspace to fetch objects from. * @param {Object} [params] Parameters for the request - * @param {String} params.type The type of values the typeahead should return. You can choose from + * @param {String} params.resource_type The type of values the typeahead should return. You can choose from * one of the following: custom_field, project, tag, task, and user. * Note that unlike in the names of endpoints, the types listed here are * in singular form (e.g. `task`). Using multiple types is not yet supported. + * @param {String} [params.type] **Deprecated: new integrations should prefer the resource_type field.** * @param {String} [params.query] The string that will be used to search for relevant objects. If an * empty string is passed in, the API will currently return an empty * result set. diff --git a/lib/resources/jobs.js b/lib/resources/jobs.js new file mode 100644 index 00000000..68d740f0 --- /dev/null +++ b/lib/resources/jobs.js @@ -0,0 +1,3 @@ +var Jobs = require('./gen/jobs'); + +module.exports = Jobs; diff --git a/lib/resources/portfolio_memberships.js b/lib/resources/portfolio_memberships.js new file mode 100644 index 00000000..c32292b8 --- /dev/null +++ b/lib/resources/portfolio_memberships.js @@ -0,0 +1,3 @@ +var PortfolioMemberships = require('./gen/portfolio_memberships'); + +module.exports = PortfolioMemberships; diff --git a/lib/resources/portfolios.js b/lib/resources/portfolios.js new file mode 100644 index 00000000..d61333b0 --- /dev/null +++ b/lib/resources/portfolios.js @@ -0,0 +1,3 @@ +var Portfolios = require('./gen/portfolios'); + +module.exports = Portfolios; diff --git a/lib/resources/user_task_lists.js b/lib/resources/user_task_lists.js new file mode 100644 index 00000000..800d0161 --- /dev/null +++ b/lib/resources/user_task_lists.js @@ -0,0 +1,3 @@ +var UserTaskLists = require('./gen/user_task_lists'); + +module.exports = UserTaskLists;