Skip to content

Conversation

@seanspeaks
Copy link
Contributor

@seanspeaks seanspeaks commented Mar 21, 2025

TL;DR

Enhanced the attachToTask method in Asana API to support both URL attachments and file uploads from buffers.

What changed?

  • Modified the attachToTask method to accept either a URL string or a Buffer/Uint8Array as the resource parameter
  • Added support for file uploads directly from memory buffers
  • Introduced an optional options parameter that allows specifying filename and content type for buffer uploads
  • Improved error handling and type checking for the resource parameter
  • Fixed code formatting and indentation issues

How to test?

  1. Test URL attachment:

    const result = await asanaApi.attachToTask('123456', 'https://example.com/file.pdf');
  2. Test buffer upload:

    const fileBuffer = Buffer.from('file content');
    const result = await asanaApi.attachToTask('123456', fileBuffer, {
      fileName: 'document.pdf',
      contentType: 'application/pdf'
    });
  3. Verify that both methods correctly attach files to Asana tasks

Why make this change?

This enhancement provides more flexibility when attaching files to Asana tasks. Previously, the method only supported attaching external URLs, but now it can also handle direct file uploads from memory buffers, which is useful for programmatically generated files or when processing files without saving them to disk first.

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @friggframework/api-module-asana@1.1.6-canary.28.ae47af4.0
# or 
yarn add @friggframework/api-module-asana@1.1.6-canary.28.ae47af4.0

Version

Published prerelease version: @friggframework/api-module-asana@2.0.0-next.3

Changelog

🐛 Bug Fix

  • @friggframework/api-module-asana
    • Updated the attachment method to allow for file uploads #28 (@seanspeaks)
  • @friggframework/api-module-microsoft-teams, @friggframework/api-module-slack, @friggframework/api-module-42matters, @friggframework/api-module-asana, @friggframework/api-module-attio, @friggframework/api-module-connectwise, @friggframework/api-module-contentful, @friggframework/api-module-contentstack, @friggframework/api-module-crossbeam, @friggframework/api-module-deel, @friggframework/api-module-frontify, @friggframework/api-module-google-calendar, @friggframework/api-module-google-drive, @friggframework/api-module-helpscout, @friggframework/api-module-hubspot, @friggframework/api-module-ironclad, @friggframework/api-module-linear, @friggframework/api-module-salesforce, @friggframework/api-module-stripe, @friggframework/api-module-unbabel-projects, @friggframework/api-module-unbabel, @friggframework/api-module-zoho-crm, @friggframework/api-module-zoom
    • Update with new searches in Library and Workspaces (Projects) #27 (@seanspeaks)

Authors: 1

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@seanspeaks seanspeaks marked this pull request as ready for review March 21, 2025 03:00
@seanspeaks seanspeaks merged commit 9325fb2 into next Mar 21, 2025
4 checks passed
Copy link
Contributor Author

Merge activity

  • Mar 20, 11:00 PM EDT: A user merged this pull request with Graphite.

@seanspeaks
Copy link
Contributor Author

🚀 PR was released in @friggframework/api-module-asana@2.0.0-next.3 🚀

@seanspeaks seanspeaks added the prerelease This change is available in a prerelease. label Mar 21, 2025
@seanspeaks seanspeaks deleted the asana-file-upload branch August 26, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease This change is available in a prerelease. release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants