* feat: Add runScriptByPath and runScriptByHash methods to SDK clients - Add runScriptByPath and runScriptByHash methods to TypeScript client - Add run_script_by_path and run_script_by_hash methods to Python client - Split functionality from existing methods that took both path and hash parameters - Add deprecation warnings to existing run_script methods - Maintain backward compatibility while encouraging use of focused methods Closes #6251 Co-authored-by: Ruben Fiszel <rubenfiszel@users.noreply.github.com> * Refactor SDK methods to eliminate code duplication - Extract common logic into internal helper methods - Python client: _run_script_async_internal() and _run_script_internal() - TypeScript client: _runScriptAsyncInternal() and _runScriptInternal() - Eliminate duplicated parameter processing and HTTP setup - Maintain exact same public API surface and functionality - Reduce lines of code while preserving all existing behaviors Co-authored-by: Ruben Fiszel <rubenfiszel@users.noreply.github.com> * fix ts and dev.nu for python * trade warnings.warn for logging.warning Signed-off-by: pyranota <pyra@duck.com> --------- Signed-off-by: pyranota <pyra@duck.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel <rubenfiszel@users.noreply.github.com> Co-authored-by: pyranota <pyra@duck.com>
55 lines
1.2 KiB
Nu
Executable File
55 lines
1.2 KiB
Nu
Executable File
#! /usr/bin/env nu
|
|
|
|
let cache = "/tmp/windmill/cache/python_3_11/"
|
|
|
|
# Clean cache
|
|
def "main clean" [] {
|
|
^rm -rf ($cache ++ "/wmill*")
|
|
}
|
|
|
|
# Watch changes in directory and autopatch (watchexec required)
|
|
def "main watch" [] {
|
|
# watchexec -w ../backend/windmill-api/openapi.yaml './dev.nu -g' &
|
|
# TODO: Watch openapi.yaml
|
|
^watchexec ./dev.nu -p
|
|
|
|
}
|
|
|
|
# Build client and move to windmill's cache
|
|
# To build you will need nushell and tsc (typescript compiler)
|
|
# If none arguments selected, all will be turned on
|
|
# If any argument specified, all others will be disabled
|
|
def main [
|
|
--gen(-g) # Generate code (OpenAPI codegen)
|
|
--compile(-c) # Compile code (TS >> JS)
|
|
--patch(-p) # Patch
|
|
] {
|
|
|
|
let do_all = not ($gen or $compile or $patch);
|
|
|
|
# TODO: Gen windmill-client.js
|
|
# TODO: Gen bundle? (README_DEV.md)
|
|
|
|
if ($do_all or $gen) {
|
|
print "Generating code from openapi.yml..."
|
|
./build.sh
|
|
}
|
|
|
|
if ($do_all or $patch) {
|
|
print "Patching cache..."
|
|
|
|
# Clean up in all versions
|
|
rm -rf ($cache ++ wmill*/wmill/*)
|
|
|
|
# Copy files from local ./dist to every wm-client version in cache
|
|
ls /tmp/windmill/cache/python_3_11/wmill* | each {
|
|
|i|
|
|
|
|
let path = $i | get name;
|
|
^cp -r wmill/wmill/* ($path ++ "/wmill")
|
|
}
|
|
}
|
|
|
|
print Done!
|
|
}
|