Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets plugin ideas #281

Open
philnash opened this issue Jun 18, 2021 · 3 comments
Open

Assets plugin ideas #281

philnash opened this issue Jun 18, 2021 · 3 comments

Comments

@philnash
Copy link
Contributor

This issue is a bucket of ideas for the Assets plugin as I think of them. Please add other ideas.

Asset permissions

Initially all assets are uploaded as public. I can see an argument for creating protected assets (audio files for use during calls, for example). Could do this with a flag twilio assets:upload file.ext --protected. I can't see a reason you would want a private asset in a service that only has assets.

Asset deletion

This can be done with the Twilio CLI using the service SID and asset SID, but we could make it easier.

Service deletion

This can be done with the CLI too, but that would not remove the SID from the plugin config. This should come with a serious confirmation step to ensure that is definitely what the user intends.

@philnash
Copy link
Contributor Author

Upload multiple assets

It might be useful to be able to upload and deploy multiple assets at the same time. If a --protected flag is added, as above, it would apply to all assets uploaded at one time.

@dkundel
Copy link
Member

dkundel commented Jun 23, 2021

Download Assets

There is no /Contents API for Assets today but in theory this is just a glorified curl since Assets are public. If we end up adding protected support then this could also generate a valid X-Twilio-Signature to download said asset back onto the hard-drive.

This could especially be powerful if it would support a glob syntax such as:

twilio assets:download *.mp3

Bonus if it detects process.stdout.isTTY === false and writes the file to process.stdout so that you can:

twilio assets:download index.html | grep h1

# or
twilio assets:download index.html > backup.html

Support for Name property

The name on your hard drive might contain sensitive information. It would be great to pass --path or --name to rename the asset when uploaded or even provide a a nested path.

Dynamic Upload from Stream

Rather than only supporting uploading files that are coming straight from your hard-drive it could be useful to upload things that are being passed in via the process.stdin through piping. For example:

wget https://demo.twilio.com/docs/classic.mp3 | twilio assets:upload --name special-song.mp3

@gbshahaq
Copy link

I see that the issue i logged is covered in here - downloading assets is still not a thing. even on the roadmap?
#460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants