Commit graph

10 commits

Author SHA1 Message Date
6860871128 Add --account N flag and full credential resolution to TypeScript, Nim, Dart, Crystal SDKs
All four implementations now support:
- loadAccountsCSV/loadCredentialsFromCsv helper to parse accounts.csv files
- 5-tier credential resolution: -p/-k flags > --account N > env vars >
  ~/.unsandbox/accounts.csv > ./accounts.csv (with UNSANDBOX_ACCOUNT env var support)
- --account N CLI flag to select a specific row from accounts.csv (0-based)
- -p PUBLIC_KEY flag for explicit public key (separate from -k secret key)
2026-03-23 15:11:46 -04:00
369f3aa39d Support -f on service create and redeploy across all SDKs
Add input_files support to service redeploy for all 12 SDK
implementations that have service commands. Files passed via -f are
read, base64-encoded, and sent as input_files in the JSON payload.
Service create also gains -f support where it was missing.

Updated: bash, cpp, csharp, dotnet, go, java, javascript, perl,
php, ruby, rust, typescript
2026-03-02 06:13:43 -05:00
6e746ace44 feat: full feature parity for all 42 SDKs + comprehensive tests
All SDKs now implement 58+ functions matching C reference (un.h):
- Execution (8): execute, execute_async, wait_job, get_job, cancel_job, list_jobs, get_languages, detect_language
- Sessions (9): list, get, create, destroy, freeze, unfreeze, boost, unboost, execute
- Services (17): list, get, create, destroy, freeze, unfreeze, lock, unlock, set_unfreeze_on_demand, redeploy, logs, execute, env_get/set/delete/export, resize
- Snapshots (9): list, get, session, service, restore, delete, lock, unlock, clone
- Images (13): list, get, publish, delete, lock, unlock, set_visibility, grant/revoke_access, list_trusted, transfer, spawn, clone
- PaaS Logs (2): fetch, stream
- Utilities (5): validate_keys, hmac_sign, health_check, version, last_error

Test suites created for all SDKs with unit, integration, and functional tests.

Languages: AWK, Bash, C++, C#, Clojure, COBOL, Crystal, D, Dart, .NET, Elixir, Erlang, F#, Forth, Fortran, Go, Groovy, Haskell, Java, JavaScript, Julia, Kotlin, Lisp, Lua, Nim, Objective-C, OCaml, Perl, PHP, PowerShell, Prolog, Python, R, Raku, Ruby, Rust, Scheme, Swift, Tcl, TypeScript, V, Zig
2026-02-05 16:45:02 -05:00
a5155aed4f feat: add HTTP 428 sudo OTP handling to all 42 SDK implementations
When destructive operations (service/snapshot/image destroy/unlock) receive
HTTP 428 Precondition Required, the SDK now:
1. Extracts challenge_id from the JSON response
2. Prompts: 'Confirmation required. Check your email for a one-time code.'
3. Reads OTP from stdin
4. Retries with X-Sudo-OTP and X-Sudo-Challenge headers

Languages updated: AWK, Bash, C++, C#, Clojure, COBOL, Crystal, D, Dart,
.NET, Elixir, Erlang, F#, Forth, Fortran, Go, Groovy, Haskell, Java,
JavaScript, Julia, Kotlin, Lisp, Lua, Nim, Objective-C, OCaml, Perl, PHP,
PowerShell, Prolog, Python, R, Raku, Ruby, Rust, Scheme, Swift, Tcl,
TypeScript, V, Zig
2026-02-05 16:23:19 -05:00
eeb1dcb3dc feat: add --show-freeze-page and --no-show-freeze-page CLI flags
Add CLI support for toggling the show_freeze_page service setting,
which controls whether frozen services display an HTML payment page
or return a JSON error response.

Updated 18 SDK implementations + CLI_SPEC.md documentation.
2026-01-25 04:28:24 -05:00
e58adcd5fe feat: add unfreeze_on_demand support to all SDKs
Updated Python, JavaScript, Go, Rust, Ruby, Java, and TypeScript SDKs:
- Add unfreeze_on_demand field to Service struct/class
- Add setUnfreezeOnDemand function to toggle setting via PATCH /services/:id
- Add unfreeze_on_demand parameter to createService function
2026-01-22 16:40:36 -05:00
1077543b7c modified: clients/awk/sync/src/un.awk
modified:   clients/c/src/un.c
	modified:   clients/clojure/sync/src/un.clj
	modified:   clients/cobol/sync/src/un.cob
	modified:   clients/cpp/sync/src/un.cpp
	modified:   clients/crystal/sync/src/un.cr
	modified:   clients/d/sync/src/un.d
	modified:   clients/dart/sync/src/un.dart
	modified:   clients/elixir/sync/src/un.ex
	modified:   clients/erlang/sync/src/un.erl
	modified:   clients/forth/sync/src/un.forth
	modified:   clients/fortran/sync/src/un.f90
	modified:   clients/fsharp/sync/src/un.fs
	modified:   clients/haskell/sync/src/un.hs
	modified:   clients/julia/sync/src/un.jl
	modified:   clients/kotlin/sync/src/un.kt
	modified:   clients/lisp/sync/src/un.lisp
	modified:   clients/nim/sync/src/un.nim
	modified:   clients/ocaml/sync/src/un.ml
	modified:   clients/powershell/sync/src/un.ps1
	modified:   clients/prolog/sync/src/un.pro
	modified:   clients/r/sync/src/un.r
	modified:   clients/scheme/sync/src/un.scm
	modified:   clients/tcl/sync/src/un.tcl
	modified:   clients/typescript/sync/src/un.ts
	modified:   clients/v/sync/src/un.v
	modified:   clients/zig/sync/src/un.zig
2026-01-17 12:01:42 -05:00
af995cdc1a feat(cli): Add languages and image commands to all 42 SDKs
- Add `un languages [--json]` command to list available execution languages
- Add `un image` command with full image management:
  - --list, --info, --delete, --lock, --unlock
  - --publish, --visibility, --spawn, --clone
- Update CLI_SPEC.md with new command documentation
- All implementations follow consistent patterns
2026-01-17 10:25:20 -05:00
b9860a93a1 feat: Complete C library API and migrate all languages to clients/
C SDK Library API:
- Implement all 43+ library functions with JSON parsing
- Add Image API (15 functions): list, get, publish, delete, lock/unlock,
  visibility, grant/revoke access, transfer, spawn, clone
- Add infrastructure helpers: count_json_array_objects, skip_json_object,
  set_last_error with thread-local storage
- Functional tests: 30/30 passing

Migration:
- Create 6 new language directories: awk, cpp, forth, lisp, objective-c, v
- Migrate all 42 un.* files to clients/*/sync/src/
- Convert root un.* files to symlinks pointing to clients/
- Add Makefiles for new languages

Files:
- clients/c/src/un.c: Full library API implementation
- clients/c/src/un.h: Image types and function declarations
- clients/c/tests/test_functional.c: API functional tests
- CLAUDE.md: Updated migration status
2026-01-17 00:11:53 -05:00
48c7fec3ae feat: add Makefiles for 10 more language clients
Add per-client Makefiles for:
- bash (shell scripts, bats testing)
- perl (modules, prove testing)
- lua (modules, busted testing)
- typescript (tsc, jest)
- kotlin (gradle/maven)
- elixir (mix)
- haskell (stack/cabal)
- scala (sbt)
- swift (swift package manager)
- csharp (dotnet)

All follow the 4-mode testing pattern:
- CLI mode: syntax validation, --help
- Library mode: import/require tests
- Integration mode: API contract
- Functional mode: real-world scenarios

Total: 18 language clients with Makefiles
2026-01-15 16:52:58 -05:00