Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created December 2, 2019 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenmothersele/d59d0a6a7ab97760f0a372d3931cd1e8 to your computer and use it in GitHub Desktop.
Save darrenmothersele/d59d0a6a7ab97760f0a372d3931cd1e8 to your computer and use it in GitHub Desktop.
Local Files adapter for Kendraio App
{
"adapterName": "local-files",
"label": "Local Files",
"description": null,
"infoUrl": null,
"supportUrl": null,
"maintainer": null,
"version": "0.0.0",
"tags": [],
"name": "local-files",
"modified": true,
"workflow": [
{
"workflowId": "saveFile",
"title": "Save File",
"adapterName": "local-files",
"modified": true,
"config": "configs/saveFile.json"
},
{
"workflowId": "listFiles",
"title": "List Files",
"adapterName": "local-files",
"modified": true,
"config": "configs/listFiles.json"
}
],
"database": [],
"forms": [],
"attachments": {
"configs/saveFile.json": {
"workflowId": "saveFile",
"title": "Save File",
"adapterName": "local-files",
"blocks": [
{
"type": "form",
"jsonSchema": {
"type": "object",
"properties": {
"imageFile": {
"type": "string",
"title": "Image file"
},
"title": {
"type": "string",
"title": "Image title"
}
}
},
"uiSchema": {
"imageFile": {
"ui:widget": "file"
}
}
},
{
"type": "debug",
"open": 1,
"showContext": false
},
{
"type": "db",
"operation": "add",
"adapterName": "local-files",
"schema": "files"
},
{
"type": "launch",
"adapter": "local-files",
"workflowId": "listFiles"
}
],
"modified": true
},
"configs/listFiles.json": {
"workflowId": "listFiles",
"title": "List Files",
"adapterName": "local-files",
"blocks": [
{
"type": "init"
},
{
"type": "db",
"operation": "get",
"adapterName": "local-files",
"schema": "files"
},
{
"type": "debug",
"open": 1,
"showContext": false
},
{
"type": "grid",
"gridOptions": {
"rowSelection": "single"
}
},
{
"type": "mapping",
"mapping": "data[0]"
},
{
"type": "read-file",
"readMode": "dataUrl",
"fileGetter": "data.imageFile",
"mode": "update",
"skipFirst": true
},
{
"type": "debug",
"open": 1,
"showContext": false
},
{
"type": "template",
"template": "<img src='{{ data.file.result }}'/>"
}
],
"modified": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment