diff --git a/resources/examples/Fixes/all_contain b/resources/examples/Fixes/all_contain new file mode 100644 index 0000000..491b0ce --- /dev/null +++ b/resources/examples/Fixes/all_contain @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22All+listed+animals+have+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Not+all+listed+animals+have+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/all_equal b/resources/examples/Fixes/all_equal new file mode 100644 index 0000000..356cabc --- /dev/null +++ b/resources/examples/Fixes/all_equal @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22Only+humans%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22None+or+not+only+humans%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/all_match b/resources/examples/Fixes/all_match new file mode 100644 index 0000000..3cb15f2 --- /dev/null +++ b/resources/examples/Fixes/all_match @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+all_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C%22All+of+the+listed+matched+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+did+not+match+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/any_contain b/resources/examples/Fixes/any_contain new file mode 100644 index 0000000..282d4a5 --- /dev/null +++ b/resources/examples/Fixes/any_contain @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22At+least+one+listed+animal+has+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Not+one+of+the+listed+animals+has+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/any_equal b/resources/examples/Fixes/any_equal new file mode 100644 index 0000000..3aea848 --- /dev/null +++ b/resources/examples/Fixes/any_equal @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22At+least+one+human%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22No+humans%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/any_match b/resources/examples/Fixes/any_match new file mode 100644 index 0000000..26b400b --- /dev/null +++ b/resources/examples/Fixes/any_match @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+matched+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22None+of+the+listed+did+match+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/array b/resources/examples/Fixes/array new file mode 100644 index 0000000..c2046a1 --- /dev/null +++ b/resources/examples/Fixes/array @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Turns+all+keys+and+values+of+an+object+into+a+list/array%0Aarray%28%22example1%22%29%0Acopy_field%28%22example1%22%2C%22example2%5B%5D%22%29%0A&data=%7B%0A++%22example1%22+%3A+%7B%0A++++%22key%22+%3A+%22word%22%2C%0A++++%22test%22+%3A+%22case%22%0A++%7D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/count b/resources/examples/Fixes/count new file mode 100644 index 0000000..0d3f97a --- /dev/null +++ b/resources/examples/Fixes/count @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Counts+array%0Acount%28%22keyword%5B%5D%22%29%0A&data=%7B%0A++%22keyword%22+%3A+%5B%0A++++%22I%22%2C%0A++++%22describe%22%2C%0A++++%22something%21%22%0A++%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/do list_as b/resources/examples/Fixes/do list_as new file mode 100644 index 0000000..dc8b9bd --- /dev/null +++ b/resources/examples/Fixes/do list_as @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=%23+Iterates+over+different+arrays+and+one+can%0A%23+manipulate+the+same+index+pos+of+each+array%0A%23+at+the+same+time.%0A%0Ado+list_as%28aut%3A+%22author%5B%5D%22%2C+aff%3A+%22affiliation%5B%5D%22%29%0A++copy_field%28%22aff%22%2C%22aut.affiliation%22%29%0Aend%0A%0Aretain%28%22author%5B%5D%22%29&data=%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22name%22%3A+%22Test+Team%22%2C%0A++++++%22@type%22%3A+%22Organization%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Maxi+Muster%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Sally+Sample%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%0A++%5D%2C%0A++%22affiliation%22%3A+%5B%0A++++%22Org1%22%2C%22City2%22%2C%22Uni3%22%0A++%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/exists b/resources/examples/Fixes/exists new file mode 100644 index 0000000..ed84d6e --- /dev/null +++ b/resources/examples/Fixes/exists @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=do+list%28path%3A%22author%5B%5D%22%29%0A++%23+Checks+if+element+exists%0A++unless+exists%28%22@type%22%29%0A++++add_field%28%22@type%22%2C%22undefined%22%29%0A++end%0Aend%0A%0A&data=%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22name%22%3A+%22Test+Team%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Maxi+Muster%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Sally+Sample%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%0A++%5D%0A%7D%0A%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22@type%22%3A+%22Person%22%2C%0A++++++%22name%22%3A+%22J%C3%BCrgen+Meta%22%0A++++%7D%0A++%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/hash b/resources/examples/Fixes/hash new file mode 100644 index 0000000..61067a2 --- /dev/null +++ b/resources/examples/Fixes/hash @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Turns+array+into+hash/object+with+keys+and+values+depending+on+the+incoming+order%2C+first+key+second+value.%0Ahash%28%22example1%22%29%0Ahash%28%22example2%5B%5D%22%29%0Acopy_field%28%22example2%5B%5D%22%2C%22example3%22%29&data=%7B%0A++%22example1%22+%3A+%22key%22%2C%0A++%22example1%22+%3A+%22word%22%2C%0A++%22example1%22+%3A+%22test%22%2C%0A++%22example1%22+%3A+%22case%22%2C%0A++%22example2%22+%3A+%5B+%22key%22%2C+%22word%22%2C+%22test%22%2C+%22case%22+%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/if-elsif-else-conditionals b/resources/examples/Fixes/if-elsif-else-conditionals new file mode 100644 index 0000000..5746f3f --- /dev/null +++ b/resources/examples/Fixes/if-elsif-else-conditionals @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+any_contain%28%22animal%5B%5D%22%2C%22butterfly%22%29%0A++add_field%28%22note%22%2C%22Nice%22%29%0Aelsif+all_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22We+are+doomed%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Lets+try%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/in b/resources/examples/Fixes/in new file mode 100644 index 0000000..4403cb9 --- /dev/null +++ b/resources/examples/Fixes/in @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=do+list%28path%3A%22concept%5B%5D%22%2C%22var%22%3A%22%24i%22%29%0A++%23+Checks+if+value+of+element+is+equal+to+value+in+target+element%28s%29%0A++unless+in%28%22%24i%22%2C%22keyword%5B%5D%22%29%0A++++copy_field%28%22%24i%22%2C%22keyword%5B%5D.%24append%22%29%0A++end%0Aend%0A%0A&data=%7B%0A++%22keyword%22%3A+%5B%0A++++%22Key1%22%2C%22Key2%22%0A++%5D%2C%0A++%22concept%22%3A+%5B%0A++++%22Key1%22%2C%22Con1%22%2C%22Con2%22%0A++%5D%0A%7D%0A%0A \ No newline at end of file diff --git a/resources/examples/Fixes/is_array b/resources/examples/Fixes/is_array new file mode 100644 index 0000000..4e7610b --- /dev/null +++ b/resources/examples/Fixes/is_array @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7C+fix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=%23+Useful+to+test+elements+of+formats+without+arrays+if+an+element+is+repeated+or+not.+Since+MF+turns+them+into+arrays%0A%0Aif+is_array%28%22field1%22%29%0A++++add_field%28%22note1%22%2C%22Field1+is+an+array/list%21%22%29%0Aelse%0A++++add_field%28%22note1%22%2C%22Field1+is+not+an+array/list%21%22%29%0Aend%0A%0Aif+is_array%28%22field2%22%29%0A++++add_field%28%22note2%22%2C%22Field2+is+an+array/list%21%22%29%0Aelse%0A++++add_field%28%22note2%22%2C%22Field2+is+not+an+array/list%21%22%29%0Aend&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cfield1%3Ea%3C/field1%3E%0A++++%3Cfield1%3Eb%3C/field1%3E%0A++++%3Cfield2%3Ea%3C/field2%3E%0A%3C/record%3E \ No newline at end of file diff --git a/resources/examples/Fixes/is_empty b/resources/examples/Fixes/is_empty new file mode 100644 index 0000000..6a1c9ab --- /dev/null +++ b/resources/examples/Fixes/is_empty @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7C+fix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_empty%28%22field1%22%29%0A++++add_field%28%22note1%22%2C%22Field1+is+empty%22%29%0Aelse%0A++++add_field%28%22note1%22%2C%22Field1+is+not+empty%22%29%0Aend%0A%0Aif+is_empty%28%22field2%22%29%0A++++add_field%28%22note2%22%2C%22Field2+is+empty%22%29%0Aelse%0A++++add_field%28%22note2%22%2C%22Field2+is+not+empty%22%29%0Aend&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cfield1%3Ea%3C/field1%3E%0A++++%3Cfield1%3Eb%3C/field1%3E%0A++++%3Cfield2+/%3E%0A%3C/record%3E \ No newline at end of file diff --git a/resources/examples/Fixes/is_false b/resources/examples/Fixes/is_false new file mode 100644 index 0000000..79a81f6 --- /dev/null +++ b/resources/examples/Fixes/is_false @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_false%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+is+true+%28because+value+is+false+or+0%29%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+is+not+true+%28because+value+is+not+false+or+0%29%21%22%29%0Aend&data=%7B%0A++%22test%22%3A+%22true%22%0A%7D%0A%7B%0A++%22test%22%3A+%221%22%0A%7D%0A%7B%0A++%22test%22%3A+%22false%22%0A%7D%0A%7B%0A++%22test%22%3A+%22other%22%0A%7D%0A%7B%0A++%22test%22%3A+%220%22%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/is_string b/resources/examples/Fixes/is_string new file mode 100644 index 0000000..b6cd33b --- /dev/null +++ b/resources/examples/Fixes/is_string @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_string%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+value+is+a+string+%28and+not+a+number%29%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+value+is+not+a+string%22%29%0Aend&data=%7B%0A++%22test%22%3A+%2299%22%0A%7D%0A%7B%0A++%22test%22%3A+%22string%22%0A%7D%0A%7B%0A++%22test%22%3A+%7B%0A++++%22subfield%22+%3A+%22value%22%0A++%7D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/is_true b/resources/examples/Fixes/is_true new file mode 100644 index 0000000..5f152a8 --- /dev/null +++ b/resources/examples/Fixes/is_true @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+is_true%28%22test%22%29%0A++add_field%28%22note%22%2C%22Test+is+true%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22Test+is+not+true%21%22%29%0Aend&data=%7B%0A++%22test%22%3A+%22true%22%0A%7D%0A%7B%0A++%22test%22%3A+%221%22%0A%7D%0A%7B%0A++%22test%22%3A+%22false%22%0A%7D%0A%7B%0A++%22test%22%3A+%22other%22%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/none_contain b/resources/examples/Fixes/none_contain new file mode 100644 index 0000000..46b9d24 --- /dev/null +++ b/resources/examples/Fixes/none_contain @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_contain%28%22animal%5B%5D%22%2C%22o%22%29%0A++add_field%28%22note%22%2C%22None+of+the+listed+animals+has+an+o%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+animals+has+an+o%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/none_equal b/resources/examples/Fixes/none_equal new file mode 100644 index 0000000..6c9694f --- /dev/null +++ b/resources/examples/Fixes/none_equal @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_equal%28%22animal%5B%5D%22%2C%22human%22%29%0A++add_field%28%22note%22%2C%22No+humans%21%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+human%21%22%29%0Aend&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/none_match b/resources/examples/Fixes/none_match new file mode 100644 index 0000000..197d728 --- /dev/null +++ b/resources/examples/Fixes/none_match @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=if+none_match%28%22animal%5B%5D%22%2C%22.%2Ao.%2A%22%29%0A++add_field%28%22note%22%2C+%22None+of+the+listed+did+match+the+pattern%22%29%0Aelse%0A++add_field%28%22note%22%2C%22At+least+one+of+the+listed+matched+the+pattern%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22cat%22%2C%22bird%22%2C%22butterfly%22%0A++%5D%0A%7D%0A%7B%0A++%22animal%22%3A+%5B%0A++++%22human%22%2C+%22turkey%22%2C+%22bear%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/parse_text b/resources/examples/Fixes/parse_text new file mode 100644 index 0000000..096b329 --- /dev/null +++ b/resources/examples/Fixes/parse_text @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Parses+a+text+into+an+array/list+or+hash+of+values.%0A%0Aparse_text%28%22date1%22%2C%22%28\\d%7B4%7D%29-%28\\d%7B2%7D%29-%28\\d%7B2%7D%29%22%29%0Acopy_field%28%22date1%22%2C%22date3%5B%5D%22%29%0A%0A%23+Parses+a+text+into+an+hash+of+values.%0Aparse_text%28%22date2%22%2C%22%28%3F%3Cyear%3E\\d%7B4%7D%29-%28%3F%3Cmonth%3E\\d%7B2%7D%29-%28%3F%3Cday%3E\\d%7B2%7D%29%22%29&data=%7B%0A++%22date1%22+%3A+%221918-11-11%22%2C%0A++%22date2%22+%3A+%222024-03-19%22+%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/random b/resources/examples/Fixes/random new file mode 100644 index 0000000..2ff7e7e --- /dev/null +++ b/resources/examples/Fixes/random @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Arandom%28%22randomValue%22%2C%22100%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/reverse b/resources/examples/Fixes/reverse new file mode 100644 index 0000000..16cb746 --- /dev/null +++ b/resources/examples/Fixes/reverse @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Areverse%28%22key%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/set_hash b/resources/examples/Fixes/set_hash new file mode 100644 index 0000000..aca1188 --- /dev/null +++ b/resources/examples/Fixes/set_hash @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+hash+and+a+hash+with+certain+subfields%0Aset_hash%28%22object1%22%29%0Aset_hash%28%22object2%22%2C+%22subfieldName1%22%3A+%22value1%22+%2C+%22subfieldName2%22%3A+%22value2%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/str_contain b/resources/examples/Fixes/str_contain new file mode 100644 index 0000000..d81d31e --- /dev/null +++ b/resources/examples/Fixes/str_contain @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22alue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_contain%28%22testValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/str_equal b/resources/examples/Fixes/str_equal new file mode 100644 index 0000000..ed62d45 --- /dev/null +++ b/resources/examples/Fixes/str_equal @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22testValue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_equal%28%22testValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note1%22%2C%22Test+true%22%29%0Aend%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_equal%28%22notestValue%22%2C%22%24%5Btest%5D%22%29+%0A++add_field%28%22note2%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/str_match b/resources/examples/Fixes/str_match new file mode 100644 index 0000000..93d07d9 --- /dev/null +++ b/resources/examples/Fixes/str_match @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-yaml%0A%7Cprint%0A%3B&transformation=put_var%28%22test%22%2C%22testValue%22%29%0A%0A%23+Useful+when+testing+variables+and+if+the+variable+is+dynamic+either+due+to+changes+in+the+fix+or+configuration+in+the+flus+workflow.%0Aif+str_match%28%22%24%5Btest%5D%22%2C%22.%2AVal.%2A%22%29+%0A++add_field%28%22note%22%2C%22Test+true%22%29%0Aend%0A&data=%7B%0A++%22animal%22%3A+%5B%0A++++%22dog%22%2C%22monkey%22%2C%22parrot%22%0A++%5D%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/substring b/resources/examples/Fixes/substring new file mode 100644 index 0000000..7198ccc --- /dev/null +++ b/resources/examples/Fixes/substring @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=substring%28%22test%22%2C%220%22%2C%223%22%29&data=%7B%0A++%22test%22+%3A+%22keyword%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/sum b/resources/examples/Fixes/sum new file mode 100644 index 0000000..5a22e48 --- /dev/null +++ b/resources/examples/Fixes/sum @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=sum%28%22numbers%5B%5D%22%29%0A&data=%7B%0A++%22numbers%22+%3A+%5B+%2241%22%2C+%2242%22%2C+%226%22%2C+%226%22+%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/timestamp b/resources/examples/Fixes/timestamp new file mode 100644 index 0000000..ac2ad4e --- /dev/null +++ b/resources/examples/Fixes/timestamp @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Atimestamp%28%22date%22%2Cformat%3A+%22yyyy.MM.dd+G+%27at%27+HH%3Amm%3Ass+z%22%2C+language%3A%22de%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/to_base64 b/resources/examples/Fixes/to_base64 new file mode 100644 index 0000000..8ca04b7 --- /dev/null +++ b/resources/examples/Fixes/to_base64 @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Transforms+the+value+to+base64+hash%0Ato_base64%28%22key%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/to_json b/resources/examples/Fixes/to_json new file mode 100644 index 0000000..a78ffe6 --- /dev/null +++ b/resources/examples/Fixes/to_json @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-literals%0A%7Cprint%0A%3B&transformation=to_json%28%22author%5B%5D%22%29%0Amove_field%28%22author%5B%5D%22%2C%22authorJsonValue%22%29%0A%0A%0A&data=%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22name%22%3A+%22Test+Team%22%2C%0A++++++%22@type%22%3A+%22Organization%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Maxi+Muster%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%2C%0A++++%7B%0A++++++%22name%22%3A+%22Sally+Sample%22%2C%0A++++++%22@type%22%3A+%22Person%22%0A++++%7D%0A++%5D%0A%7D%0A%7B%0A++%22author%22%3A+%5B%0A++++%7B%0A++++++%22@type%22%3A+%22Person%22%2C%0A++++++%22name%22%3A+%22J%C3%BCrgen+Meta%22%0A++++%7D%0A++%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/uri_encode b/resources/examples/Fixes/uri_encode new file mode 100644 index 0000000..94bffe4 --- /dev/null +++ b/resources/examples/Fixes/uri_encode @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=uri_encode%28%22test%22%2C+plus_for_space%3A%22false%22%2C+safe_chars%3A%22%22%29&data=%7B%0A++%22test%22+%3A+%22%C3%84+\%22+%C3%96+Test%22%0A%7D%0A \ No newline at end of file