Skip to content

Commit

Permalink
fix: Extend listFolderContentsFromPath to include launches pointing t…
Browse files Browse the repository at this point in the history
…o download blueprint
  • Loading branch information
jezhiggins committed Jun 20, 2020
1 parent 60bb00c commit fb0b9e7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/blueprints/localfilestorage-blueprint/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"namespace": "tymly",
"name": "localfilestorage-blueprint",
"version": "1.0.0",
"label": "",
"organisation": "West Midlands Fire Service",
"description": "Support for local file storage",
"categories": [],
"meta": {
"generatedOn": "20/06/20, 09:36:23",
"generatedWith":"@wmfs/tymly-scaffold 0.0.0-semantically-released",
"domains": [
"general"
]
}
}
1 change: 1 addition & 0 deletions lib/blueprints/localfilestorage-blueprint/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// placeholder, here simply so we can resolve the module
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Comment": "Download a file from local file storage",
"name": "Download File",
"version": "1.0",
"categories": [],
"StartAt": "CopyLocally",
"States": {
"CopyLocally": {
"Type": "Succeed"
}
},
"restrictions": [
{
"roleId": "$authenticated",
"allows": [
"*"
]
}
]
}
11 changes: 10 additions & 1 deletion lib/components/services/localfilestorage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ class LocalFilestorage {
const contents = (await fsp.readdir(rootedPath, { withFileTypes: true }))
.filter(content => content.isFile() || content.isDirectory())
.map(content => {
return { Name: content.name }
return {
Name: content.name,
launches: [{
stateMachineName: 'tymly_downloadFromLocalFileStorage_1_0',
title: 'Download',
input: {
name: content.name
}
}]
}
})

return contents
Expand Down

0 comments on commit fb0b9e7

Please sign in to comment.