Rocket.Chat.Apps-engine
Rocket.Chat.Apps-engine copied to clipboard
Allow Apps to read their own files
Apps may need to read their own files. It allows the apps to have more assets and abilities. Some possible use cases:
- Storing text asset files
- Storing image/video files
- Storing template file (message template, response template)
So, how would you propose packaging these files up and enabling Apps to access them? What sort of API are you thinking? If you can do pseudo code or even come up with an example, that would be great and helpful!
for the moment I am thinking of the AppStorageBridge
. We already had the AppSourceStorage
, we just need to expose the possibility to read the app's file via IRead
accessor.
Okay, so the compiler currently does not compile images except for the logo in the zip file. This was done intentionally since the Apps Engine does not currently support this feature.
How would you recommend the compiler (CLI and compiler) to know which images/assets to include? Do we add an assets
property to the app.json
file so the developer tells the compiler which folder to include?
Yes, assets prop is ideal. I have my own apps cli and it is using the same method to include assets
Hint, mine uses assets as an array of glob strings
Okay, so interesting enough there's already the concept of Assets in the Apps Engine...but I fail to see where Apps can access the assets declared.
Here's it in the app.json
schema
https://github.com/RocketChat/Rocket.Chat.Apps-engine/blob/b57424880a765db657b2130076289901806935f7/src/definition/app-schema.json#L69-L72
And here it is in the definition https://github.com/RocketChat/Rocket.Chat.Apps-engine/blob/b57424880a765db657b2130076289901806935f7/src/definition/assets/index.ts#L1-L4
From the commit messages, I am realizing that these are left over from the initial concept phase of the entire Apps system (https://github.com/RocketChat/Rocket.Chat.Apps-ts-definition/commits/master/src/assets). They were never actually implemented 😬
oh, cool. I've never seen it. So there's could be a chance to have it implemented