-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Milestone
Description
Summary
Creating complex recipes often ends up being much more complicated than it has to be because we lack expressive output types.
Example: files
Zipping and unzipping files produces HTML output, which is very useful as an end state but not good when it is in the middle of a recipe. What I usually end up doing is strip HTML and then a find replace.
Example: PGP encryption
For both testing internally, and composing operations in the UI, having structured output here would be really useful.
Proposed solution
Compound types
Type: File
Attributes:
- String Name
- Date Modified
- Bytes Contents
Operation: Unzip
Input: Bytes
Output: List<File>
Operation: Display files
Input: List<File>
Output: HTML
Operation: Generate PGP Key pair
Input: Ignored
Output: Map<String, String>
Example output:
{
"Public Key": "-----BEGIN...",
"Private Key": "-----BEGIN..."
}
Operations could have an intrinsic toString or showOperation property in the case that the operation is the last operation in the recipe.
An example recipe to hash first file in a zip file
Unzip
Get element from list ( index = 0) // first file
Get contents from file
SHA2
An example with registers and a new unregister operation
Operation: Unregister
Input: Ignored
Output: String
Arguments:
- Output format (Text)
Outputs the contents of registers according to the format
Unzip
Get element from list ( index = 0) // first file
Get contents from file
Register ( Extractor = "(.*)" ) // contents to $R0
Generate PGP Key
Extract value from Map ( key = "Private key")
Register ( Extractor = "(.*)" ) // contents to $R1
Unregister ( Format = "$R0" ) // file from above now the input to next operatioin
PGP Sign ( Private key = "$R1" ) // sign unzipped file using private key
Register ( Extractor = "(.*)" ) // signed file now in $R2
Unregister ( Format =
"
Signed file
$R2
File
$R0
Private key
$R1
"
)
This is still a little bit half-baked in my head, and I would love your thoughts and feedback.
n1474335
Metadata
Metadata
Assignees
Labels
No labels