studio-demo

command
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Studio workbench demo

This runnable Go server puts one Svelte workbench over both registered Go actions and an NFlow-declared HTTP route. From the repository root, run:

go run ./examples/studio-demo

Open http://127.0.0.1:8088/studio/. Use the ALL, GO, and NFLOW filters to switch between operation types. The dark/gold workbench loads request fields and schemas from the real action metadata or Analyzer output; it does not create a second NFlow parser.

NFlow route

examples/studio-demo/app.nflow declares POST /api/demo/nflow-echo, its request and response schemas, and the demo_nflow_echo pipeline. The pipeline calls the same registered Go action shown in the directory as demo.echo.

curl -sS http://127.0.0.1:8088/api/demo/nflow-echo \
  -H 'Content-Type: application/json' \
  -d '{"message":"through NFlow","repeat":2}'

The workbench sends NFlow requests to that same-origin HTTP endpoint and shows its actual status, response body, and elapsed time. The Studio identity selector does not override route identity; the request uses the browser's normal session and server authentication.

Registered Go actions

The Go actions are registered in main.go and executed through Studio's action executor. They also expose their explicitly registered HTTP bindings.

Go action HTTP endpoint Example request
demo.echo POST /api/demo/echo {"message":"hello","repeat":2}
demo.calculate POST /api/demo/calculate {"left":7,"right":5,"operator":"+"}
demo.validate POST /api/demo/validate {"title":"release notes"}; use "reject" for a structured validation error
demo.secure-preview POST /api/demo/secure-preview {"document_id":"doc-42"}; requires the operator role, demo.write permission, and preview-v2 feature

Go-action runs made inside Studio include decoded input, output or structured errors, duration, trace spans, and replayable history. The Studio also exposes GET /studio/api/actions, POST /studio/api/execute, POST /studio/api/ai/scenario, GET /studio/api/history, and GET /system/security.

For local testing only, the claims selector can supply an identity override when both flags are enabled:

APP_ENV=development NEXSS_STUDIO_ALLOW_IDENTITY_OVERRIDE=true go run ./examples/studio-demo

The override is ignored unless APP_ENV is dev, development, or test and NEXSS_STUDIO_ALLOW_IDENTITY_OVERRIDE=true. Do not enable it in a production deployment.

Refreshing the generated backend

backend_server_gen.go is checked in so the demo can be started with go run. If you edit a Go action binding or the NFlow route, regenerate the analyzed route table:

go run ./cmd/nexssp backend \
  --scan ./examples/studio-demo \
  --out ./examples/studio-demo/backend_server_gen.go \
  --package main \
  --function RunStudioDemoBackend \
  --force

Documentation

Overview

Code generated by nexssp OPS. DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL