From 148c4f7ea583d79994b9cdc723f7a64eba3e8446 Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:34:31 +0300 Subject: [PATCH 1/6] ci: remove generated fixture validation --- .github/workflows/ci.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9985afe..73aee46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,21 +33,5 @@ jobs: - name: Run tests run: flutter test - - name: Resolve generated package fixture - working-directory: tool/generated_runtime_fixture - run: flutter pub get - - - name: Verify generated fixture formatting - working-directory: tool/generated_runtime_fixture - run: dart format --output=none --set-exit-if-changed lib test - - - name: Analyze generated package fixture - working-directory: tool/generated_runtime_fixture - run: flutter analyze - - - name: Test generated-package-only imports - working-directory: tool/generated_runtime_fixture - run: flutter test - - name: Validate package publication run: flutter pub publish --dry-run From a063a29c77234ef0a968d857e78f517e95e581eb Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:34:40 +0300 Subject: [PATCH 2/6] chore: remove generated fixture publish metadata --- .pubignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.pubignore b/.pubignore index bb86c6d..562b285 100644 --- a/.pubignore +++ b/.pubignore @@ -1,3 +1,2 @@ .github/ -tool/generated_runtime_fixture/ publish-dry-run.log From 46d15f462242dd7477a77990df26c78816e40e13 Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:34:45 +0300 Subject: [PATCH 3/6] chore: remove generated runtime fixture --- tool/generated_runtime_fixture/analysis_options.yaml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tool/generated_runtime_fixture/analysis_options.yaml diff --git a/tool/generated_runtime_fixture/analysis_options.yaml b/tool/generated_runtime_fixture/analysis_options.yaml deleted file mode 100644 index d04adaf..0000000 --- a/tool/generated_runtime_fixture/analysis_options.yaml +++ /dev/null @@ -1,7 +0,0 @@ -include: package:lints/recommended.yaml - -analyzer: - language: - strict-casts: true - strict-inference: true - strict-raw-types: true From 199acf95df839539aa72973915a43b849aa14bf8 Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:34:52 +0300 Subject: [PATCH 4/6] chore: remove generated runtime fixture package --- tool/generated_runtime_fixture/pubspec.yaml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 tool/generated_runtime_fixture/pubspec.yaml diff --git a/tool/generated_runtime_fixture/pubspec.yaml b/tool/generated_runtime_fixture/pubspec.yaml deleted file mode 100644 index a9b2768..0000000 --- a/tool/generated_runtime_fixture/pubspec.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: generated_runtime_fixture -description: Compile-time fixture matching generated Dart API packages. -version: 0.0.0 -publish_to: none - -environment: - sdk: ">=3.6.0 <4.0.0" - -dependencies: - flutter: - sdk: flutter - flutter_api_bridge: - path: ../.. - -dev_dependencies: - flutter_test: - sdk: flutter - lints: ^5.1.1 - -flutter: - uses-material-design: false From 0fcd0ce9d8265ccafa0f5bb319259e76d5cd7ca2 Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:35:01 +0300 Subject: [PATCH 5/6] chore: remove generated runtime fixture facade --- .../lib/generated_api.dart | 161 ------------------ 1 file changed, 161 deletions(-) delete mode 100644 tool/generated_runtime_fixture/lib/generated_api.dart diff --git a/tool/generated_runtime_fixture/lib/generated_api.dart b/tool/generated_runtime_fixture/lib/generated_api.dart deleted file mode 100644 index 0ac5409..0000000 --- a/tool/generated_runtime_fixture/lib/generated_api.dart +++ /dev/null @@ -1,161 +0,0 @@ -import 'package:flutter_api_bridge/flutter_api_bridge.dart'; - -export 'package:flutter_api_bridge/flutter_api_bridge.dart' - show - ApiAuth, - ApiBridgeConfig, - ApiCacheConfig, - ApiCachePolicy, - ApiClientIdentity, - ApiClientIdentityProvider, - ApiConnection, - ApiDataSource, - ApiGetRequestOptions, - ApiLogger, - ApiLoggingConfig, - ApiRequestOptions, - ApiResult, - ApiRetryConfig, - ApiUploadRequestOptions, - AuthSession, - AuthSessionStatus, - AuthStrategy, - BearerStrategy, - CookieStrategy, - DeveloperApiLogger, - UploadFile; - -/// Representative root facade emitted by a generated API package. -class GeneratedApi { - GeneratedApi._(ApiConnection connection) : v1 = GeneratedV1Client(connection); - - static const String connectionKey = 'generated_api_fixture'; - - static GeneratedApi? _instance; - - static Future configure( - ApiBridgeConfig config, { - bool replace = true, - }) async { - await FlutterApiBridge.configure( - key: connectionKey, - config: config, - replace: replace, - ); - _instance = null; - } - - static Future initialize({ - required Uri baseUri, - AuthStrategy auth = const CookieStrategy(), - bool cookiesEnabled = true, - Map defaultHeaders = const {}, - ApiCacheConfig cache = const ApiCacheConfig(), - ApiRetryConfig retry = const ApiRetryConfig(), - ApiLogger logger = const DeveloperApiLogger(), - ApiLoggingConfig logging = const ApiLoggingConfig(), - ApiClientIdentityProvider? clientIdentity, - }) => - configure( - ApiBridgeConfig( - baseUri: baseUri, - auth: auth, - cookiesEnabled: cookiesEnabled, - defaultHeaders: defaultHeaders, - cache: cache, - retry: retry, - logger: logger, - logging: logging, - clientIdentity: clientIdentity, - ), - ); - - static ApiConnection get connection => - FlutterApiBridge.requireConnection(connectionKey); - - static ApiAuth get auth => connection.auth; - - static Future initializeUserSession({ - required String sessionId, - String? bearerToken, - Map? authHeaders, - Map metadata = const {}, - }) => - connection.initializeUserSession( - sessionId: sessionId, - bearerToken: bearerToken, - authHeaders: authHeaders, - metadata: metadata, - ); - - static Future clearActiveSessionCache() => - connection.clearActiveSessionCache(); - - static Future clearSessionCache(String sessionId) => - connection.clearSessionCache(sessionId); - - static Future clearAllCache() => connection.clearAllCache(); - - static Future logout() async { - await connection.logout(); - _instance = null; - } - - static GeneratedApi get instance => _instance ??= GeneratedApi._(connection); - - final GeneratedV1Client v1; -} - -class GeneratedV1Client { - GeneratedV1Client(ApiConnection connection) - : things = GeneratedThingsFeature(connection); - - final GeneratedThingsFeature things; -} - -class GeneratedThingsFeature { - const GeneratedThingsFeature(this._connection); - - final ApiConnection _connection; - - Future>> list({ - ApiGetRequestOptions? options, - }) => - _connection.execute( - GetRequest>( - endpoint: '/things', - options: (options ?? const ApiGetRequestOptions()).copyWith( - operationId: 'things.list', - ), - fromJson: (json) => Map.from(json as Map), - ), - ); - - Future> create({ - required Map body, - ApiRequestOptions? options, - }) => - _connection.execute( - PostRequest( - endpoint: '/things', - body: body, - options: (options ?? const ApiRequestOptions()).copyWith( - operationId: 'things.create', - ), - ), - ); - - Future> upload({ - required List files, - ApiUploadRequestOptions? options, - }) => - _connection.execute( - UploadRequest( - endpoint: '/things/upload', - files: files, - options: (options ?? const ApiUploadRequestOptions()).copyWith( - operationId: 'things.upload', - ), - ), - ); -} From 05397457a49486fa3a3afb47836017e833b2cfd9 Mon Sep 17 00:00:00 2001 From: PETER IRUNGU <117439552+Alidantech@users.noreply.github.com> Date: Sat, 18 Jul 2026 12:35:08 +0300 Subject: [PATCH 6/6] chore: remove generated runtime fixture tests --- .../test/generated_api_test.dart | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 tool/generated_runtime_fixture/test/generated_api_test.dart diff --git a/tool/generated_runtime_fixture/test/generated_api_test.dart b/tool/generated_runtime_fixture/test/generated_api_test.dart deleted file mode 100644 index 24eb2d2..0000000 --- a/tool/generated_runtime_fixture/test/generated_api_test.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:generated_runtime_fixture/generated_api.dart'; - -void main() { - test('application imports bridge controls through generated package', () { - const options = ApiGetRequestOptions( - cache: false, - forceRefresh: true, - cookies: {'preview': 'yes'}, - headers: {'X-Tenant': 'company-7'}, - ); - - final generated = options.copyWith(operationId: 'things.list'); - - expect(GeneratedApi.connectionKey, 'generated_api_fixture'); - expect(generated.operationId, 'things.list'); - expect(generated.cache, isFalse); - expect(generated.forceRefresh, isTrue); - expect(generated.cookies?['preview'], 'yes'); - expect(generated.headers?['X-Tenant'], 'company-7'); - }); - - test('generated package exposes production runtime configuration', () { - const cache = ApiCacheConfig( - defaultPolicy: ApiCachePolicy.networkWithStaleFallback, - ); - const retry = ApiRetryConfig(maxAttempts: 3); - const identity = ApiClientIdentity( - applicationName: 'RiderescueDriver', - applicationVersion: '1.0.0', - platform: 'android', - ); - const upload = ApiUploadRequestOptions( - operationId: 'things.upload', - idempotencyKey: 'upload-1', - ); - - expect(cache.defaultPolicy, ApiCachePolicy.networkWithStaleFallback); - expect(retry.maxAttempts, 3); - expect(identity.userAgent, contains('RiderescueDriver/1.0.0')); - expect(upload.operationId, 'things.upload'); - expect(upload.idempotencyKey, 'upload-1'); - }); -}