How project-x-innovation/ns-gm works
ns-gm is a NetSuite SuiteScript execution and log-retrieval CLI backed by a local HTTP proxy and a deployed NetSuite RESTlet. Users configure an OAuth profile, start the proxy, submit inline or file-based code (or request logs), and receive results in the CLI. The graph separates CLI command workflows, local proxy handling, authentication/transport, and NetSuite-side execution. The RESTlet implementation and several command implementations were not excerpted; those capabilities and relationships are included only where the README documents them.
Components 21
CLI workflows
- Command dispatcher
src/cli.js - Interactive setup
src/commands/setup.js - CI setup
src/commands/setup-ci.js - Profile store
src/utils/profileStore.js - Start proxy
src/commands/init.js - Run code
src/commands/run.js - Fetch logs
src/commands/logs.js - Environment query
src/commands/env.js - Stop proxy
src/commands/stop.js - CLI help
src/commands/help.js - Exit handling
src/utils/exitCodes.js
Local proxy
- Proxy configuration
src/utils/config.js - HTTP proxy
server/app.js - Code endpoint
server/app.js - Logs endpoint
server/app.js
Authentication and transport
- OAuth token client
server/auth.js - RESTlet transport
server/auth.js
NetSuite service
- SuiteScript RESTlet
ns_gm_restlet.js - NetSuite account
- OAuth service
Other components
- CLI user
Connections 27
- CLI user → Command dispatcher: runs commands
README.md - Command dispatcher → Interactive setup: dispatches
src/cli.js - Command dispatcher → CI setup: dispatches
src/cli.js - Command dispatcher → Start proxy: dispatches
src/cli.js - Command dispatcher → Run code: dispatches
src/cli.js - Command dispatcher → Fetch logs: dispatches
src/cli.js - Command dispatcher → Environment query: dispatches
src/cli.js - Command dispatcher → Stop proxy: dispatches
src/cli.js - Command dispatcher → CLI help: dispatches
src/cli.js - Interactive setup → Profile store: reads and writes
src/commands/setup.js - CI setup → Profile store: updates
src/commands/setup-ci.js - Start proxy → HTTP proxy: starts process
src/commands/init.js - Run code → HTTP proxy: posts code
src/commands/run.js - Fetch logs → HTTP proxy: posts filters
src/commands/logs.js - Run code → Exit handling: uses
src/commands/run.js - Fetch logs → Exit handling: uses
src/commands/logs.js - HTTP proxy → Proxy configuration: reads port
server/app.js - HTTP proxy → Profile store: reads active profile
server/app.js - HTTP proxy → Code endpoint: routes request
server/app.js - HTTP proxy → Logs endpoint: routes request
server/app.js - Code endpoint → RESTlet transport: submits code
server/app.js - Logs endpoint → RESTlet transport: requests logs
server/app.js - RESTlet transport → OAuth token client: gets token
server/auth.js - OAuth token client → OAuth service: requests token
server/auth.js - RESTlet transport → SuiteScript RESTlet: posts action
server/auth.js - SuiteScript RESTlet → NetSuite account: executes in
README.md - Stop proxy → HTTP proxy: stops service
README.md