From 2e90767d6958e1a7a71daebcff94fe443766c689 Mon Sep 17 00:00:00 2001 From: Filippo Sarzana Date: Tue, 25 Feb 2020 22:23:26 +0100 Subject: [PATCH] =?UTF-8?q?feat(asana):=20add=20'addTask'=20method=20to=20?= =?UTF-8?q?Sections=20interface=20as=20per=E2=80=A6=20(#40632)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(asana): add 'addTask' method to Sections interface as per asana@0.17.3 * fix: remove duplicated jsdoc and fix formatting --- types/asana/index.d.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index 10488ef9ff..acf0f8ec2e 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for node-asana 0.14.0 +// Type definitions for node-asana 0.17.3 // Project: https://github.com/Asana/node-asana // Definitions by: Qubo // Tasyp +// Filippo Sarzana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.2 import * as Promise from 'bluebird'; @@ -864,14 +865,14 @@ declare namespace asana { resource_type: string; resource_subtype: string; } - + interface EventSectionResource extends EventResource { project: { gid: string; name: string; }; } - + type EventProject = EventResource & Partial; type EventSection = EventSectionResource & Partial; type EventStory = EventResource & Partial; @@ -1948,6 +1949,12 @@ declare namespace asana { interface Type extends Resource { created_at: string; } + + interface SectionsParams { + task: number | string; + insert_after?: string; + insert_before?: string; + } } var Sections: SectionsStatic; @@ -1970,6 +1977,18 @@ declare namespace asana { * @return {Promise} The requested resource */ findById(section: string | number, params?: Params, dispatchOptions?: any): Promise; + + /** + * * Adds the specified task to a specific section of project. Returns empty object. + * @param {String} section The section to add task to. + * @param {Object} data Data for the request + * @param {String} data.task The id of task to be added to specified section. + * @param {String} data.insert_after An existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before. + * @param {String} data.insert_before An existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after. + * @param {Object} [dispatchOptions] Options, if any, to pass the dispatcher for the request + * @return {Promise} The response from the API + */ + addTask(section: string | number, data: Sections.SectionsParams, dispatchOptions?: any): Promise<{}>; } interface TeamsStatic { @@ -2647,4 +2666,4 @@ declare namespace asana { var VERSION: string; } -export = asana; \ No newline at end of file +export = asana;