writer 0.8.3rc4__py3-none-any.whl → 1.25.1rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- writer/__init__.py +1 -1
- writer/abstract.py +1 -1
- writer/{ai.py → ai/__init__.py} +867 -163
- writer/app_runner.py +596 -241
- writer/app_templates/default/.wf/components-blueprints_blueprint-0-0decp3w5erhvl0nw.jsonl +11 -0
- writer/app_templates/default/.wf/components-blueprints_root.jsonl +1 -0
- writer/app_templates/default/.wf/components-page-0-c0f99a9e-5004-4e75-a6c6-36f17490b134.jsonl +27 -0
- writer/app_templates/default/.wf/components-root.jsonl +1 -0
- writer/app_templates/default/.wf/components-workflows_root.jsonl +1 -0
- writer/app_templates/default/.wf/components-workflows_workflow-0-lfltcky7l1fsm6j2.jsonl +1 -0
- writer/app_templates/default/.wf/metadata.json +3 -0
- writer/app_templates/default/README.md +3 -0
- writer/app_templates/default/main.py +16 -0
- writer/app_templates/default/requirements.txt +1 -0
- writer/app_templates/default/static/README.md +8 -0
- writer/app_templates/default/static/agent_builder_demo.png +0 -0
- writer/app_templates/default/static/favicon.png +0 -0
- writer/app_templates/hello/.wf/components-blueprints_blueprint-0-t84xyhxau9ej3823.jsonl +18 -0
- writer/app_templates/hello/.wf/components-blueprints_root.jsonl +1 -0
- writer/app_templates/hello/.wf/components-page-0-c0f99a9e-5004-4e75-a6c6-36f17490b134.jsonl +15 -0
- writer/app_templates/hello/.wf/components-root.jsonl +1 -0
- writer/app_templates/hello/.wf/metadata.json +3 -0
- writer/app_templates/hello/main.py +16 -0
- writer/app_templates/hello/static/README.md +8 -0
- writer/app_templates/hello/static/favicon.png +0 -0
- writer/app_templates/hello/static/welcome.svg +40 -0
- writer/auth.py +7 -2
- writer/autogen.py +352 -0
- writer/blocks/__init__.py +51 -17
- writer/blocks/addtostatelist.py +10 -9
- writer/blocks/apitrigger.py +45 -0
- writer/blocks/base_block.py +332 -21
- writer/blocks/base_trigger.py +14 -0
- writer/blocks/calleventhandler.py +39 -35
- writer/blocks/changepage.py +48 -0
- writer/blocks/code.py +102 -0
- writer/blocks/crontrigger.py +49 -0
- writer/blocks/foreach.py +70 -53
- writer/blocks/httprequest.py +112 -99
- writer/blocks/ifelse.py +71 -0
- writer/blocks/logmessage.py +34 -39
- writer/blocks/parsejson.py +30 -29
- writer/blocks/returnvalue.py +7 -7
- writer/blocks/runblueprint.py +63 -0
- writer/blocks/setstate.py +43 -33
- writer/blocks/sharedblueprint.py +86 -0
- writer/blocks/uieventtrigger.py +49 -0
- writer/blocks/writeraddchatmessage.py +50 -12
- writer/blocks/writeraddtokg.py +38 -11
- writer/blocks/writeraskkg.py +123 -0
- writer/blocks/writerchat.py +80 -61
- writer/blocks/writerchatreply.py +279 -0
- writer/blocks/writerchatreplywithtoolconfig.py +393 -0
- writer/blocks/writerclassification.py +78 -39
- writer/blocks/writercompletion.py +49 -44
- writer/blocks/writerfileapi.py +85 -0
- writer/blocks/writerinitchat.py +24 -12
- writer/blocks/writerkeyvaluestorage.py +106 -0
- writer/blocks/writernocodeapp.py +35 -37
- writer/blocks/writerparsepdf.py +73 -0
- writer/blocks/writerstructuredoutput.py +105 -0
- writer/blocks/writertoolcalling.py +251 -0
- writer/blocks/writervision.py +141 -0
- writer/blocks/writerwebsearch.py +175 -0
- writer/blueprints.py +839 -0
- writer/command_line.py +52 -16
- writer/core.py +562 -290
- writer/core_ui.py +6 -2
- writer/evaluator.py +98 -46
- writer/journal.py +227 -0
- writer/keyvalue_storage.py +93 -0
- writer/logs.py +277 -0
- writer/serve.py +625 -327
- writer/ss_types.py +101 -12
- writer/static/assets/Arrow.dom-GBJpMYQS.js +1 -0
- writer/static/assets/BaseMarkdown-Wrvby5J8.js +1 -0
- writer/static/assets/BlueprintToolbar-BuXNRxWT.js +1 -0
- writer/static/assets/BlueprintToolbar-wpfX0jo_.css +1 -0
- writer/static/assets/BuilderApp-PTOI76jZ.js +8 -0
- writer/static/assets/BuilderApp-WimUfNZr.css +1 -0
- writer/static/assets/BuilderApplicationSelect-DXzy4e_h.js +7 -0
- writer/static/assets/BuilderApplicationSelect-XaM1D5fv.css +1 -0
- writer/static/assets/BuilderBlueprintLibraryPanel-Ckrhknlh.css +1 -0
- writer/static/assets/BuilderBlueprintLibraryPanel-DBDzhTlc.js +1 -0
- writer/static/assets/BuilderEmbeddedCodeEditor-B0bcjlhk.css +1 -0
- writer/static/assets/BuilderEmbeddedCodeEditor-Dn7eDICN.js +726 -0
- writer/static/assets/BuilderGraphSelect-C-LRsO8W.js +7 -0
- writer/static/assets/BuilderGraphSelect-D7B61d5s.css +1 -0
- writer/static/assets/BuilderInsertionLabel-BhyL9wgn.js +1 -0
- writer/static/assets/BuilderInsertionLabel-_YS5WPfq.css +1 -0
- writer/static/assets/BuilderInsertionOverlay-D2XS0ij9.css +1 -0
- writer/static/assets/BuilderInsertionOverlay-MkAIVruY.js +1 -0
- writer/static/assets/BuilderJournal-A0LcEwGI.js +7 -0
- writer/static/assets/BuilderJournal-DHv3Pvvm.css +1 -0
- writer/static/assets/BuilderModelSelect-CdSo_sih.js +7 -0
- writer/static/assets/BuilderModelSelect-Dc4IPLp2.css +1 -0
- writer/static/assets/BuilderSettings-BDwZBveu.js +16 -0
- writer/static/assets/BuilderSettings-lZkOXEYw.css +1 -0
- writer/static/assets/BuilderSettingsArtifactAPITriggerDetails-3O6jKBXD.js +4 -0
- writer/static/assets/BuilderSettingsArtifactAPITriggerDetails-DnX66iRg.css +1 -0
- writer/static/assets/BuilderSettingsDeploySharedBlueprint-BR_3ptsd.js +1 -0
- writer/static/assets/BuilderSettingsDeploySharedBlueprint-KJTl8gxP.css +1 -0
- writer/static/assets/BuilderSettingsHandlers-CBtEQFSo.js +1 -0
- writer/static/assets/BuilderSettingsHandlers-DJPeASfz.css +1 -0
- writer/static/assets/BuilderSidebarComponentTree-DLltgas5.js +1 -0
- writer/static/assets/BuilderSidebarComponentTree-DYu1F793.css +1 -0
- writer/static/assets/BuilderSidebarToolkit-CApZNTAq.js +7 -0
- writer/static/assets/BuilderSidebarToolkit-CwqbjRv8.css +1 -0
- writer/static/assets/BuilderTemplateEditor-CYSDeWgV.css +1 -0
- writer/static/assets/BuilderTemplateEditor-DnRDRcA0.js +87 -0
- writer/static/assets/BuilderVault-2vGoV0sx.js +1 -0
- writer/static/assets/BuilderVault-Cx6oQSES.css +1 -0
- writer/static/assets/ComponentRenderer-72hqvEvI.css +1 -0
- writer/static/assets/ComponentRenderer-D4Pj1i3s.js +1 -0
- writer/static/assets/SharedCopyClipboardButton-BipJKGtz.css +1 -0
- writer/static/assets/SharedCopyClipboardButton-DNI9kLe6.js +1 -0
- writer/static/assets/WdsCheckbox-DKvpPA4D.css +1 -0
- writer/static/assets/WdsCheckbox-edQcn1cf.js +1 -0
- writer/static/assets/WdsDropdownMenu-CzzPN9Wg.css +1 -0
- writer/static/assets/WdsDropdownMenu-DQnrRBNV.js +1 -0
- writer/static/assets/WdsFieldWrapper-Cmufx5Nj.js +1 -0
- writer/static/assets/WdsFieldWrapper-CsemOh8D.css +1 -0
- writer/static/assets/WdsTabs-DKj7BqI0.css +1 -0
- writer/static/assets/WdsTabs-DcfY_zn5.js +1 -0
- writer/static/assets/abap-D8nrxEjS.js +6 -0
- writer/static/assets/apex-BrXDlLUW.js +6 -0
- writer/static/assets/art-paper-D70v1WMA.svg +180 -0
- writer/static/assets/azcli-CElzELwZ.js +6 -0
- writer/static/assets/bat-CUsyEhik.js +6 -0
- writer/static/assets/bicep-BtxyJn6H.js +7 -0
- writer/static/assets/cameligo-ClBCoF8h.js +6 -0
- writer/static/assets/clojure-B9TqLHAk.js +6 -0
- writer/static/assets/codicon-BA2IlpFX.ttf +0 -0
- writer/static/assets/coffee-DYsfeylR.js +6 -0
- writer/static/assets/cpp-VVGvvgir.js +6 -0
- writer/static/assets/csharp-Z6z2stHy.js +6 -0
- writer/static/assets/csp-DgZoLDI1.js +6 -0
- writer/static/assets/css-KqQ96-gC.js +8 -0
- writer/static/assets/css.worker-DvNUQFd1.js +84 -0
- writer/static/assets/cssMode-BYq4oZGq.js +9 -0
- writer/static/assets/cypher-CYoSlgTu.js +6 -0
- writer/static/assets/dart-BGDl7St1.js +6 -0
- writer/static/assets/dockerfile-CuCtxA7T.js +6 -0
- writer/static/assets/ecl-BCTFAUpS.js +6 -0
- writer/static/assets/editor.worker-BVwmgLrR.js +11 -0
- writer/static/assets/elixir-C7hRTYZ9.js +6 -0
- writer/static/assets/flow9-Bi_qi707.js +6 -0
- writer/static/assets/freemarker2-CnNourkO.js +8 -0
- writer/static/assets/fsharp-CxaaEKKi.js +6 -0
- writer/static/assets/go-DUImKuGY.js +6 -0
- writer/static/assets/graphql-D5sGVkLV.js +6 -0
- writer/static/assets/handlebars-Bm22yapJ.js +6 -0
- writer/static/assets/hcl-zD_CCkZ1.js +6 -0
- writer/static/assets/html-CAKAfoZF.js +6 -0
- writer/static/assets/html.worker-BJMlcbMU.js +458 -0
- writer/static/assets/htmlMode-BGZ97n-V.js +9 -0
- writer/static/assets/index-5u5REPT4.js +16 -0
- writer/static/assets/index-BKNuk68o.css +1 -0
- writer/static/assets/index-BQNXU3IR.js +17 -0
- writer/static/assets/index-BQr1pfrb.js +1 -0
- writer/static/assets/index-DHXAd5Yn.js +4 -0
- writer/static/assets/index-Zki-pfO-.js +8525 -0
- writer/static/assets/index.esm-B1ZQtduY.js +17 -0
- writer/static/assets/ini-8kKHd4ZL.js +6 -0
- writer/static/assets/java-De1axCfe.js +6 -0
- writer/static/assets/javascript-X1f02eyK.js +6 -0
- writer/static/assets/json.worker-BwvX8PuZ.js +42 -0
- writer/static/assets/jsonMode-hT0bNgT8.js +11 -0
- writer/static/assets/julia-D3ApGBxz.js +6 -0
- writer/static/assets/kotlin-GbSrCElU.js +6 -0
- writer/static/assets/less-DNUaDNdz.js +7 -0
- writer/static/assets/lexon-Bg9QKxBu.js +6 -0
- writer/static/assets/liquid-KmCCiJw2.js +6 -0
- writer/static/assets/lua-Crkvc3mc.js +6 -0
- writer/static/assets/m3-DsrzVyM1.js +6 -0
- writer/static/assets/mapbox-gl-C0cyFYYW.js +2329 -0
- writer/static/assets/markdown-CY5IOZuu.js +6 -0
- writer/static/assets/marked.esm-273vDTCT.js +45 -0
- writer/static/assets/mdx-DtRFauUw.js +6 -0
- writer/static/assets/mips-BE8RsGBA.js +6 -0
- writer/static/assets/msdax-N5ajIiFQ.js +6 -0
- writer/static/assets/mysql-DRxbB97D.js +6 -0
- writer/static/assets/objective-c-BHUZy23s.js +6 -0
- writer/static/assets/pascal-BemVzBTY.js +6 -0
- writer/static/assets/pascaligo-BACCcnx_.js +6 -0
- writer/static/assets/pdf-B6-yWJ-Y.js +12 -0
- writer/static/assets/pdf.worker.min-CyUfim15.mjs +21 -0
- writer/static/assets/perl-CuU66Ptk.js +6 -0
- writer/static/assets/pgsql-CQ6TMH2r.js +6 -0
- writer/static/assets/php-BvyzZa65.js +6 -0
- writer/static/assets/pla-DrIuu9u1.js +6 -0
- writer/static/assets/plotly.min-DutuuatZ.js +4030 -0
- writer/static/assets/poppins-latin-300-italic-4WBEAciR.woff +0 -0
- writer/static/assets/poppins-latin-300-italic-EWCPeN2Y.woff2 +0 -0
- writer/static/assets/poppins-latin-300-normal-DCNuMXUj.woff +0 -0
- writer/static/assets/poppins-latin-300-normal-Dku2WoCh.woff2 +0 -0
- writer/static/assets/poppins-latin-400-italic-B4GYq972.woff2 +0 -0
- writer/static/assets/poppins-latin-400-italic-BPejoDS-.woff +0 -0
- writer/static/assets/poppins-latin-400-normal-BOb3E3N0.woff +0 -0
- writer/static/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
- writer/static/assets/poppins-latin-500-italic-Ce_qjtl5.woff +0 -0
- writer/static/assets/poppins-latin-500-italic-o28Otv0U.woff2 +0 -0
- writer/static/assets/poppins-latin-500-normal-C8OXljZJ.woff2 +0 -0
- writer/static/assets/poppins-latin-500-normal-DGXqpDMm.woff +0 -0
- writer/static/assets/poppins-latin-600-italic-BhOZippK.woff +0 -0
- writer/static/assets/poppins-latin-600-italic-CZ4wqKBi.woff2 +0 -0
- writer/static/assets/poppins-latin-600-normal-BJdTmd5m.woff +0 -0
- writer/static/assets/poppins-latin-600-normal-zEkxB9Mr.woff2 +0 -0
- writer/static/assets/poppins-latin-700-italic-CW91C-LJ.woff +0 -0
- writer/static/assets/poppins-latin-700-italic-RKf6esGj.woff2 +0 -0
- writer/static/assets/poppins-latin-700-normal-BVuQR_eA.woff +0 -0
- writer/static/assets/poppins-latin-700-normal-Qrb0O0WB.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-300-italic-CBzyU4Pf.woff +0 -0
- writer/static/assets/poppins-latin-ext-300-italic-DdDvTq5-.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-300-normal-7Zg2msWE.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-300-normal-C9p7gvmA.woff +0 -0
- writer/static/assets/poppins-latin-ext-400-italic-BiCGV3eO.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-400-italic-gsPYOGqV.woff +0 -0
- writer/static/assets/poppins-latin-ext-400-normal-CIpeJEZw.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-400-normal-Ce_uWq1Z.woff +0 -0
- writer/static/assets/poppins-latin-ext-500-italic-CwrTHwbn.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-500-italic-jdc8Bv4M.woff +0 -0
- writer/static/assets/poppins-latin-ext-500-normal-Bl1-S02S.woff +0 -0
- writer/static/assets/poppins-latin-ext-500-normal-H4Q0z8D2.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-600-italic-BqeDa496.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-600-italic-C7MQPb_A.woff +0 -0
- writer/static/assets/poppins-latin-ext-600-normal-Cn4C8475.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-600-normal-DB6FJURc.woff +0 -0
- writer/static/assets/poppins-latin-ext-700-italic-BAdhB_WS.woff2 +0 -0
- writer/static/assets/poppins-latin-ext-700-italic-WKTwQMp8.woff +0 -0
- writer/static/assets/poppins-latin-ext-700-normal-CE2WFKmF.woff +0 -0
- writer/static/assets/poppins-latin-ext-700-normal-DDaViAzG.woff2 +0 -0
- writer/static/assets/postiats-BR_hrfni.js +6 -0
- writer/static/assets/powerquery-CKDUeRmd.js +6 -0
- writer/static/assets/powershell-Dsa4rhA_.js +6 -0
- writer/static/assets/protobuf-CGsvhooB.js +7 -0
- writer/static/assets/pug-D2p3uOX2.js +6 -0
- writer/static/assets/python-DVhxg746.js +6 -0
- writer/static/assets/qsharp-B7F3HtPF.js +6 -0
- writer/static/assets/r-3aLoi2fs.js +6 -0
- writer/static/assets/razor-DR5Ns_BC.js +6 -0
- writer/static/assets/redis-jqFeRM5s.js +6 -0
- writer/static/assets/redshift-BriwQgXR.js +6 -0
- writer/static/assets/restructuredtext-hbBFZ0w9.js +6 -0
- writer/static/assets/ruby-ByThyB2Q.js +6 -0
- writer/static/assets/rust-DIEZMp5R.js +6 -0
- writer/static/assets/sb-C6Gjjw_x.js +6 -0
- writer/static/assets/scala-DZNw3jJB.js +6 -0
- writer/static/assets/scheme-55eqh71t.js +6 -0
- writer/static/assets/scss-D-OVkc4F.js +8 -0
- writer/static/assets/serialization-DJC7NP0N.js +20 -0
- writer/static/assets/shell-DSpi8_qN.js +6 -0
- writer/static/assets/solidity-BHddiNFS.js +6 -0
- writer/static/assets/sophia-D6taVZFb.js +6 -0
- writer/static/assets/sparql-LA0C7mUc.js +6 -0
- writer/static/assets/sql-C3-3IcFM.js +6 -0
- writer/static/assets/st-C4g7059C.js +6 -0
- writer/static/assets/swift-DNI1vH3h.js +8 -0
- writer/static/assets/systemverilog-DL_FVbcQ.js +6 -0
- writer/static/assets/tcl-DVJXmIwd.js +6 -0
- writer/static/assets/ts.worker-CwG1rUES.js +37021 -0
- writer/static/assets/tsMode-BNUEZzir.js +16 -0
- writer/static/assets/twig-BVWDLtw5.js +6 -0
- writer/static/assets/typescript-CRVt7Hx0.js +6 -0
- writer/static/assets/useBlueprintRun-C00bCxh-.js +1 -0
- writer/static/assets/useKeyValueEditor-nDmI7cTJ.js +1 -0
- writer/static/assets/useListResources-DLkZhRSJ.js +1 -0
- writer/static/assets/vb-Btz91-7U.js +6 -0
- writer/static/assets/vega-embed.module-SNP5iNdJ.js +201 -0
- writer/static/assets/wgsl-D8V_buCG.js +303 -0
- writer/static/assets/xml-C_6-t1tb.js +6 -0
- writer/static/assets/yaml-DIw8G7jk.js +6 -0
- writer/static/components/annotatedtext.svg +4 -0
- writer/static/components/avatar.svg +4 -0
- writer/static/components/blueprints_addtostatelist.svg +4 -0
- writer/static/components/blueprints_apitrigger.svg +4 -0
- writer/static/components/blueprints_calleventhandler.svg +9 -0
- writer/static/components/blueprints_category_Logic.svg +4 -0
- writer/static/components/blueprints_category_Other.svg +4 -0
- writer/static/components/blueprints_category_Triggers.svg +4 -0
- writer/static/components/blueprints_category_Writer.svg +25 -0
- writer/static/components/blueprints_code.svg +9 -0
- writer/static/components/blueprints_crontrigger.svg +6 -0
- writer/static/components/blueprints_foreach.svg +4 -0
- writer/static/components/blueprints_httprequest.svg +11 -0
- writer/static/components/blueprints_logmessage.svg +11 -0
- writer/static/components/blueprints_parsejson.svg +4 -0
- writer/static/components/blueprints_returnvalue.svg +4 -0
- writer/static/components/blueprints_runblueprint.svg +4 -0
- writer/static/components/blueprints_setstate.svg +4 -0
- writer/static/components/blueprints_uieventtrigger.svg +4 -0
- writer/static/components/blueprints_writeraddchatmessage.svg +19 -0
- writer/static/components/blueprints_writeraddtokg.svg +19 -0
- writer/static/components/blueprints_writerchat.svg +11 -0
- writer/static/components/blueprints_writerchatreply.svg +19 -0
- writer/static/components/blueprints_writerclassification.svg +24 -0
- writer/static/components/blueprints_writercompletion.svg +14 -0
- writer/static/components/blueprints_writerinitchat.svg +11 -0
- writer/static/components/blueprints_writernocodeapp.svg +14 -0
- writer/static/components/button.svg +4 -0
- writer/static/components/category_Content.svg +4 -0
- writer/static/components/category_Embed.svg +4 -0
- writer/static/components/category_Input.svg +5 -0
- writer/static/components/category_Layout.svg +9 -0
- writer/static/components/category_Other.svg +4 -0
- writer/static/components/chatbot.svg +4 -0
- writer/static/components/checkboxinput.svg +4 -0
- writer/static/components/colorinput.svg +11 -0
- writer/static/components/column.svg +4 -0
- writer/static/components/columns.svg +4 -0
- writer/static/components/dataframe.svg +4 -0
- writer/static/components/dateinput.svg +4 -0
- writer/static/components/dropdowninput.svg +5 -0
- writer/static/components/fileinput.svg +4 -0
- writer/static/components/googlemaps.svg +4 -0
- writer/static/components/header.svg +4 -0
- writer/static/components/heading.svg +9 -0
- writer/static/components/horizontalstack.svg +4 -0
- writer/static/components/html.svg +9 -0
- writer/static/components/icon.svg +4 -0
- writer/static/components/iframe.svg +4 -0
- writer/static/components/image.svg +11 -0
- writer/static/components/jsonviewer.svg +4 -0
- writer/static/components/link.svg +12 -0
- writer/static/components/mapbox.svg +4 -0
- writer/static/components/message.svg +4 -0
- writer/static/components/metric.svg +4 -0
- writer/static/components/multiselectinput.svg +4 -0
- writer/static/components/numberinput.svg +4 -0
- writer/static/components/page.svg +50 -0
- writer/static/components/pagination.svg +4 -0
- writer/static/components/pdf.svg +4 -0
- writer/static/components/plotlygraph.svg +7 -0
- writer/static/components/progressbar.svg +5 -0
- writer/static/components/radioinput.svg +4 -0
- writer/static/components/rangeinput.svg +4 -0
- writer/static/components/ratinginput.svg +4 -0
- writer/static/components/repeater.svg +4 -0
- writer/static/components/reuse.svg +4 -0
- writer/static/components/section.svg +4 -0
- writer/static/components/selectinput.svg +5 -0
- writer/static/components/separator.svg +4 -0
- writer/static/components/sidebar.svg +4 -0
- writer/static/components/sliderinput.svg +4 -0
- writer/static/components/step.svg +4 -0
- writer/static/components/steps.svg +4 -0
- writer/static/components/switchinput.svg +4 -0
- writer/static/components/tab.svg +4 -0
- writer/static/components/tabs.svg +4 -0
- writer/static/components/tags.svg +11 -0
- writer/static/components/text.svg +4 -0
- writer/static/components/textareainput.svg +11 -0
- writer/static/components/textinput.svg +4 -0
- writer/static/components/timeinput.svg +4 -0
- writer/static/components/timer.svg +4 -0
- writer/static/components/vegalitechart.svg +7 -0
- writer/static/components/videoplayer.svg +11 -0
- writer/static/components/webcamcapture.svg +4 -0
- writer/static/favicon.png +0 -0
- writer/static/index.html +84 -0
- writer/static/status/cancelled.svg +5 -0
- writer/static/status/error.svg +5 -0
- writer/static/status/skipped.svg +4 -0
- writer/static/status/stopped.svg +4 -0
- writer/static/status/success.svg +4 -0
- writer/sync.py +431 -0
- writer/ui.py +2268 -0
- writer/vault.py +48 -0
- writer/wf_project.py +90 -66
- writer-1.25.1rc1.dist-info/METADATA +92 -0
- writer-1.25.1rc1.dist-info/RECORD +382 -0
- {writer-0.8.3rc4.dist-info → writer-1.25.1rc1.dist-info}/WHEEL +1 -1
- writer/blocks/runworkflow.py +0 -59
- writer/workflows.py +0 -183
- writer-0.8.3rc4.dist-info/METADATA +0 -117
- writer-0.8.3rc4.dist-info/RECORD +0 -44
- {writer-0.8.3rc4.dist-info → writer-1.25.1rc1.dist-info}/entry_points.txt +0 -0
- {writer-0.8.3rc4.dist-info → writer-1.25.1rc1.dist-info/licenses}/LICENSE.txt +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from writer.abstract import register_abstract_template
|
|
2
|
+
from writer.blocks.base_trigger import BlueprintTrigger
|
|
3
|
+
from writer.ss_types import AbstractTemplate
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CronTrigger(BlueprintTrigger):
|
|
7
|
+
@classmethod
|
|
8
|
+
def register(cls, type: str):
|
|
9
|
+
super(CronTrigger, cls).register(type)
|
|
10
|
+
register_abstract_template(
|
|
11
|
+
type,
|
|
12
|
+
AbstractTemplate(
|
|
13
|
+
baseType="blueprints_node",
|
|
14
|
+
writer={
|
|
15
|
+
"name": "Cron Trigger",
|
|
16
|
+
"description": "Triggers an event on a schedule based on a cron expression.",
|
|
17
|
+
"category": "Triggers",
|
|
18
|
+
"featureFlags": ["cron_trigger"],
|
|
19
|
+
"fields": {
|
|
20
|
+
"cronExpression": {
|
|
21
|
+
"name": "Cron Expression",
|
|
22
|
+
"type": "Text",
|
|
23
|
+
"desc": "The cron expression that defines the schedule (e.g., '0 * * * *' for every hour).",
|
|
24
|
+
},
|
|
25
|
+
"timezone": {
|
|
26
|
+
"name": "Timezone",
|
|
27
|
+
"type": "Text",
|
|
28
|
+
"desc": "The timezone for the cron schedule (e.g., 'UTC', 'America/New_York'). Defaults to UTC.",
|
|
29
|
+
"default": "UTC",
|
|
30
|
+
},
|
|
31
|
+
"defaultResult": {
|
|
32
|
+
"name": "Default result",
|
|
33
|
+
"type": "Code",
|
|
34
|
+
"desc": 'The result that is used when the blueprint is triggered from the "Run blueprint" button',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
"outs": {
|
|
38
|
+
"trigger": {
|
|
39
|
+
"name": "Trigger",
|
|
40
|
+
"style": "success",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def run(self):
|
|
48
|
+
super().run()
|
|
49
|
+
self.outcome = "trigger"
|
writer/blocks/foreach.py
CHANGED
|
@@ -1,75 +1,92 @@
|
|
|
1
1
|
from writer.abstract import register_abstract_template
|
|
2
|
-
from writer.blocks.base_block import
|
|
2
|
+
from writer.blocks.base_block import BlueprintBlock
|
|
3
3
|
from writer.ss_types import AbstractTemplate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class ForEach(
|
|
7
|
-
|
|
6
|
+
class ForEach(BlueprintBlock):
|
|
8
7
|
@classmethod
|
|
9
8
|
def register(cls, type: str):
|
|
10
9
|
super(ForEach, cls).register(type)
|
|
11
|
-
register_abstract_template(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"success": {
|
|
34
|
-
"name": "Success",
|
|
35
|
-
"description": "The workflow executed successfully.",
|
|
36
|
-
"style": "success",
|
|
10
|
+
register_abstract_template(
|
|
11
|
+
type,
|
|
12
|
+
AbstractTemplate(
|
|
13
|
+
baseType="blueprints_node",
|
|
14
|
+
writer={
|
|
15
|
+
"name": "For-each loop",
|
|
16
|
+
"description": "Loops through each item in a list to run the same logic.",
|
|
17
|
+
"category": "Logic",
|
|
18
|
+
"fields": {
|
|
19
|
+
"items": {
|
|
20
|
+
"name": "Items",
|
|
21
|
+
"desc": "The item value will be passed in the execution environment. It will be available at @{item}, and its ID at @{itemId}. You can use either a list or a dictionary.",
|
|
22
|
+
"default": "[]",
|
|
23
|
+
"init": '["France", "Poland"]',
|
|
24
|
+
"type": "Object",
|
|
25
|
+
"control": "Textarea",
|
|
26
|
+
},
|
|
27
|
+
"prefix": {
|
|
28
|
+
"name": "Prefix",
|
|
29
|
+
"type": "Text",
|
|
30
|
+
"desc": "If set, the item will be available at @{prefix_item} and the item id at @{prefix_itemId}.",
|
|
31
|
+
},
|
|
37
32
|
},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
"outs": {
|
|
34
|
+
"loop": {
|
|
35
|
+
"name": "Loop",
|
|
36
|
+
"description": "Connect the branch that you'd like to loop on. The branch plugged in here will be executed once per item.",
|
|
37
|
+
"style": "dynamic",
|
|
38
|
+
},
|
|
39
|
+
"success": {
|
|
40
|
+
"name": "Success",
|
|
41
|
+
"description": "The branch referenced executed successfully for each item.",
|
|
42
|
+
"style": "success",
|
|
43
|
+
},
|
|
44
|
+
"error": {
|
|
45
|
+
"name": "Error",
|
|
46
|
+
"description": "The branch referenced has failed for at least one of the items.",
|
|
47
|
+
"style": "error",
|
|
48
|
+
},
|
|
42
49
|
},
|
|
43
50
|
},
|
|
44
|
-
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
def _run_workflow_for_item(self, workflow_key, base_execution_environment, item_id, item):
|
|
48
|
-
expanded_execution_environment = base_execution_environment | {
|
|
49
|
-
"payload": {
|
|
50
|
-
"itemId": item_id,
|
|
51
|
-
"item": item
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return self.runner.run_workflow_by_key(workflow_key, expanded_execution_environment)
|
|
51
|
+
),
|
|
52
|
+
)
|
|
55
53
|
|
|
56
54
|
def run(self):
|
|
57
55
|
try:
|
|
58
|
-
workflow_key = self._get_field("workflowKey")
|
|
59
56
|
items = self._get_field("items", as_json=True)
|
|
57
|
+
prefix = str(self._get_field("prefix", as_json=False, default_field_value="")).strip()
|
|
58
|
+
if prefix:
|
|
59
|
+
prefix += "_"
|
|
60
60
|
base_execution_environment = self.execution_environment
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
if not isinstance(items, (list, dict)):
|
|
63
|
+
raise ValueError("Items must be a list or dictionary.")
|
|
64
|
+
|
|
64
65
|
if isinstance(items, list):
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
blueprint_environments = [
|
|
67
|
+
base_execution_environment | {f"{prefix}itemId": i, f"{prefix}item": item}
|
|
68
|
+
for i, item in enumerate(items)
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
results = self.runner.run_branch_batch(
|
|
72
|
+
self.component.id, "loop", blueprint_environments
|
|
73
|
+
)
|
|
74
|
+
self.result = results # Return as a list
|
|
75
|
+
|
|
67
76
|
elif isinstance(items, dict):
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
blueprint_environments = {
|
|
78
|
+
str(item_id): base_execution_environment
|
|
79
|
+
| {f"{prefix}itemId": str(item_id), f"{prefix}item": item}
|
|
80
|
+
for item_id, item in items.items()
|
|
81
|
+
}
|
|
82
|
+
results = self.runner.run_branch_batch(
|
|
83
|
+
self.component.id, "loop", list(blueprint_environments.values())
|
|
84
|
+
)
|
|
85
|
+
self.result = {
|
|
86
|
+
item_id: results[i] for i, item_id in enumerate(blueprint_environments.keys())
|
|
87
|
+
}
|
|
70
88
|
|
|
71
|
-
self.result = result
|
|
72
89
|
self.outcome = "success"
|
|
73
90
|
except BaseException as e:
|
|
74
91
|
self.outcome = "error"
|
|
75
|
-
raise e
|
|
92
|
+
raise e
|
writer/blocks/httprequest.py
CHANGED
|
@@ -1,123 +1,136 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import requests
|
|
1
|
+
import json
|
|
4
2
|
|
|
5
3
|
from writer.abstract import register_abstract_template
|
|
6
|
-
from writer.blocks.base_block import
|
|
4
|
+
from writer.blocks.base_block import BlueprintBlock
|
|
7
5
|
from writer.ss_types import AbstractTemplate
|
|
8
6
|
|
|
9
7
|
|
|
10
|
-
class HTTPRequest(
|
|
11
|
-
|
|
12
|
-
CONTROL_CHARS = re.compile(r"[\x00-\x1f\x7f]")
|
|
13
|
-
|
|
8
|
+
class HTTPRequest(BlueprintBlock):
|
|
14
9
|
@classmethod
|
|
15
10
|
def register(cls, type: str):
|
|
16
11
|
super(HTTPRequest, cls).register(type)
|
|
17
|
-
register_abstract_template(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
register_abstract_template(
|
|
13
|
+
type,
|
|
14
|
+
AbstractTemplate(
|
|
15
|
+
baseType="blueprints_node",
|
|
16
|
+
writer={
|
|
17
|
+
"name": "HTTP request",
|
|
18
|
+
"description": "Sends an HTTP request to an API endpoint. Used to fetch or send data.",
|
|
19
|
+
"category": "Other",
|
|
20
|
+
"fields": {
|
|
21
|
+
"method": {
|
|
22
|
+
"name": "Method",
|
|
23
|
+
"type": "Text",
|
|
24
|
+
"options": {
|
|
25
|
+
"GET": "GET",
|
|
26
|
+
"POST": "POST",
|
|
27
|
+
"PUT": "PUT",
|
|
28
|
+
"PATCH": "PATCH",
|
|
29
|
+
"DELETE": "DELETE",
|
|
30
|
+
},
|
|
31
|
+
"validator": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE", ""],
|
|
34
|
+
},
|
|
33
35
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"type": "
|
|
37
|
-
"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"name": "Headers",
|
|
50
|
-
"type": "Key-Value",
|
|
51
|
-
"default": "{}",
|
|
52
|
-
"validator": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"patternProperties": {
|
|
55
|
-
"^.*$": {
|
|
56
|
-
"type": ["string", "number", "boolean"],
|
|
36
|
+
"url": {
|
|
37
|
+
"name": "URL",
|
|
38
|
+
"type": "Text",
|
|
39
|
+
"control": "Textarea",
|
|
40
|
+
},
|
|
41
|
+
"headers": {
|
|
42
|
+
"name": "Headers",
|
|
43
|
+
"type": "Key-Value",
|
|
44
|
+
"default": "{}",
|
|
45
|
+
"validator": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"patternProperties": {
|
|
48
|
+
"^.*$": {
|
|
49
|
+
"type": ["string", "number", "boolean"],
|
|
50
|
+
},
|
|
57
51
|
},
|
|
52
|
+
"additionalProperties": True,
|
|
58
53
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"name": "
|
|
71
|
-
"description": "The request was successful.",
|
|
72
|
-
"style": "success",
|
|
73
|
-
},
|
|
74
|
-
"responseError": {
|
|
75
|
-
"name": "Response error",
|
|
76
|
-
"description": "The connection was established successfully but an error response code was received or the response was invalid.",
|
|
77
|
-
"style": "error",
|
|
54
|
+
},
|
|
55
|
+
"bodyType": {
|
|
56
|
+
"name": "Body type",
|
|
57
|
+
"type": "Text",
|
|
58
|
+
"description": "Specify whether to interpret the body as plain text or JSON.",
|
|
59
|
+
"options": {
|
|
60
|
+
"text": "Plain text",
|
|
61
|
+
"JSON": "JSON",
|
|
62
|
+
},
|
|
63
|
+
"default": "text",
|
|
64
|
+
},
|
|
65
|
+
"body": {"name": "Body", "type": "Text", "control": "Textarea"},
|
|
78
66
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
"outs": {
|
|
68
|
+
"success": {
|
|
69
|
+
"name": "Success",
|
|
70
|
+
"description": "The request was successful.",
|
|
71
|
+
"style": "success",
|
|
72
|
+
},
|
|
73
|
+
"responseError": {
|
|
74
|
+
"name": "Response error",
|
|
75
|
+
"description": "The connection was established successfully but an error response code was received or the response was invalid.",
|
|
76
|
+
"style": "error",
|
|
77
|
+
},
|
|
78
|
+
"connectionError": {
|
|
79
|
+
"name": "Connection error",
|
|
80
|
+
"description": "The connection couldn't be established.",
|
|
81
|
+
"style": "error",
|
|
82
|
+
},
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
def _clean_json_string(self, s: str) -> str:
|
|
89
|
-
|
|
90
|
-
""" Remove control characters, which aren't tolerated by JSON loads() strict mode, from string."""
|
|
91
|
-
|
|
92
|
-
return HTTPRequest.CONTROL_CHARS.sub("", s)
|
|
85
|
+
),
|
|
86
|
+
)
|
|
93
87
|
|
|
94
88
|
def run(self):
|
|
95
|
-
import json
|
|
96
|
-
|
|
97
89
|
try:
|
|
98
90
|
method = self._get_field("method", False, "GET")
|
|
99
91
|
url = self._get_field("url")
|
|
100
|
-
headers = self._get_field("headers", True)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"status_code": req.status_code,
|
|
110
|
-
"body": req.json() if is_json else req.text
|
|
111
|
-
}
|
|
112
|
-
if req.ok:
|
|
113
|
-
self.outcome = "success"
|
|
92
|
+
headers = self._get_field("headers", True, default_field_value="{}")
|
|
93
|
+
body_type = self._get_field("bodyType")
|
|
94
|
+
body = None
|
|
95
|
+
raw_body = None
|
|
96
|
+
|
|
97
|
+
if body_type == "JSON":
|
|
98
|
+
body = self._get_field("body", as_json=True)
|
|
99
|
+
raw_body = json.dumps(body)
|
|
100
|
+
headers.setdefault("Content-Type", "application/json")
|
|
114
101
|
else:
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
body = self._get_field("body", as_json=False)
|
|
103
|
+
raw_body = body
|
|
104
|
+
|
|
105
|
+
with self.acquire_httpx_client() as client:
|
|
106
|
+
res = client.request(method, url, headers=headers, content=raw_body, timeout=180)
|
|
107
|
+
|
|
108
|
+
content_type = res.headers.get("Content-Type", "")
|
|
109
|
+
is_response_json = "application/json" in content_type
|
|
110
|
+
|
|
111
|
+
self.result = {
|
|
112
|
+
"request": {
|
|
113
|
+
"url": str(res.request.url),
|
|
114
|
+
"headers": dict(res.request.headers),
|
|
115
|
+
"body": res.request.content.decode("utf-8", errors="replace"),
|
|
116
|
+
},
|
|
117
|
+
"headers": dict(res.headers),
|
|
118
|
+
"status_code": res.status_code,
|
|
119
|
+
"body": res.json() if is_response_json else res.text,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if res.is_success:
|
|
123
|
+
self.outcome = "success"
|
|
124
|
+
else:
|
|
125
|
+
self.outcome = "responseError"
|
|
126
|
+
raise RuntimeError(
|
|
127
|
+
f"HTTP response with code {res.status_code} and message {res.text}"
|
|
128
|
+
)
|
|
129
|
+
|
|
117
130
|
except json.JSONDecodeError as e:
|
|
118
131
|
self.outcome = "responseError"
|
|
119
132
|
raise e
|
|
120
|
-
except
|
|
121
|
-
if
|
|
133
|
+
except Exception as e:
|
|
134
|
+
if self.outcome is None or self.outcome not in ("responseError",):
|
|
122
135
|
self.outcome = "connectionError"
|
|
123
|
-
raise e
|
|
136
|
+
raise e
|
writer/blocks/ifelse.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import traceback
|
|
3
|
+
|
|
4
|
+
from writer.abstract import register_abstract_template
|
|
5
|
+
from writer.blocks.base_block import BlueprintBlock
|
|
6
|
+
from writer.ss_types import AbstractTemplate
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class IfElseBlock(BlueprintBlock):
|
|
10
|
+
@classmethod
|
|
11
|
+
def register(cls, type: str):
|
|
12
|
+
super(IfElseBlock, cls).register(type)
|
|
13
|
+
register_abstract_template(
|
|
14
|
+
type,
|
|
15
|
+
AbstractTemplate(
|
|
16
|
+
baseType="blueprints_node",
|
|
17
|
+
writer={
|
|
18
|
+
"name": "If-Else",
|
|
19
|
+
"description": "Evaluate custom Python code and redirect to 'true' or 'false' branch. Useful for conditional logic.",
|
|
20
|
+
"category": "Logic",
|
|
21
|
+
"fields": {
|
|
22
|
+
"expression": {
|
|
23
|
+
"name": "Expression",
|
|
24
|
+
"type": "Eval",
|
|
25
|
+
"desc": "The expression to be evaluated. Must be a single expression (no statements).",
|
|
26
|
+
"init": 'state["counter"] > 10',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
"outs": {
|
|
30
|
+
"true": {
|
|
31
|
+
"name": "True",
|
|
32
|
+
"description": "The event handler execution for True.",
|
|
33
|
+
"style": "success",
|
|
34
|
+
},
|
|
35
|
+
"false": {
|
|
36
|
+
"name": "False",
|
|
37
|
+
"description": "The event handler execution for False.",
|
|
38
|
+
"style": "success",
|
|
39
|
+
},
|
|
40
|
+
"error": {
|
|
41
|
+
"name": "Error",
|
|
42
|
+
"description": "The expression evaluation failed.",
|
|
43
|
+
"style": "error",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def run(self):
|
|
51
|
+
expression = self._get_field("expression")
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
writeruserapp = sys.modules.get("writeruserapp")
|
|
55
|
+
block_globals = {
|
|
56
|
+
**self.execution_environment,
|
|
57
|
+
**(writeruserapp.__dict__ if writeruserapp else {}),
|
|
58
|
+
"state": self.runner.session.session_state,
|
|
59
|
+
}
|
|
60
|
+
# Evaluate the expression and set the result
|
|
61
|
+
compiled_expr = compile(expression, "<expression>", mode="eval")
|
|
62
|
+
self.result = eval(compiled_expr, block_globals)
|
|
63
|
+
|
|
64
|
+
if self.result:
|
|
65
|
+
self.outcome = "true"
|
|
66
|
+
else:
|
|
67
|
+
self.outcome = "false"
|
|
68
|
+
except BaseException:
|
|
69
|
+
self.outcome = "error"
|
|
70
|
+
self.message = f"<pre>{traceback.format_exc()}</pre>"
|
|
71
|
+
raise
|
writer/blocks/logmessage.py
CHANGED
|
@@ -1,58 +1,53 @@
|
|
|
1
1
|
from writer.abstract import register_abstract_template
|
|
2
|
-
from writer.blocks.base_block import
|
|
2
|
+
from writer.blocks.base_block import BlueprintBlock
|
|
3
3
|
from writer.ss_types import AbstractTemplate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class LogMessage(
|
|
7
|
-
|
|
6
|
+
class LogMessage(BlueprintBlock):
|
|
8
7
|
@classmethod
|
|
9
8
|
def register(cls, type: str):
|
|
10
9
|
super(LogMessage, cls).register(type)
|
|
11
|
-
register_abstract_template(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"type":
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"error": "Error"
|
|
10
|
+
register_abstract_template(
|
|
11
|
+
type,
|
|
12
|
+
AbstractTemplate(
|
|
13
|
+
baseType="blueprints_node",
|
|
14
|
+
writer={
|
|
15
|
+
"name": "Log message",
|
|
16
|
+
"description": "Prints a message to the console for debugging or monitoring app flow.",
|
|
17
|
+
"category": "Other",
|
|
18
|
+
"fields": {
|
|
19
|
+
"type": {
|
|
20
|
+
"name": "Type",
|
|
21
|
+
"type": "Text",
|
|
22
|
+
"options": {"info": "Info", "error": "Error"},
|
|
23
|
+
"default": "info",
|
|
24
24
|
},
|
|
25
|
-
"
|
|
26
|
-
},
|
|
27
|
-
"message": {
|
|
28
|
-
"name": "Message",
|
|
29
|
-
"type": "Text",
|
|
30
|
-
"control": "Textarea"
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
"outs": {
|
|
34
|
-
"success": {
|
|
35
|
-
"name": "Success",
|
|
36
|
-
"description": "The request was successful.",
|
|
37
|
-
"style": "success",
|
|
25
|
+
"message": {"name": "Message", "type": "Text", "control": "Textarea"},
|
|
38
26
|
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
"outs": {
|
|
28
|
+
"success": {
|
|
29
|
+
"name": "Success",
|
|
30
|
+
"description": "The message was logged successfully.",
|
|
31
|
+
"style": "success",
|
|
32
|
+
},
|
|
33
|
+
"error": {
|
|
34
|
+
"name": "Error",
|
|
35
|
+
"description": "There was an error logging the message.",
|
|
36
|
+
"style": "error",
|
|
37
|
+
},
|
|
43
38
|
},
|
|
44
39
|
},
|
|
45
|
-
|
|
46
|
-
)
|
|
40
|
+
),
|
|
41
|
+
)
|
|
47
42
|
|
|
48
43
|
def run(self):
|
|
49
44
|
try:
|
|
50
45
|
type = self._get_field("type", False, "info")
|
|
51
|
-
message = self._get_field("message", required=True)
|
|
46
|
+
message = str(self._get_field("message", required=True))
|
|
52
47
|
|
|
53
|
-
self.runner.session.session_state.add_log_entry(type, "
|
|
54
|
-
self.result =
|
|
48
|
+
self.runner.session.session_state.add_log_entry(type, "Blueprints message", message)
|
|
49
|
+
self.result = message
|
|
55
50
|
self.outcome = "success"
|
|
56
51
|
except BaseException as e:
|
|
57
52
|
self.outcome = "error"
|
|
58
|
-
raise e
|
|
53
|
+
raise e
|