nebula_api_studio 0.1.0
nebula_api_studio: ^0.1.0 copied to clipboard
A professional Dart/Flutter package combining a Compiler + Runtime SDK. Convert OpenAPI 3.x / Swagger 2.0 specs into fully type-safe Dart SDKs with smart caching, retry policies, a plugin system, offl [...]
Changelog #
All notable changes to Nebula API Studio are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
Planned #
- WebSocket endpoint support in the compiler and runtime
- File-upload helpers (
multipart/form-data) inNebulaClient nebula_offlinecompanion package with persistent SQLite queue- GraphQL spec parser
- Freezed integration option for generated models
dart pub publishCI workflow
1.0.0 — 2024-01-15 #
Added #
Compiler
OpenApiParser— full OpenAPI 3.0 / 3.1 spec parser producing a typed ASTSwaggerParser— Swagger 2.0 / 2.x spec parserParserInterface— extensible base for custom spec formatsApiAst— root intermediate representation nodeApiEndpoint— endpoint node with method, path, parameters, request body and response typeApiModel— model/schema node with typed fieldsApiType— primitive, object, array and enum type nodes with nullable flagNameNormalizer— snake_case / kebab-case / PascalCase / camelCase conversions with Dart reserved-keyword escapingNullSafetyInferrer— promotes required fields to non-nullable, optional fields to nullableSchemaDeduplicator— removes exact duplicate schemas; renames structural conflictsCodeEmitter— low-level string buffer with indentation helpersModelGenerator— emits null-safe Dart model classes withfromJson/toJson,copyWith,==andhashCodeEnumGenerator— emits Dart enums withfromJson/toJsonhelpersServiceGenerator— emits typed service classes backed byNebulaClientNebulaCompilerfaçade — orchestrates parse → optimize → generate pipeline
Runtime
Result<T>— typed success/failure monad withmap,flatMap,when,getOrElseApiError— structured error withcode,message,statusCode,details,isClientError,isServerErrorApiRequest— immutable request value object withcopyWithandfullUrlhelpersApiResponse— immutable response withisSuccessand typedbodyNebulaClient— single HTTP execution entry point with plugin chain, cache and retryHttpAdapter— interface for swapping HTTP implementationsDefaultAdapter— productiondart:ioHTTP adapterMemoryCache— in-memory LRU cache with per-entry TTLCacheProvider— abstract cache interfaceCachePolicy— per-client cache configuration with configurable cacheable methodsInvalidationGraph— tag-based dependency graph with cascading invalidationRetryPolicy— declarative retry configuration with per-status-code controlExponentialBackoff— exponential delay calculator with optional ±25 % jitterRetryEngine— transparent retry orchestration wrapping anyFuture<ApiResponse>ApiPlugin— interceptor interface (beforeRequest,afterResponse,onError)PluginChain— ordered plugin pipeline with correct request/response orderingAuthPlugin— Bearer / API-key / custom-scheme authentication header injectorLoggingPlugin— structured request/response logger withdebug / info / warn / errorlevelsAnalyticsPlugin— fires analytics events on every request/response cycleRequestQueue— offline request queue with priority and persistence hooksSyncEngine— connectivity-aware queue flusher
CLI
bin/nebula.dart— CLI entry point powered bypackage:argsgeneratecommand — one-shot code generation from spec filewatchcommand — incremental regeneration usingpackage:watcherinitcommand — project scaffolding withnebula.config.jsontemplatedoctorcommand — environment health check (Dart SDK, wrangler, config validity)ConfigLoader— JSON config reader with CLI override merging and schema validationWatcher— file-system watcher abstraction overpackage:watcher
Public API
lib/nebula_api_studio.dart— single barrel export for all public symbols
Example
example/swagger.yaml— complete Pet Store OpenAPI 3.0 spec (pets, owners, orders, enums, nested models)example/nebula.config.json— annotated configuration exampleexample/main.dart— end-to-end demo: mock adapter, plugin chain, CRUD operations, Result chaining, cache stats
Tests
test/compiler/ast_test.dart— AST construction andApiTypeprimitivestest/compiler/parser_test.dart— OpenAPI 3.x and Swagger 2.0 parsing (12 test cases)test/compiler/optimizer_test.dart—NameNormalizer,NullSafetyInferrer,SchemaDeduplicatortest/runtime/result_test.dart—Result<T>,ApiError,ApiRequest,ApiResponsetest/runtime/client_test.dart—NebulaClientexecution, plugins, retry and cachetest/runtime/cache_test.dart—MemoryCache,CachePolicy,InvalidationGraphtest/runtime/retry_plugin_test.dart—RetryPolicy,ExponentialBackoff,RetryEngine,PluginChain,AuthPlugintest/cli/config_loader_test.dart—ConfigLoader,NebulaConfig, all exception types
Documentation
README.md— full documentation with architecture diagram, quick-start, API reference and contribution guideCHANGELOG.md— this fileLICENSE— MIT licenseanalysis_options.yaml— strict lint rules