You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prerequisites - Installing the layout in TypeRefinery
The final layout with two new block definitions at the bottom of the palette on the left (underlined in yellow)
As a prerequisite open TypeRefinery with a default project, one must have your local copy of the brett_blocks repo open in an IDE, and a TypeRefinery worksheet based on the default project (custom Connection blocks cannot connect to a custom Connection object, so a hack is used)
Create a new Send Data Trigger: Drag a Send Data trigger block to the canvas
Create a new URL block: Drag a green Code block to the canvas. Richt-click the block and select Edit. Separately, copy the contents of the ui_code,html, replace all of the existing code inside the Edit code window, and press submit. Delete the block you were working on and check the pallete, and there is a new URL block there, drag it and drop it to the canvase. Finally, right-click the new URL object and select Configure, copy the contents of javascript code file and replace the existing javascript code in the Code block, and press the Apply button
Create a New Connection Block: Drag a API Datastore Connection" block onto the canvas, right click it and ensure the correct datastore is selected
Create a new StixORM Import Bundle Block: Drag a "Run (Nodes and Edges)" block onto the canvas, right-click on the object and select Edit. Separately, copy the contents of the ui_code.html file, and then replace all of the existing code. Press the Submit button, and a new block will appear on the palette. Drag on a new StixORM Import Bundle block from the palette on the left, right-click it and select Configure. Separately copy the contents of the script.py file and replace the current block code. Open the config,json file, and ensure your Requirements field matches the contents in the file.
Finally, drag on a Print and a Print JSON block. Connect the blocks so that
Send Data -> Connection
Send Data -> URL
URL -> StixORM.URL
Connection -> StixORM.Connection
URL -> Print
StixORM.output -> Print (JSON)
Press the Run Button on the Send Data block, and the process will fail, In fact, the StixORM block reacts far more quickly and fails, than the block does in its test harness, where the request(url) takes some time before it succeeds
Expected Behavior
The Expected Behaviour can be demonstrated by the test harness, in the local brett_blocks repo, assuming Poetry was used to install all of the dependencies. Ensuring that a copy of TypeRefinery is running locally on localhost, port 1729. Then running the method try_import_bundle(), pauses for a few second to make the https call, and then writes out an output.json file in the root, where the standard TypeDB ORM Result Object List format (an object-by-object list) shows the Python function works perfectly
Current Behavior
Running that same code, and the block does not wait for the requests library to get a response, and instead fails with the following json output, instead of the Results List format that was expected.
Prerequisites - Installing the layout in TypeRefinery
The final layout with two new block definitions at the bottom of the palette on the left (underlined in yellow)
As a prerequisite open TypeRefinery with a default project, one must have your local copy of the brett_blocks repo open in an IDE, and a TypeRefinery worksheet based on the default project (custom Connection blocks cannot connect to a custom Connection object, so a hack is used)
Expected Behavior
The Expected Behaviour can be demonstrated by the test harness, in the local brett_blocks repo, assuming Poetry was used to install all of the dependencies. Ensuring that a copy of TypeRefinery is running locally on localhost, port 1729. Then running the method try_import_bundle(), pauses for a few second to make the https call, and then writes out an output.json file in the root, where the standard TypeDB ORM Result Object List format (an object-by-object list) shows the Python function works perfectly
Current Behavior
Running that same code, and the block does not wait for the requests library to get a response, and instead fails with the following json output, instead of the Results List format that was expected.
{ "error":"false" "script.name":"req-1691818469.520285.99984.py" "script":"C:\Users\brett\AppData\Roaming\TypeRefinery\services\fastapi\generated\algorithm\req-1691818469.520285.99984.py" "script.exists":"True" "script.url":"/algorithm/req-1691818469.520285.99984.py/script" "output":"C:\Users\brett\AppData\Roaming\TypeRefinery\services\fastapi\generated\algorithm\req-1691818469.520285.99984.py.output" "output.exists":"False" "output.url":"/algorithm/req-1691818469.520285.99984.py/output" "log":"C:\Users\brett\AppData\Roaming\TypeRefinery\services\fastapi\generated\algorithm\req-1691818469.520285.99984.py.log" "log.exists":"True" "log.url":"/algorithm/req-1691818469.520285.99984.py/log" "return.output":"output" "Access-Control-Expose-Headers":"output.url,output.exists,output" }
The text was updated successfully, but these errors were encountered: