@_nazmiforreal/flutter-ota 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -18
- package/bin/flutter-ota-linux-x64 +0 -0
- package/bin/flutter-ota.js +12 -11
- package/dart-src/packages/cli-tools/README.md +146 -2
- package/dart-src/packages/cli-tools/lib/flutter_ota_kit_cli.dart +46 -13
- package/dart-src/packages/cli-tools/lib/src/backend.dart +6 -6
- package/dart-src/packages/cli-tools/lib/src/commands/build.dart +2 -0
- package/dart-src/packages/cli-tools/lib/src/commands/bundle.dart +7 -7
- package/dart-src/packages/cli-tools/lib/src/commands/deploy.dart +4 -1
- package/dart-src/packages/cli-tools/lib/src/commands/init.dart +36 -8
- package/dart-src/packages/cli-tools/lib/src/commands/pocketbase.dart +1 -1
- package/dart-src/packages/cli-tools/lib/src/commands/rollback.dart +1 -1
- package/dart-src/packages/cli-tools/lib/src/config.dart +5 -5
- package/dart-src/packages/cli-tools/lib/src/operations.dart +2 -2
- package/dart-src/packages/cli-tools/pubspec.yaml +8 -21
- package/dart-src/packages/cli-tools/test/backends_test.dart +3 -3
- package/dart-src/packages/cli-tools/test/cli_test.dart +1 -1
- package/dart-src/packages/cli-tools/test/mocks/mock_aws_s3_client.dart +2 -2
- package/dart-src/packages/cli-tools/test/mocks/mock_d1_client.dart +2 -2
- package/dart-src/packages/cli-tools/test/mocks/mock_pocketbase_client.dart +4 -1
- package/dart-src/packages/cli-tools/test/mocks/mock_postgres_client.dart +2 -2
- package/dart-src/packages/cli-tools/test/pocketbase_smoke_test.dart +1 -1
- package/dart-src/root/README.md +334 -0
- package/dart-src/root/analysis_options.yaml +21 -0
- package/dart-src/root/android/build.gradle +116 -0
- package/dart-src/root/android/consumer-rules.pro +23 -0
- package/dart-src/root/android/settings.gradle +1 -0
- package/dart-src/root/android/src/main/AndroidManifest.xml +21 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/ApplyResult.kt +52 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/BlacklistStore.kt +154 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/BootDiagnosticStore.kt +150 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/CrashGuard.kt +271 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/FlutterPatcherApplication.kt +201 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/FlutterPatcherAutoInitProvider.kt +93 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/FlutterPatcherPlugin.kt +245 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/LoaderHook.kt +298 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/PatchManager.kt +1579 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/PatcherConfig.kt +173 -0
- package/dart-src/root/android/src/main/kotlin/com/flutter_patcher/flutter_patcher/SignatureVerifier.kt +177 -0
- package/dart-src/root/android/src/test/kotlin/com/flutter_patcher/flutter_patcher/CrashGuardTest.kt +61 -0
- package/dart-src/root/android/src/test/kotlin/com/flutter_patcher/flutter_patcher/LoaderHookTest.kt +25 -0
- package/dart-src/root/android/src/test/kotlin/com/flutter_patcher/flutter_patcher/PatchManagerTest.kt +401 -0
- package/dart-src/root/android/src/test/kotlin/com/flutter_patcher/flutter_patcher/PatcherConfigTest.kt +30 -0
- package/dart-src/root/bin/pack.dart +182 -0
- package/dart-src/root/lib/flutter_ota_kit.dart +1170 -0
- package/dart-src/root/lib/src/app_version_resolver.dart +36 -0
- package/dart-src/root/lib/src/aws_update_source.dart +97 -0
- package/dart-src/root/lib/src/blacklist.dart +54 -0
- package/dart-src/root/lib/src/boot_diagnostic.dart +138 -0
- package/dart-src/root/lib/src/cloudflare_update_source.dart +97 -0
- package/dart-src/root/lib/src/flutter_ota_app.dart +69 -0
- package/dart-src/root/lib/src/io.dart +48 -0
- package/dart-src/root/lib/src/io_stub.dart +19 -0
- package/dart-src/root/lib/src/ota_progress_overlay.dart +1186 -0
- package/dart-src/root/lib/src/pack/pack.dart +434 -0
- package/dart-src/root/lib/src/patch_info.dart +12 -0
- package/dart-src/root/lib/src/patcher_channel.dart +160 -0
- package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_database.dart +1 -1
- package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_s3_client.dart +1 -1
- package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_storage.dart +1 -1
- package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_storage_profile.dart +1 -1
- package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/with_cloudfront_signed_url.dart +1 -1
- package/dart-src/root/lib/src/pkg/client/flutter_ota_kit_client.dart +1 -0
- package/dart-src/root/lib/src/pkg/client/src/server_update_source.dart +46 -0
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/cloudflare_worker_database.dart +1 -1
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_build_where.dart +1 -1
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_bundle_mapper.dart +3 -3
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_database.dart +1 -1
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_database_plugin.dart +2 -2
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/r2_s3_client.dart +1 -1
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/r2_storage.dart +1 -1
- package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/r2_storage_profile.dart +1 -1
- package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/status.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/flutter_ota_kit_plugin_core.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/create_blob_database_plugin.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/filter_compatible_app_versions.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/get_update_info.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/request_update_bundle_state.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/resolve_update_info_from_bundles.dart +1 -1
- package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/types.dart +2 -2
- package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/src/pocketbase_bundle_mapper.dart +2 -2
- package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/src/pocketbase_database.dart +26 -15
- package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/src/pocketbase_storage.dart +1 -1
- package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_bundle_mapper.dart +2 -2
- package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_database.dart +2 -2
- package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_get_update_info.dart +2 -2
- package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_storage.dart +1 -1
- package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_types.dart +1 -1
- package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_bundle_mapper.dart +2 -2
- package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_database.dart +2 -2
- package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_edge_function_database.dart +1 -1
- package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_edge_function_storage.dart +1 -1
- package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_storage.dart +1 -1
- package/dart-src/root/lib/src/pocketbase_update_source.dart +107 -0
- package/dart-src/root/lib/src/postgres_update_source.dart +95 -0
- package/dart-src/root/lib/src/shared_update_check.dart +131 -0
- package/dart-src/root/lib/src/supabase_update_source.dart +93 -0
- package/dart-src/root/pubspec.yaml +54 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +17 -13
- package/scripts/vendor.sh +22 -7
- package/dart-src/packages/core/CHANGELOG.md +0 -21
- package/dart-src/packages/core/README.md +0 -23
- package/dart-src/packages/core/example/lib/main.dart +0 -69
- package/dart-src/packages/core/pubspec.yaml +0 -13
- package/dart-src/packages/core/test/rollout_test.dart +0 -135
- package/dart-src/packages/core/test/semver_test.dart +0 -55
- package/dart-src/packages/core/test/semver_vectors.json +0 -1
- package/dart-src/packages/core/test/types_test.dart +0 -131
- package/dart-src/packages/core/test/uuid_test.dart +0 -40
- package/dart-src/packages/core/tool/dbg.dart +0 -7
- package/dart-src/plugins/aws/.gitkeep +0 -0
- package/dart-src/plugins/aws/CHANGELOG.md +0 -23
- package/dart-src/plugins/aws/LICENSE +0 -21
- package/dart-src/plugins/aws/README.md +0 -28
- package/dart-src/plugins/aws/example/lib/main.dart +0 -60
- package/dart-src/plugins/aws/pubspec.yaml +0 -30
- package/dart-src/plugins/aws/test/aws_database_test.dart +0 -161
- package/dart-src/plugins/aws/test/aws_storage_test.dart +0 -73
- package/dart-src/plugins/aws/test/mock_aws_s3_client.dart +0 -78
- package/dart-src/plugins/cloudflare/.gitkeep +0 -0
- package/dart-src/plugins/cloudflare/CHANGELOG.md +0 -23
- package/dart-src/plugins/cloudflare/LICENSE +0 -21
- package/dart-src/plugins/cloudflare/README.md +0 -25
- package/dart-src/plugins/cloudflare/example/lib/main.dart +0 -62
- package/dart-src/plugins/cloudflare/migrations/0001_hot-updater_init.sql +0 -16
- package/dart-src/plugins/cloudflare/migrations/0002_hot-updater_0.13.0.sql +0 -8
- package/dart-src/plugins/cloudflare/migrations/0003_hot-updater_0.18.0.sql +0 -38
- package/dart-src/plugins/cloudflare/migrations/0004_hot-updater_0.29.0.sql +0 -11
- package/dart-src/plugins/cloudflare/migrations/0005_hot-updater_0.31.0.sql +0 -24
- package/dart-src/plugins/cloudflare/pubspec.yaml +0 -28
- package/dart-src/plugins/cloudflare/sql/bundles.sql +0 -42
- package/dart-src/plugins/cloudflare/test/cloudflare_worker_database_test.dart +0 -126
- package/dart-src/plugins/cloudflare/test/d1_bundle_mapper_test.dart +0 -106
- package/dart-src/plugins/cloudflare/test/d1_database_test.dart +0 -200
- package/dart-src/plugins/cloudflare/test/mock_d1_client.dart +0 -261
- package/dart-src/plugins/cloudflare/test/mock_r2_client.dart +0 -78
- package/dart-src/plugins/cloudflare/test/r2_storage_test.dart +0 -74
- package/dart-src/plugins/plugin-core/CHANGELOG.md +0 -20
- package/dart-src/plugins/plugin-core/LICENSE +0 -21
- package/dart-src/plugins/plugin-core/README.md +0 -21
- package/dart-src/plugins/plugin-core/example/lib/main.dart +0 -61
- package/dart-src/plugins/plugin-core/pubspec.yaml +0 -23
- package/dart-src/plugins/plugin-core/test/asset_storage_layout_test.dart +0 -170
- package/dart-src/plugins/plugin-core/test/bundle_unit_of_work_store_test.dart +0 -74
- package/dart-src/plugins/plugin-core/test/bundle_unit_of_work_test.dart +0 -345
- package/dart-src/plugins/plugin-core/test/create_blob_database_plugin_test.dart +0 -843
- package/dart-src/plugins/plugin-core/test/create_database_plugin_test.dart +0 -298
- package/dart-src/plugins/plugin-core/test/create_storage_plugin_test.dart +0 -195
- package/dart-src/plugins/plugin-core/test/generate_min_bundle_id_test.dart +0 -56
- package/dart-src/plugins/plugin-core/test/get_update_info_test.dart +0 -1589
- package/dart-src/plugins/plugin-core/test/helpers_test.dart +0 -283
- package/dart-src/plugins/plugin-core/test/query_bundles_test.dart +0 -202
- package/dart-src/plugins/plugin-core/test/request_update_bundle_state_test.dart +0 -86
- package/dart-src/plugins/plugin-core/test/uuidv7_test.dart +0 -88
- package/dart-src/plugins/pocketbase/CHANGELOG.md +0 -23
- package/dart-src/plugins/pocketbase/LICENSE +0 -21
- package/dart-src/plugins/pocketbase/README.md +0 -54
- package/dart-src/plugins/pocketbase/example/lib/main.dart +0 -62
- package/dart-src/plugins/pocketbase/pubspec.yaml +0 -26
- package/dart-src/plugins/pocketbase/test/pb_uri_test.dart +0 -12
- package/dart-src/plugins/postgres/.gitkeep +0 -0
- package/dart-src/plugins/postgres/CHANGELOG.md +0 -23
- package/dart-src/plugins/postgres/LICENSE +0 -21
- package/dart-src/plugins/postgres/README.md +0 -29
- package/dart-src/plugins/postgres/example/lib/main.dart +0 -67
- package/dart-src/plugins/postgres/pubspec.yaml +0 -26
- package/dart-src/plugins/postgres/sql/bundles.sql +0 -45
- package/dart-src/plugins/postgres/sql/get_target_app_version_list.sql +0 -21
- package/dart-src/plugins/postgres/sql/get_update_info.spec.ts +0 -171
- package/dart-src/plugins/postgres/sql/get_update_info_by_app_version.sql +0 -126
- package/dart-src/plugins/postgres/sql/get_update_info_by_fingerprint_hash.sql +0 -125
- package/dart-src/plugins/postgres/sql/hash_user_id.sql +0 -30
- package/dart-src/plugins/postgres/sql/is_device_eligible.sql +0 -237
- package/dart-src/plugins/postgres/sql/prepareSql.ts +0 -11
- package/dart-src/plugins/postgres/test/mock_postgres_client.dart +0 -320
- package/dart-src/plugins/postgres/test/postgres_bundle_mapper_test.dart +0 -139
- package/dart-src/plugins/postgres/test/postgres_database_test.dart +0 -210
- package/dart-src/plugins/postgres/test/postgres_storage_runtime_test.dart +0 -60
- package/dart-src/plugins/supabase/CHANGELOG.md +0 -24
- package/dart-src/plugins/supabase/LICENSE +0 -21
- package/dart-src/plugins/supabase/README.md +0 -53
- package/dart-src/plugins/supabase/example/lib/main.dart +0 -63
- package/dart-src/plugins/supabase/pubspec.yaml +0 -27
- package/dart-src/plugins/supabase/supabase/edge-functions/index.ts +0 -44
- package/dart-src/plugins/supabase/supabase/edge-functions/runtime.docker.integration.spec.ts +0 -968
- package/dart-src/plugins/supabase/supabase/migrations/20250103114225_init.sql +0 -232
- package/dart-src/plugins/supabase/supabase/migrations/20250314000000_hot-updater_0.13.0.sql +0 -137
- package/dart-src/plugins/supabase/supabase/migrations/20250516000000_hot-updater_0.18.0.sql +0 -206
- package/dart-src/plugins/supabase/supabase/migrations/20251014000000_hot-updater_0.21.0.sql +0 -186
- package/dart-src/plugins/supabase/supabase/migrations/20260401000000_hot-updater_0.29.0.sql +0 -505
- package/dart-src/plugins/supabase/supabase/migrations/20260414000000_hot-updater_0.30.0.sql +0 -50
- package/dart-src/plugins/supabase/supabase/migrations/20260422000000_hot-updater_0.31.0.sql +0 -20
- package/dart-src/plugins/supabase/supabase/migrations/20260520014100_hot-updater_rls.sql +0 -75
- package/dart-src/plugins/supabase/test/mock_supabase_client.dart +0 -654
- package/dart-src/plugins/supabase/test/supabase_bundle_mapper_test.dart +0 -115
- package/dart-src/plugins/supabase/test/supabase_database_test.dart +0 -198
- package/dart-src/plugins/supabase/test/supabase_storage_test.dart +0 -168
- /package/dart-src/{packages/core → root}/LICENSE +0 -0
- /package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/flutter_ota_kit_aws.dart +0 -0
- /package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_cloudfront_client.dart +0 -0
- /package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_cloudfront_signer.dart +0 -0
- /package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_config.dart +0 -0
- /package/dart-src/{plugins/aws/lib → root/lib/src/pkg/aws}/src/aws_ssm_client.dart +0 -0
- /package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/flutter_ota_kit_cloudflare.dart +0 -0
- /package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_client.dart +0 -0
- /package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/d1_config.dart +0 -0
- /package/dart-src/{plugins/cloudflare/lib → root/lib/src/pkg/cloudflare}/src/r2_config.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/flutter_ota_kit_core.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/app_update_info.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/bundle.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/bundle_artifacts.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/bundle_patch_artifact.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/changed_asset.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/get_bundles_args.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/metadata.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/patch_info.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/platform.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/rollout.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/semver.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/semver_range.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/semver_version.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/strategy.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/update_bundle_params.dart +0 -0
- /package/dart-src/{packages/core/lib → root/lib/src/pkg/core}/src/uuid.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/asset_storage_layout.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/bundle_helpers.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/bundle_storage_layout.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/bundle_unit_of_work.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/bundle_unit_of_work_store.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/calculate_pagination.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/compression_format.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/content_addressed_assets.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/create_database_plugin.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/create_storage_key_builder.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/create_storage_plugin.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/generate_min_bundle_id.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/is_object.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/legacy_asset_storage_layout.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/paginate_bundles.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/parse_storage_uri.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/query_bundles.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/storage_helpers.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/storage_profile.dart +0 -0
- /package/dart-src/{plugins/plugin-core/lib → root/lib/src/pkg/plugin_core}/src/uuidv7.dart +0 -0
- /package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/flutter_ota_kit_pocketbase.dart +0 -0
- /package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/src/pocketbase_client.dart +0 -0
- /package/dart-src/{plugins/pocketbase/lib → root/lib/src/pkg/pocketbase}/src/pocketbase_config.dart +0 -0
- /package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/flutter_ota_kit_postgres.dart +0 -0
- /package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_client.dart +0 -0
- /package/dart-src/{plugins/postgres/lib → root/lib/src/pkg/postgres}/src/postgres_config.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/edge.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/flutter_ota_kit_supabase.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/error_message.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_client_adapter.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_client_http.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_config.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/supabase_signed_url_batcher.dart +0 -0
- /package/dart-src/{plugins/supabase/lib → root/lib/src/pkg/supabase}/src/types.dart +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import 'dart:convert';
|
|
2
|
-
import 'dart:io';
|
|
3
|
-
|
|
4
|
-
import 'package:flutter_ota_kit_core/flutter_ota_kit_core.dart';
|
|
5
|
-
import 'package:test/test.dart';
|
|
6
|
-
|
|
7
|
-
/// Ground truth generated by executing the REAL verkit package
|
|
8
|
-
/// (hot-updater's semver dependency) under node.
|
|
9
|
-
/// Regenerate: see scripts/verify_semver.mjs.
|
|
10
|
-
void main() {
|
|
11
|
-
final raw = File('test/semver_vectors.json').readAsStringSync();
|
|
12
|
-
final vectors = jsonDecode(raw) as Map<String, dynamic>;
|
|
13
|
-
|
|
14
|
-
group('semverCoerce (verkit ground truth)', () {
|
|
15
|
-
vectors['coerce']!.forEach((input, expected) {
|
|
16
|
-
test('coerce($input) → $expected', () {
|
|
17
|
-
final got = semverCoerce(input);
|
|
18
|
-
expect(got?.toString(), expected);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
group('satisfies (verkit ground truth)', () {
|
|
24
|
-
for (final entry in (vectors['sat'] as List)) {
|
|
25
|
-
final range = entry[0] as String;
|
|
26
|
-
final version = entry[1] as String;
|
|
27
|
-
final expected = entry[2];
|
|
28
|
-
test('$version in "$range" → $expected', () {
|
|
29
|
-
final parsed = SemVer.tryParse(version)!;
|
|
30
|
-
if (expected == 'ERR') {
|
|
31
|
-
// verkit threw on invalid input; we treat as non-match.
|
|
32
|
-
expect(satisfies(parsed, range), isFalse);
|
|
33
|
-
} else {
|
|
34
|
-
expect(
|
|
35
|
-
satisfies(parsed, range),
|
|
36
|
-
expected,
|
|
37
|
-
reason: '$version vs range "$range"',
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
group('semverSatisfies facade', () {
|
|
45
|
-
test('mirrors hot-updater call order (coerce then satisfies)', () {
|
|
46
|
-
expect(semverSatisfies('^1.2.0', 'v1.3.0'), isTrue);
|
|
47
|
-
// coerce("1") -> 1.0.0 which does NOT match ^1.2.0 (verkit-verified).
|
|
48
|
-
expect(semverSatisfies('^1.2.0', '1'), isFalse);
|
|
49
|
-
// ...but ^1.0.0 matches coerced 1.0.0.
|
|
50
|
-
expect(semverSatisfies('^1.0.0', '1'), isTrue);
|
|
51
|
-
expect(semverSatisfies('^1.2.0', 'junk'), isFalse);
|
|
52
|
-
expect(semverSatisfies('~2.3.4', 'app version 2.3.6!'), isTrue);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"coerce":{"0":"0.0.0","1":"1.0.0","12":"12.0.0","1.2.3":"1.2.3","v1.2.3":"1.2.3","=1.2.3":"1.2.3",">1.2.3":"1.2.3","1.2":"1.2.0","10.20.30":"10.20.30","1.2.3-beta.1":"1.2.3","1.2.3+build.5":"1.2.3","1.2.3-beta.1+build":"1.2.3"," v 1.2.3 ":"1.2.3","version 2.3.4":"2.3.4","x1.2.3":"1.2.3","1.2.3.4":"1.2.3","1..3":"1.0.0","abc":null,"1a2b3c":"1.0.0","1.2.x":"1.2.0","1.x.x":"1.0.0","*":null,"":null,"1.2.3-rc.2+meta":"1.2.3","99999999999999999999.1.1":"1.1.0","1.2.3 - 2.3.4":"1.2.3","~1.2.3":"1.2.3","^1.2.3":"1.2.3","1.2.3 || 2.0.0":"1.2.3"},"sat":[["1.2.3","0.0.0",false],["1.2.3","0.0.3",false],["1.2.3","0.2.0",false],["1.2.3","0.2.3",false],["1.2.3","1.0.0",false],["1.2.3","1.2.2",false],["1.2.3","1.2.3",true],["1.2.3","1.2.4",false],["1.2.3","1.2.9",false],["1.2.3","1.3.0",false],["1.2.3","1.5.2",false],["1.2.3","2.0.0",false],["1.2.3","2.3.4",false],["1.2.3","3.0.0",false],["1.2.3","1.2.3-alpha",false],["1.2.3","1.2.3-alpha.2",false],["1.2.3","1.2.3-beta.4",false],["1.2.3","2.0.0-rc.1",false],["1.2.3","1.2.3+build",true],["1.2.3","0.2.4",false],["=1.2.3","0.0.0",false],["=1.2.3","0.0.3",false],["=1.2.3","0.2.0",false],["=1.2.3","0.2.3",false],["=1.2.3","1.0.0",false],["=1.2.3","1.2.2",false],["=1.2.3","1.2.3",true],["=1.2.3","1.2.4",false],["=1.2.3","1.2.9",false],["=1.2.3","1.3.0",false],["=1.2.3","1.5.2",false],["=1.2.3","2.0.0",false],["=1.2.3","2.3.4",false],["=1.2.3","3.0.0",false],["=1.2.3","1.2.3-alpha",false],["=1.2.3","1.2.3-alpha.2",false],["=1.2.3","1.2.3-beta.4",false],["=1.2.3","2.0.0-rc.1",false],["=1.2.3","1.2.3+build",true],["=1.2.3","0.2.4",false],[">1.2.3","0.0.0",false],[">1.2.3","0.0.3",false],[">1.2.3","0.2.0",false],[">1.2.3","0.2.3",false],[">1.2.3","1.0.0",false],[">1.2.3","1.2.2",false],[">1.2.3","1.2.3",false],[">1.2.3","1.2.4",true],[">1.2.3","1.2.9",true],[">1.2.3","1.3.0",true],[">1.2.3","1.5.2",true],[">1.2.3","2.0.0",true],[">1.2.3","2.3.4",true],[">1.2.3","3.0.0",true],[">1.2.3","1.2.3-alpha",false],[">1.2.3","1.2.3-alpha.2",false],[">1.2.3","1.2.3-beta.4",false],[">1.2.3","2.0.0-rc.1",false],[">1.2.3","1.2.3+build",false],[">1.2.3","0.2.4",false],["<1.2.3","0.0.0",true],["<1.2.3","0.0.3",true],["<1.2.3","0.2.0",true],["<1.2.3","0.2.3",true],["<1.2.3","1.0.0",true],["<1.2.3","1.2.2",true],["<1.2.3","1.2.3",false],["<1.2.3","1.2.4",false],["<1.2.3","1.2.9",false],["<1.2.3","1.3.0",false],["<1.2.3","1.5.2",false],["<1.2.3","2.0.0",false],["<1.2.3","2.3.4",false],["<1.2.3","3.0.0",false],["<1.2.3","1.2.3-alpha",false],["<1.2.3","1.2.3-alpha.2",false],["<1.2.3","1.2.3-beta.4",false],["<1.2.3","2.0.0-rc.1",false],["<1.2.3","1.2.3+build",false],["<1.2.3","0.2.4",true],[">=1.2.3","0.0.0",false],[">=1.2.3","0.0.3",false],[">=1.2.3","0.2.0",false],[">=1.2.3","0.2.3",false],[">=1.2.3","1.0.0",false],[">=1.2.3","1.2.2",false],[">=1.2.3","1.2.3",true],[">=1.2.3","1.2.4",true],[">=1.2.3","1.2.9",true],[">=1.2.3","1.3.0",true],[">=1.2.3","1.5.2",true],[">=1.2.3","2.0.0",true],[">=1.2.3","2.3.4",true],[">=1.2.3","3.0.0",true],[">=1.2.3","1.2.3-alpha",false],[">=1.2.3","1.2.3-alpha.2",false],[">=1.2.3","1.2.3-beta.4",false],[">=1.2.3","2.0.0-rc.1",false],[">=1.2.3","1.2.3+build",true],[">=1.2.3","0.2.4",false],["<=1.2.3","0.0.0",true],["<=1.2.3","0.0.3",true],["<=1.2.3","0.2.0",true],["<=1.2.3","0.2.3",true],["<=1.2.3","1.0.0",true],["<=1.2.3","1.2.2",true],["<=1.2.3","1.2.3",true],["<=1.2.3","1.2.4",false],["<=1.2.3","1.2.9",false],["<=1.2.3","1.3.0",false],["<=1.2.3","1.5.2",false],["<=1.2.3","2.0.0",false],["<=1.2.3","2.3.4",false],["<=1.2.3","3.0.0",false],["<=1.2.3","1.2.3-alpha",false],["<=1.2.3","1.2.3-alpha.2",false],["<=1.2.3","1.2.3-beta.4",false],["<=1.2.3","2.0.0-rc.1",false],["<=1.2.3","1.2.3+build",true],["<=1.2.3","0.2.4",true],["1.2.x","0.0.0",false],["1.2.x","0.0.3",false],["1.2.x","0.2.0",false],["1.2.x","0.2.3",false],["1.2.x","1.0.0",false],["1.2.x","1.2.2",true],["1.2.x","1.2.3",true],["1.2.x","1.2.4",true],["1.2.x","1.2.9",true],["1.2.x","1.3.0",false],["1.2.x","1.5.2",false],["1.2.x","2.0.0",false],["1.2.x","2.3.4",false],["1.2.x","3.0.0",false],["1.2.x","1.2.3-alpha",false],["1.2.x","1.2.3-alpha.2",false],["1.2.x","1.2.3-beta.4",false],["1.2.x","2.0.0-rc.1",false],["1.2.x","1.2.3+build",true],["1.2.x","0.2.4",false],["1.X","0.0.0",false],["1.X","0.0.3",false],["1.X","0.2.0",false],["1.X","0.2.3",false],["1.X","1.0.0",true],["1.X","1.2.2",true],["1.X","1.2.3",true],["1.X","1.2.4",true],["1.X","1.2.9",true],["1.X","1.3.0",true],["1.X","1.5.2",true],["1.X","2.0.0",false],["1.X","2.3.4",false],["1.X","3.0.0",false],["1.X","1.2.3-alpha",false],["1.X","1.2.3-alpha.2",false],["1.X","1.2.3-beta.4",false],["1.X","2.0.0-rc.1",false],["1.X","1.2.3+build",true],["1.X","0.2.4",false],["1.*","0.0.0",false],["1.*","0.0.3",false],["1.*","0.2.0",false],["1.*","0.2.3",false],["1.*","1.0.0",true],["1.*","1.2.2",true],["1.*","1.2.3",true],["1.*","1.2.4",true],["1.*","1.2.9",true],["1.*","1.3.0",true],["1.*","1.5.2",true],["1.*","2.0.0",false],["1.*","2.3.4",false],["1.*","3.0.0",false],["1.*","1.2.3-alpha",false],["1.*","1.2.3-alpha.2",false],["1.*","1.2.3-beta.4",false],["1.*","2.0.0-rc.1",false],["1.*","1.2.3+build",true],["1.*","0.2.4",false],["*","0.0.0",true],["*","0.0.3",true],["*","0.2.0",true],["*","0.2.3",true],["*","1.0.0",true],["*","1.2.2",true],["*","1.2.3",true],["*","1.2.4",true],["*","1.2.9",true],["*","1.3.0",true],["*","1.5.2",true],["*","2.0.0",true],["*","2.3.4",true],["*","3.0.0",true],["*","1.2.3-alpha",false],["*","1.2.3-alpha.2",false],["*","1.2.3-beta.4",false],["*","2.0.0-rc.1",false],["*","1.2.3+build",true],["*","0.2.4",true],["1.x","0.0.0",false],["1.x","0.0.3",false],["1.x","0.2.0",false],["1.x","0.2.3",false],["1.x","1.0.0",true],["1.x","1.2.2",true],["1.x","1.2.3",true],["1.x","1.2.4",true],["1.x","1.2.9",true],["1.x","1.3.0",true],["1.x","1.5.2",true],["1.x","2.0.0",false],["1.x","2.3.4",false],["1.x","3.0.0",false],["1.x","1.2.3-alpha",false],["1.x","1.2.3-alpha.2",false],["1.x","1.2.3-beta.4",false],["1.x","2.0.0-rc.1",false],["1.x","1.2.3+build",true],["1.x","0.2.4",false],["1.2","0.0.0",false],["1.2","0.0.3",false],["1.2","0.2.0",false],["1.2","0.2.3",false],["1.2","1.0.0",false],["1.2","1.2.2",true],["1.2","1.2.3",true],["1.2","1.2.4",true],["1.2","1.2.9",true],["1.2","1.3.0",false],["1.2","1.5.2",false],["1.2","2.0.0",false],["1.2","2.3.4",false],["1.2","3.0.0",false],["1.2","1.2.3-alpha",false],["1.2","1.2.3-alpha.2",false],["1.2","1.2.3-beta.4",false],["1.2","2.0.0-rc.1",false],["1.2","1.2.3+build",true],["1.2","0.2.4",false],["1","0.0.0",false],["1","0.0.3",false],["1","0.2.0",false],["1","0.2.3",false],["1","1.0.0",true],["1","1.2.2",true],["1","1.2.3",true],["1","1.2.4",true],["1","1.2.9",true],["1","1.3.0",true],["1","1.5.2",true],["1","2.0.0",false],["1","2.3.4",false],["1","3.0.0",false],["1","1.2.3-alpha",false],["1","1.2.3-alpha.2",false],["1","1.2.3-beta.4",false],["1","2.0.0-rc.1",false],["1","1.2.3+build",true],["1","0.2.4",false],["~1.2.3","0.0.0",false],["~1.2.3","0.0.3",false],["~1.2.3","0.2.0",false],["~1.2.3","0.2.3",false],["~1.2.3","1.0.0",false],["~1.2.3","1.2.2",false],["~1.2.3","1.2.3",true],["~1.2.3","1.2.4",true],["~1.2.3","1.2.9",true],["~1.2.3","1.3.0",false],["~1.2.3","1.5.2",false],["~1.2.3","2.0.0",false],["~1.2.3","2.3.4",false],["~1.2.3","3.0.0",false],["~1.2.3","1.2.3-alpha",false],["~1.2.3","1.2.3-alpha.2",false],["~1.2.3","1.2.3-beta.4",false],["~1.2.3","2.0.0-rc.1",false],["~1.2.3","1.2.3+build",true],["~1.2.3","0.2.4",false],["~1.2","0.0.0",false],["~1.2","0.0.3",false],["~1.2","0.2.0",false],["~1.2","0.2.3",false],["~1.2","1.0.0",false],["~1.2","1.2.2",true],["~1.2","1.2.3",true],["~1.2","1.2.4",true],["~1.2","1.2.9",true],["~1.2","1.3.0",false],["~1.2","1.5.2",false],["~1.2","2.0.0",false],["~1.2","2.3.4",false],["~1.2","3.0.0",false],["~1.2","1.2.3-alpha",false],["~1.2","1.2.3-alpha.2",false],["~1.2","1.2.3-beta.4",false],["~1.2","2.0.0-rc.1",false],["~1.2","1.2.3+build",true],["~1.2","0.2.4",false],["~1","0.0.0",false],["~1","0.0.3",false],["~1","0.2.0",false],["~1","0.2.3",false],["~1","1.0.0",true],["~1","1.2.2",true],["~1","1.2.3",true],["~1","1.2.4",true],["~1","1.2.9",true],["~1","1.3.0",true],["~1","1.5.2",true],["~1","2.0.0",false],["~1","2.3.4",false],["~1","3.0.0",false],["~1","1.2.3-alpha",false],["~1","1.2.3-alpha.2",false],["~1","1.2.3-beta.4",false],["~1","2.0.0-rc.1",false],["~1","1.2.3+build",true],["~1","0.2.4",false],["~0.2.3","0.0.0",false],["~0.2.3","0.0.3",false],["~0.2.3","0.2.0",false],["~0.2.3","0.2.3",true],["~0.2.3","1.0.0",false],["~0.2.3","1.2.2",false],["~0.2.3","1.2.3",false],["~0.2.3","1.2.4",false],["~0.2.3","1.2.9",false],["~0.2.3","1.3.0",false],["~0.2.3","1.5.2",false],["~0.2.3","2.0.0",false],["~0.2.3","2.3.4",false],["~0.2.3","3.0.0",false],["~0.2.3","1.2.3-alpha",false],["~0.2.3","1.2.3-alpha.2",false],["~0.2.3","1.2.3-beta.4",false],["~0.2.3","2.0.0-rc.1",false],["~0.2.3","1.2.3+build",false],["~0.2.3","0.2.4",true],["~1.2.3-beta.2","0.0.0",false],["~1.2.3-beta.2","0.0.3",false],["~1.2.3-beta.2","0.2.0",false],["~1.2.3-beta.2","0.2.3",false],["~1.2.3-beta.2","1.0.0",false],["~1.2.3-beta.2","1.2.2",false],["~1.2.3-beta.2","1.2.3",true],["~1.2.3-beta.2","1.2.4",true],["~1.2.3-beta.2","1.2.9",true],["~1.2.3-beta.2","1.3.0",false],["~1.2.3-beta.2","1.5.2",false],["~1.2.3-beta.2","2.0.0",false],["~1.2.3-beta.2","2.3.4",false],["~1.2.3-beta.2","3.0.0",false],["~1.2.3-beta.2","1.2.3-alpha",false],["~1.2.3-beta.2","1.2.3-alpha.2",false],["~1.2.3-beta.2","1.2.3-beta.4",true],["~1.2.3-beta.2","2.0.0-rc.1",false],["~1.2.3-beta.2","1.2.3+build",true],["~1.2.3-beta.2","0.2.4",false],["^1.2.3","0.0.0",false],["^1.2.3","0.0.3",false],["^1.2.3","0.2.0",false],["^1.2.3","0.2.3",false],["^1.2.3","1.0.0",false],["^1.2.3","1.2.2",false],["^1.2.3","1.2.3",true],["^1.2.3","1.2.4",true],["^1.2.3","1.2.9",true],["^1.2.3","1.3.0",true],["^1.2.3","1.5.2",true],["^1.2.3","2.0.0",false],["^1.2.3","2.3.4",false],["^1.2.3","3.0.0",false],["^1.2.3","1.2.3-alpha",false],["^1.2.3","1.2.3-alpha.2",false],["^1.2.3","1.2.3-beta.4",false],["^1.2.3","2.0.0-rc.1",false],["^1.2.3","1.2.3+build",true],["^1.2.3","0.2.4",false],["^0.2.3","0.0.0",false],["^0.2.3","0.0.3",false],["^0.2.3","0.2.0",false],["^0.2.3","0.2.3",true],["^0.2.3","1.0.0",false],["^0.2.3","1.2.2",false],["^0.2.3","1.2.3",false],["^0.2.3","1.2.4",false],["^0.2.3","1.2.9",false],["^0.2.3","1.3.0",false],["^0.2.3","1.5.2",false],["^0.2.3","2.0.0",false],["^0.2.3","2.3.4",false],["^0.2.3","3.0.0",false],["^0.2.3","1.2.3-alpha",false],["^0.2.3","1.2.3-alpha.2",false],["^0.2.3","1.2.3-beta.4",false],["^0.2.3","2.0.0-rc.1",false],["^0.2.3","1.2.3+build",false],["^0.2.3","0.2.4",true],["^0.0.3","0.0.0",false],["^0.0.3","0.0.3",true],["^0.0.3","0.2.0",false],["^0.0.3","0.2.3",false],["^0.0.3","1.0.0",false],["^0.0.3","1.2.2",false],["^0.0.3","1.2.3",false],["^0.0.3","1.2.4",false],["^0.0.3","1.2.9",false],["^0.0.3","1.3.0",false],["^0.0.3","1.5.2",false],["^0.0.3","2.0.0",false],["^0.0.3","2.3.4",false],["^0.0.3","3.0.0",false],["^0.0.3","1.2.3-alpha",false],["^0.0.3","1.2.3-alpha.2",false],["^0.0.3","1.2.3-beta.4",false],["^0.0.3","2.0.0-rc.1",false],["^0.0.3","1.2.3+build",false],["^0.0.3","0.2.4",false],["^1.x","0.0.0",false],["^1.x","0.0.3",false],["^1.x","0.2.0",false],["^1.x","0.2.3",false],["^1.x","1.0.0",true],["^1.x","1.2.2",true],["^1.x","1.2.3",true],["^1.x","1.2.4",true],["^1.x","1.2.9",true],["^1.x","1.3.0",true],["^1.x","1.5.2",true],["^1.x","2.0.0",false],["^1.x","2.3.4",false],["^1.x","3.0.0",false],["^1.x","1.2.3-alpha",false],["^1.x","1.2.3-alpha.2",false],["^1.x","1.2.3-beta.4",false],["^1.x","2.0.0-rc.1",false],["^1.x","1.2.3+build",true],["^1.x","0.2.4",false],["^0.0.x","0.0.0",true],["^0.0.x","0.0.3",true],["^0.0.x","0.2.0",false],["^0.0.x","0.2.3",false],["^0.0.x","1.0.0",false],["^0.0.x","1.2.2",false],["^0.0.x","1.2.3",false],["^0.0.x","1.2.4",false],["^0.0.x","1.2.9",false],["^0.0.x","1.3.0",false],["^0.0.x","1.5.2",false],["^0.0.x","2.0.0",false],["^0.0.x","2.3.4",false],["^0.0.x","3.0.0",false],["^0.0.x","1.2.3-alpha",false],["^0.0.x","1.2.3-alpha.2",false],["^0.0.x","1.2.3-beta.4",false],["^0.0.x","2.0.0-rc.1",false],["^0.0.x","1.2.3+build",false],["^0.0.x","0.2.4",false],["^0.0.0","0.0.0",true],["^0.0.0","0.0.3",false],["^0.0.0","0.2.0",false],["^0.0.0","0.2.3",false],["^0.0.0","1.0.0",false],["^0.0.0","1.2.2",false],["^0.0.0","1.2.3",false],["^0.0.0","1.2.4",false],["^0.0.0","1.2.9",false],["^0.0.0","1.3.0",false],["^0.0.0","1.5.2",false],["^0.0.0","2.0.0",false],["^0.0.0","2.3.4",false],["^0.0.0","3.0.0",false],["^0.0.0","1.2.3-alpha",false],["^0.0.0","1.2.3-alpha.2",false],["^0.0.0","1.2.3-beta.4",false],["^0.0.0","2.0.0-rc.1",false],["^0.0.0","1.2.3+build",false],["^0.0.0","0.2.4",false],["^1.2.3-beta.2","0.0.0",false],["^1.2.3-beta.2","0.0.3",false],["^1.2.3-beta.2","0.2.0",false],["^1.2.3-beta.2","0.2.3",false],["^1.2.3-beta.2","1.0.0",false],["^1.2.3-beta.2","1.2.2",false],["^1.2.3-beta.2","1.2.3",true],["^1.2.3-beta.2","1.2.4",true],["^1.2.3-beta.2","1.2.9",true],["^1.2.3-beta.2","1.3.0",true],["^1.2.3-beta.2","1.5.2",true],["^1.2.3-beta.2","2.0.0",false],["^1.2.3-beta.2","2.3.4",false],["^1.2.3-beta.2","3.0.0",false],["^1.2.3-beta.2","1.2.3-alpha",false],["^1.2.3-beta.2","1.2.3-alpha.2",false],["^1.2.3-beta.2","1.2.3-beta.4",true],["^1.2.3-beta.2","2.0.0-rc.1",false],["^1.2.3-beta.2","1.2.3+build",true],["^1.2.3-beta.2","0.2.4",false],[">1.2","0.0.0",false],[">1.2","0.0.3",false],[">1.2","0.2.0",false],[">1.2","0.2.3",false],[">1.2","1.0.0",false],[">1.2","1.2.2",false],[">1.2","1.2.3",false],[">1.2","1.2.4",false],[">1.2","1.2.9",false],[">1.2","1.3.0",true],[">1.2","1.5.2",true],[">1.2","2.0.0",true],[">1.2","2.3.4",true],[">1.2","3.0.0",true],[">1.2","1.2.3-alpha",false],[">1.2","1.2.3-alpha.2",false],[">1.2","1.2.3-beta.4",false],[">1.2","2.0.0-rc.1",false],[">1.2","1.2.3+build",false],[">1.2","0.2.4",false],["<1.2.9 >=1.2.3","0.0.0",false],["<1.2.9 >=1.2.3","0.0.3",false],["<1.2.9 >=1.2.3","0.2.0",false],["<1.2.9 >=1.2.3","0.2.3",false],["<1.2.9 >=1.2.3","1.0.0",false],["<1.2.9 >=1.2.3","1.2.2",false],["<1.2.9 >=1.2.3","1.2.3",true],["<1.2.9 >=1.2.3","1.2.4",true],["<1.2.9 >=1.2.3","1.2.9",false],["<1.2.9 >=1.2.3","1.3.0",false],["<1.2.9 >=1.2.3","1.5.2",false],["<1.2.9 >=1.2.3","2.0.0",false],["<1.2.9 >=1.2.3","2.3.4",false],["<1.2.9 >=1.2.3","3.0.0",false],["<1.2.9 >=1.2.3","1.2.3-alpha",false],["<1.2.9 >=1.2.3","1.2.3-alpha.2",false],["<1.2.9 >=1.2.3","1.2.3-beta.4",false],["<1.2.9 >=1.2.3","2.0.0-rc.1",false],["<1.2.9 >=1.2.3","1.2.3+build",true],["<1.2.9 >=1.2.3","0.2.4",false],[">=0.0.0","0.0.0",true],[">=0.0.0","0.0.3",true],[">=0.0.0","0.2.0",true],[">=0.0.0","0.2.3",true],[">=0.0.0","1.0.0",true],[">=0.0.0","1.2.2",true],[">=0.0.0","1.2.3",true],[">=0.0.0","1.2.4",true],[">=0.0.0","1.2.9",true],[">=0.0.0","1.3.0",true],[">=0.0.0","1.5.2",true],[">=0.0.0","2.0.0",true],[">=0.0.0","2.3.4",true],[">=0.0.0","3.0.0",true],[">=0.0.0","1.2.3-alpha",false],[">=0.0.0","1.2.3-alpha.2",false],[">=0.0.0","1.2.3-beta.4",false],[">=0.0.0","2.0.0-rc.1",false],[">=0.0.0","1.2.3+build",true],[">=0.0.0","0.2.4",true],["<=2.0","0.0.0",true],["<=2.0","0.0.3",true],["<=2.0","0.2.0",true],["<=2.0","0.2.3",true],["<=2.0","1.0.0",true],["<=2.0","1.2.2",true],["<=2.0","1.2.3",true],["<=2.0","1.2.4",true],["<=2.0","1.2.9",true],["<=2.0","1.3.0",true],["<=2.0","1.5.2",true],["<=2.0","2.0.0",true],["<=2.0","2.3.4",false],["<=2.0","3.0.0",false],["<=2.0","1.2.3-alpha",false],["<=2.0","1.2.3-alpha.2",false],["<=2.0","1.2.3-beta.4",false],["<=2.0","2.0.0-rc.1",false],["<=2.0","1.2.3+build",true],["<=2.0","0.2.4",true],["1.2.3 - 2.3.4","0.0.0",false],["1.2.3 - 2.3.4","0.0.3",false],["1.2.3 - 2.3.4","0.2.0",false],["1.2.3 - 2.3.4","0.2.3",false],["1.2.3 - 2.3.4","1.0.0",false],["1.2.3 - 2.3.4","1.2.2",false],["1.2.3 - 2.3.4","1.2.3",true],["1.2.3 - 2.3.4","1.2.4",true],["1.2.3 - 2.3.4","1.2.9",true],["1.2.3 - 2.3.4","1.3.0",true],["1.2.3 - 2.3.4","1.5.2",true],["1.2.3 - 2.3.4","2.0.0",true],["1.2.3 - 2.3.4","2.3.4",true],["1.2.3 - 2.3.4","3.0.0",false],["1.2.3 - 2.3.4","1.2.3-alpha",false],["1.2.3 - 2.3.4","1.2.3-alpha.2",false],["1.2.3 - 2.3.4","1.2.3-beta.4",false],["1.2.3 - 2.3.4","2.0.0-rc.1",false],["1.2.3 - 2.3.4","1.2.3+build",true],["1.2.3 - 2.3.4","0.2.4",false],["1.2 - 2.3.4","0.0.0",false],["1.2 - 2.3.4","0.0.3",false],["1.2 - 2.3.4","0.2.0",false],["1.2 - 2.3.4","0.2.3",false],["1.2 - 2.3.4","1.0.0",false],["1.2 - 2.3.4","1.2.2",true],["1.2 - 2.3.4","1.2.3",true],["1.2 - 2.3.4","1.2.4",true],["1.2 - 2.3.4","1.2.9",true],["1.2 - 2.3.4","1.3.0",true],["1.2 - 2.3.4","1.5.2",true],["1.2 - 2.3.4","2.0.0",true],["1.2 - 2.3.4","2.3.4",true],["1.2 - 2.3.4","3.0.0",false],["1.2 - 2.3.4","1.2.3-alpha",false],["1.2 - 2.3.4","1.2.3-alpha.2",false],["1.2 - 2.3.4","1.2.3-beta.4",false],["1.2 - 2.3.4","2.0.0-rc.1",false],["1.2 - 2.3.4","1.2.3+build",true],["1.2 - 2.3.4","0.2.4",false],["1.2.3 - 2.3","0.0.0",false],["1.2.3 - 2.3","0.0.3",false],["1.2.3 - 2.3","0.2.0",false],["1.2.3 - 2.3","0.2.3",false],["1.2.3 - 2.3","1.0.0",false],["1.2.3 - 2.3","1.2.2",false],["1.2.3 - 2.3","1.2.3",true],["1.2.3 - 2.3","1.2.4",true],["1.2.3 - 2.3","1.2.9",true],["1.2.3 - 2.3","1.3.0",true],["1.2.3 - 2.3","1.5.2",true],["1.2.3 - 2.3","2.0.0",true],["1.2.3 - 2.3","2.3.4",true],["1.2.3 - 2.3","3.0.0",false],["1.2.3 - 2.3","1.2.3-alpha",false],["1.2.3 - 2.3","1.2.3-alpha.2",false],["1.2.3 - 2.3","1.2.3-beta.4",false],["1.2.3 - 2.3","2.0.0-rc.1",false],["1.2.3 - 2.3","1.2.3+build",true],["1.2.3 - 2.3","0.2.4",false],["1.2.3-beta - 2","0.0.0",false],["1.2.3-beta - 2","0.0.3",false],["1.2.3-beta - 2","0.2.0",false],["1.2.3-beta - 2","0.2.3",false],["1.2.3-beta - 2","1.0.0",false],["1.2.3-beta - 2","1.2.2",false],["1.2.3-beta - 2","1.2.3",true],["1.2.3-beta - 2","1.2.4",true],["1.2.3-beta - 2","1.2.9",true],["1.2.3-beta - 2","1.3.0",true],["1.2.3-beta - 2","1.5.2",true],["1.2.3-beta - 2","2.0.0",true],["1.2.3-beta - 2","2.3.4",true],["1.2.3-beta - 2","3.0.0",false],["1.2.3-beta - 2","1.2.3-alpha",false],["1.2.3-beta - 2","1.2.3-alpha.2",false],["1.2.3-beta - 2","1.2.3-beta.4",true],["1.2.3-beta - 2","2.0.0-rc.1",false],["1.2.3-beta - 2","1.2.3+build",true],["1.2.3-beta - 2","0.2.4",false],["1.2.7 || >=1.2.9 <2.0.0","0.0.0",false],["1.2.7 || >=1.2.9 <2.0.0","0.0.3",false],["1.2.7 || >=1.2.9 <2.0.0","0.2.0",false],["1.2.7 || >=1.2.9 <2.0.0","0.2.3",false],["1.2.7 || >=1.2.9 <2.0.0","1.0.0",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.2",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.3",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.4",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.9",true],["1.2.7 || >=1.2.9 <2.0.0","1.3.0",true],["1.2.7 || >=1.2.9 <2.0.0","1.5.2",true],["1.2.7 || >=1.2.9 <2.0.0","2.0.0",false],["1.2.7 || >=1.2.9 <2.0.0","2.3.4",false],["1.2.7 || >=1.2.9 <2.0.0","3.0.0",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.3-alpha",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.3-alpha.2",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.3-beta.4",false],["1.2.7 || >=1.2.9 <2.0.0","2.0.0-rc.1",false],["1.2.7 || >=1.2.9 <2.0.0","1.2.3+build",false],["1.2.7 || >=1.2.9 <2.0.0","0.2.4",false],["^1.2.3 ^0.2.3","0.0.0",false],["^1.2.3 ^0.2.3","0.0.3",false],["^1.2.3 ^0.2.3","0.2.0",false],["^1.2.3 ^0.2.3","0.2.3",false],["^1.2.3 ^0.2.3","1.0.0",false],["^1.2.3 ^0.2.3","1.2.2",false],["^1.2.3 ^0.2.3","1.2.3",false],["^1.2.3 ^0.2.3","1.2.4",false],["^1.2.3 ^0.2.3","1.2.9",false],["^1.2.3 ^0.2.3","1.3.0",false],["^1.2.3 ^0.2.3","1.5.2",false],["^1.2.3 ^0.2.3","2.0.0",false],["^1.2.3 ^0.2.3","2.3.4",false],["^1.2.3 ^0.2.3","3.0.0",false],["^1.2.3 ^0.2.3","1.2.3-alpha",false],["^1.2.3 ^0.2.3","1.2.3-alpha.2",false],["^1.2.3 ^0.2.3","1.2.3-beta.4",false],["^1.2.3 ^0.2.3","2.0.0-rc.1",false],["^1.2.3 ^0.2.3","1.2.3+build",false],["^1.2.3 ^0.2.3","0.2.4",false],["1.2.3 2.0.0","0.0.0",false],["1.2.3 2.0.0","0.0.3",false],["1.2.3 2.0.0","0.2.0",false],["1.2.3 2.0.0","0.2.3",false],["1.2.3 2.0.0","1.0.0",false],["1.2.3 2.0.0","1.2.2",false],["1.2.3 2.0.0","1.2.3",false],["1.2.3 2.0.0","1.2.4",false],["1.2.3 2.0.0","1.2.9",false],["1.2.3 2.0.0","1.3.0",false],["1.2.3 2.0.0","1.5.2",false],["1.2.3 2.0.0","2.0.0",false],["1.2.3 2.0.0","2.3.4",false],["1.2.3 2.0.0","3.0.0",false],["1.2.3 2.0.0","1.2.3-alpha",false],["1.2.3 2.0.0","1.2.3-alpha.2",false],["1.2.3 2.0.0","1.2.3-beta.4",false],["1.2.3 2.0.0","2.0.0-rc.1",false],["1.2.3 2.0.0","1.2.3+build",false],["1.2.3 2.0.0","0.2.4",false],[">=1.0.0-0 <2.0.0","0.0.0",false],[">=1.0.0-0 <2.0.0","0.0.3",false],[">=1.0.0-0 <2.0.0","0.2.0",false],[">=1.0.0-0 <2.0.0","0.2.3",false],[">=1.0.0-0 <2.0.0","1.0.0",true],[">=1.0.0-0 <2.0.0","1.2.2",true],[">=1.0.0-0 <2.0.0","1.2.3",true],[">=1.0.0-0 <2.0.0","1.2.4",true],[">=1.0.0-0 <2.0.0","1.2.9",true],[">=1.0.0-0 <2.0.0","1.3.0",true],[">=1.0.0-0 <2.0.0","1.5.2",true],[">=1.0.0-0 <2.0.0","2.0.0",false],[">=1.0.0-0 <2.0.0","2.3.4",false],[">=1.0.0-0 <2.0.0","3.0.0",false],[">=1.0.0-0 <2.0.0","1.2.3-alpha",false],[">=1.0.0-0 <2.0.0","1.2.3-alpha.2",false],[">=1.0.0-0 <2.0.0","1.2.3-beta.4",false],[">=1.0.0-0 <2.0.0","2.0.0-rc.1",false],[">=1.0.0-0 <2.0.0","1.2.3+build",true],[">=1.0.0-0 <2.0.0","0.2.4",false],["1.5.x || >2.a","0.0.0",false],["1.5.x || >2.a","0.0.3",false],["1.5.x || >2.a","0.2.0",false],["1.5.x || >2.a","0.2.3",false],["1.5.x || >2.a","1.0.0",false],["1.5.x || >2.a","1.2.2",false],["1.5.x || >2.a","1.2.3",false],["1.5.x || >2.a","1.2.4",false],["1.5.x || >2.a","1.2.9",false],["1.5.x || >2.a","1.3.0",false],["1.5.x || >2.a","1.5.2",false],["1.5.x || >2.a","2.0.0",false],["1.5.x || >2.a","2.3.4",false],["1.5.x || >2.a","3.0.0",false],["1.5.x || >2.a","1.2.3-alpha",false],["1.5.x || >2.a","1.2.3-alpha.2",false],["1.5.x || >2.a","1.2.3-beta.4",false],["1.5.x || >2.a","2.0.0-rc.1",false],["1.5.x || >2.a","1.2.3+build",false],["1.5.x || >2.a","0.2.4",false]]}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import 'package:flutter_ota_kit_core/flutter_ota_kit_core.dart';
|
|
2
|
-
import 'package:test/test.dart';
|
|
3
|
-
|
|
4
|
-
Bundle _sample() => Bundle(
|
|
5
|
-
id: '019b76da-a800-7cc2-b5a5-c8f4a1e9d001',
|
|
6
|
-
platform: Platform.android,
|
|
7
|
-
shouldForceUpdate: false,
|
|
8
|
-
enabled: true,
|
|
9
|
-
fileHash: 'a' * 64,
|
|
10
|
-
storageUri: 'supabase-storage://flutter-ota-storage/bundles/x/bundle.zip',
|
|
11
|
-
gitCommitHash: 'deadbeef',
|
|
12
|
-
message: 'test bundle',
|
|
13
|
-
channel: 'production',
|
|
14
|
-
targetAppVersion: '^1.2.0',
|
|
15
|
-
metadata: const BundleMetadata(appVersion: '1.2.3'),
|
|
16
|
-
rolloutCohortCount: 137,
|
|
17
|
-
targetCohorts: ['qa-group'],
|
|
18
|
-
patches: [
|
|
19
|
-
BundlePatchArtifact(
|
|
20
|
-
baseBundleId: 'base-id',
|
|
21
|
-
baseFileHash: 'b' * 64,
|
|
22
|
-
patchFileHash: 'c' * 64,
|
|
23
|
-
patchStorageUri: 'supabase-storage://bucket/patches/p.bsdiff',
|
|
24
|
-
),
|
|
25
|
-
],
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
group('Bundle JSON', () {
|
|
30
|
-
test('camelCase roundtrip preserves all fields', () {
|
|
31
|
-
final b = _sample();
|
|
32
|
-
final parsed = Bundle.fromJson(b.toJson());
|
|
33
|
-
expect(parsed.id, b.id);
|
|
34
|
-
expect(parsed.platform, Platform.android);
|
|
35
|
-
expect(parsed.channel, 'production');
|
|
36
|
-
expect(parsed.targetAppVersion, '^1.2.0');
|
|
37
|
-
expect(parsed.metadata?.appVersion, '1.2.3');
|
|
38
|
-
expect(parsed.rolloutCohortCount, 137);
|
|
39
|
-
expect(parsed.targetCohorts, ['qa-group']);
|
|
40
|
-
expect(parsed.patches?.single, b.patches!.single);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test('snake_case DB row parses (PostgREST shape)', () {
|
|
44
|
-
final row = _sample().toSqlJson();
|
|
45
|
-
final parsed = Bundle.fromJson(row.cast<String, dynamic>());
|
|
46
|
-
expect(parsed.id, _sample().id);
|
|
47
|
-
expect(parsed.shouldForceUpdate, isFalse);
|
|
48
|
-
expect(parsed.patches?.single.baseBundleId, 'base-id');
|
|
49
|
-
expect(parsed.rolloutCohortCount, 137);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
test('defaults applied on sparse json', () {
|
|
53
|
-
final parsed = Bundle.fromJson({
|
|
54
|
-
'id': 'x',
|
|
55
|
-
'platform': 'android',
|
|
56
|
-
'file_hash': 'h',
|
|
57
|
-
'storage_uri': 's://u',
|
|
58
|
-
});
|
|
59
|
-
expect(parsed.channel, 'production');
|
|
60
|
-
expect(parsed.enabled, isFalse);
|
|
61
|
-
expect(parsed.shouldForceUpdate, isFalse);
|
|
62
|
-
expect(parsed.message, isNull);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('sql row carries constraint-relevant fields', () {
|
|
66
|
-
final sql = _sample().toSqlJson();
|
|
67
|
-
expect(sql.containsKey('target_app_version'), isTrue);
|
|
68
|
-
expect(sql['metadata'], isA<Map>());
|
|
69
|
-
// XOR constraint mirrors DB CHECK:
|
|
70
|
-
final hasFingerprint = sql['fingerprint_hash'] != null;
|
|
71
|
-
final hasVersion = sql['target_app_version'] != null;
|
|
72
|
-
expect(hasFingerprint || hasVersion, isTrue);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test('equality by wire fields', () {
|
|
76
|
-
expect(_sample(), equals(_sample()));
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
group('AppUpdateInfo union', () {
|
|
81
|
-
test('parses UP_TO_DATE', () {
|
|
82
|
-
final info = AppUpdateInfo.fromJson({'status': 'UP_TO_DATE'});
|
|
83
|
-
expect(info, isA<AppUpToDateInfo>());
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
test('parses UPDATE with changed assets', () {
|
|
87
|
-
final info = AppUpdateInfo.fromJson({
|
|
88
|
-
'id': 'new-id',
|
|
89
|
-
'shouldForceUpdate': true,
|
|
90
|
-
'message': null,
|
|
91
|
-
'status': 'UPDATE',
|
|
92
|
-
'fileUrl': 'https://cdn/b.zip',
|
|
93
|
-
'fileHash': 'd' * 64,
|
|
94
|
-
'changedAssets': {
|
|
95
|
-
'assets/logo.png': {
|
|
96
|
-
'fileHash': 'e' * 64,
|
|
97
|
-
'file': {'url': 'https://cdn/logo.png', 'compression': null},
|
|
98
|
-
'patch': null,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
}) as AppUpdateAvailableInfo;
|
|
102
|
-
expect(info.status, UpdateStatus.update);
|
|
103
|
-
expect(
|
|
104
|
-
info.changedAssets?['assets/logo.png']?.file?.url,
|
|
105
|
-
'https://cdn/logo.png',
|
|
106
|
-
);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test('available info serializes', () {
|
|
110
|
-
const info = AppUpdateAvailableInfo(
|
|
111
|
-
id: 'i',
|
|
112
|
-
shouldForceUpdate: true,
|
|
113
|
-
message: null,
|
|
114
|
-
status: UpdateStatus.rollback,
|
|
115
|
-
fileUrl: null,
|
|
116
|
-
fileHash: null,
|
|
117
|
-
);
|
|
118
|
-
expect(info.toJson()['status'], 'ROLLBACK');
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
group('enums', () {
|
|
123
|
-
test('values match hot-updater strings', () {
|
|
124
|
-
expect(Platform.ios.value, 'ios');
|
|
125
|
-
expect(Platform.android.value, 'android');
|
|
126
|
-
expect(AppUpdateStatus.upToDate.value, 'UP_TO_DATE');
|
|
127
|
-
expect(UpdateStrategy.fingerprint.value, 'fingerprint');
|
|
128
|
-
expect(() => Platform.fromValue('windows'), throwsArgumentError);
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import 'package:flutter_ota_kit_core/flutter_ota_kit_core.dart';
|
|
2
|
-
import 'package:test/test.dart';
|
|
3
|
-
|
|
4
|
-
void main() {
|
|
5
|
-
group('uuidV7', () {
|
|
6
|
-
test('generates RFC-compliant v7 strings', () {
|
|
7
|
-
final id = uuidV7();
|
|
8
|
-
expect(id.length, 36);
|
|
9
|
-
expect(isUuidV7(id), isTrue, reason: id);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('encodes provided timestamp', () {
|
|
13
|
-
final ts = DateTime.utc(2026, 1, 1);
|
|
14
|
-
final id = uuidV7(now: ts);
|
|
15
|
-
final tsHex = ts.millisecondsSinceEpoch
|
|
16
|
-
.toRadixString(16)
|
|
17
|
-
.padLeft(12, '0');
|
|
18
|
-
expect(id.substring(0, 8), tsHex.substring(0, 8));
|
|
19
|
-
expect(id.substring(9, 13), tsHex.substring(8, 12));
|
|
20
|
-
expect(id[14], '7');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('lexicographic order matches chronological order', () {
|
|
24
|
-
final base = DateTime.utc(2026, 5, 5, 12);
|
|
25
|
-
final earlier = uuidV7(now: base);
|
|
26
|
-
final later = uuidV7(now: base.add(const Duration(seconds: 10)));
|
|
27
|
-
expect(compareBundleIds(earlier, later), -1);
|
|
28
|
-
expect(compareBundleIds(later, earlier), 1);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test('uniqueness over bulk generation', () {
|
|
32
|
-
final ids = List.generate(5000, (_) => uuidV7()).toSet();
|
|
33
|
-
expect(ids.length, 5000);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('nilUuid matches hot-updater sentinel', () {
|
|
38
|
-
expect(nilUuid, '00000000-0000-0000-0000-000000000000');
|
|
39
|
-
});
|
|
40
|
-
}
|
|
File without changes
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
## 0.1.10
|
|
2
|
-
|
|
3
|
-
- Release 2026-09-10
|
|
4
|
-
|
|
5
|
-
## 0.1.9
|
|
6
|
-
|
|
7
|
-
- Release 2026-09-10
|
|
8
|
-
|
|
9
|
-
## 0.1.9
|
|
10
|
-
|
|
11
|
-
- Automated release 2026-09-10
|
|
12
|
-
|
|
13
|
-
## 0.1.8
|
|
14
|
-
|
|
15
|
-
- Added comprehensive documentation for all public APIs.
|
|
16
|
-
- Documented S3 client, CloudFront signer, SSM client, and storage profiles.
|
|
17
|
-
- General maintenance.
|
|
18
|
-
|
|
19
|
-
## 0.1.7
|
|
20
|
-
|
|
21
|
-
- General maintenance.
|
|
22
|
-
|
|
23
|
-
## 0.1.6
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 HYPER12755
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# flutter_ota_kit_aws
|
|
2
|
-
|
|
3
|
-
AWS backend for flutter_ota_kit: bundle metadata in an **S3-backed blob
|
|
4
|
-
database** and artifacts in **S3** (with optional CloudFront signed URLs). Used
|
|
5
|
-
by the `flutter-ota` CLI and the Flutter SDK's `FlutterPatcher.configureAws(...)`.
|
|
6
|
-
|
|
7
|
-
## What's inside
|
|
8
|
-
|
|
9
|
-
- `s3Database` / `S3DatabaseConfig` — bundle metadata stored as S3 objects.
|
|
10
|
-
- `s3Storage` / `AwsS3StorageConfig` — artifact storage in S3.
|
|
11
|
-
- CloudFront signed URLs: `cloudfrontSignedUrl`, `verifyCloudfrontSignedUrl`,
|
|
12
|
-
and `withCloudFrontSignedUrl(...)`.
|
|
13
|
-
- `AwsS3ClientLike` / `AwsCloudFrontClientLike` test seams.
|
|
14
|
-
|
|
15
|
-
## Configuration (environment)
|
|
16
|
-
|
|
17
|
-
| Variable | Purpose |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| `AWS_REGION` | S3 region (falls back to `AWS_REGION`/`AWS_DEFAULT_REGION` if unset). |
|
|
20
|
-
| `AWS_BUCKET` | Target bucket name. |
|
|
21
|
-
| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | Credentials. |
|
|
22
|
-
| `AWS_ENDPOINT` | Optional custom endpoint (e.g. MinIO). |
|
|
23
|
-
| `AWS_BASE_PATH` | Optional key prefix. |
|
|
24
|
-
| `AWS_SESSION_TOKEN` | Optional temporary session token. |
|
|
25
|
-
|
|
26
|
-
## License
|
|
27
|
-
|
|
28
|
-
MIT.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// flutter_ota_kit_aws example
|
|
2
|
-
//
|
|
3
|
-
// `flutter_ota_kit_aws` provides AWS S3 storage + S3/DynamoDB database
|
|
4
|
-
// plugins for `flutter_ota_kit`. The typical setup uses S3 for both
|
|
5
|
-
// (storing a `bundles.json` manifest plus patch blobs), with optional
|
|
6
|
-
// CloudFront for signed URLs and faster edge delivery.
|
|
7
|
-
//
|
|
8
|
-
// Most apps don't import this package directly; they wire it through
|
|
9
|
-
// `flutter_ota_kit.configureAws(...)` in their app boot path. This file
|
|
10
|
-
// shows the low-level config types in case you're writing a custom
|
|
11
|
-
// server or a CLI extension.
|
|
12
|
-
//
|
|
13
|
-
// Run: `dart run example/main.dart`
|
|
14
|
-
|
|
15
|
-
import 'package:flutter_ota_kit_aws/flutter_ota_kit_aws.dart';
|
|
16
|
-
|
|
17
|
-
void main() {
|
|
18
|
-
// ── 1. S3 storage config (for storing patch blobs). ──────────────
|
|
19
|
-
// `bucketName` + `region` are required. `accessKeyId` and
|
|
20
|
-
// `secretAccessKey` are read-write credentials; in production use an
|
|
21
|
-
// IAM role with the minimum required permissions.
|
|
22
|
-
final s3Config = AwsS3StorageConfig(
|
|
23
|
-
bucketName: 'flutter-ota-bundles',
|
|
24
|
-
region: 'us-east-1',
|
|
25
|
-
accessKeyId: 'AKIA...',
|
|
26
|
-
secretAccessKey: 'wJal...',
|
|
27
|
-
basePath: 'bundles',
|
|
28
|
-
);
|
|
29
|
-
print('S3 bucket: ${s3Config.bucketName} (${s3Config.region})');
|
|
30
|
-
print('Base path: ${s3Config.basePath}');
|
|
31
|
-
|
|
32
|
-
// ── 2. S3 database config (for storing the bundles manifest). ───
|
|
33
|
-
// The "database" plugin reads/writes a `bundles.json` manifest in
|
|
34
|
-
// the same S3 bucket. `cloudfrontDistributionId` enables signed URL
|
|
35
|
-
// serving for the patch downloads.
|
|
36
|
-
final dbConfig = S3DatabaseConfig(
|
|
37
|
-
bucketName: 'flutter-ota-bundles',
|
|
38
|
-
region: 'us-east-1',
|
|
39
|
-
accessKeyId: 'AKIA...',
|
|
40
|
-
secretAccessKey: 'wJal...',
|
|
41
|
-
cloudfrontDistributionId: 'E1ABC2DEF3GHIJ',
|
|
42
|
-
);
|
|
43
|
-
print('S3 DB bucket: ${dbConfig.bucketName}');
|
|
44
|
-
print('CloudFront distribution: ${dbConfig.cloudfrontDistributionId}');
|
|
45
|
-
|
|
46
|
-
// ── 3. CloudFront URL signing (for time-limited download URLs). ──
|
|
47
|
-
// `cloudfrontSignedUrl` produces a URL valid for `expiresInSeconds`
|
|
48
|
-
// (default 1 hour). The signing key is a private RSA key in PEM
|
|
49
|
-
// format — never ship it in a Flutter app.
|
|
50
|
-
// final key = parseRsaPrivateKeyPem(
|
|
51
|
-
// File('cloudfront-private-key.pem').readAsStringSync(),
|
|
52
|
-
// );
|
|
53
|
-
// final signedUrl = cloudfrontSignedUrl(
|
|
54
|
-
// url: 'https://d1abc2def3ghij.cloudfront.net/patch.zip',
|
|
55
|
-
// privateKey: key,
|
|
56
|
-
// keyPairId: 'APKA...',
|
|
57
|
-
// expiresInSeconds: 600,
|
|
58
|
-
// );
|
|
59
|
-
// print('Signed URL: $signedUrl');
|
|
60
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: flutter_ota_kit_aws
|
|
2
|
-
description: AWS S3 storage + S3/DynamoDB database plugins for flutter_ota_kit (faithful port of hot-updater plugins/aws).
|
|
3
|
-
version: 0.1.10
|
|
4
|
-
homepage: https://github.com/HYPER12755/flutter-ota-kit
|
|
5
|
-
repository: https://github.com/HYPER12755/flutter-ota-kit
|
|
6
|
-
issue_tracker: https://github.com/HYPER12755/flutter-ota-kit/issues
|
|
7
|
-
documentation: https://github.com/HYPER12755/flutter-ota-kit#readme
|
|
8
|
-
license: MIT
|
|
9
|
-
|
|
10
|
-
environment:
|
|
11
|
-
sdk: ">=3.13.2 <4.0.0"
|
|
12
|
-
|
|
13
|
-
dependencies:
|
|
14
|
-
flutter_ota_kit_core: ^0.1.8
|
|
15
|
-
flutter_ota_kit_plugin_core: ^0.0.10
|
|
16
|
-
crypto: ^3.0.0
|
|
17
|
-
http: ^1.2.0
|
|
18
|
-
path: ^1.9.0
|
|
19
|
-
pointycastle: ^4.0.0
|
|
20
|
-
asn1lib: ^1.5.4
|
|
21
|
-
|
|
22
|
-
dev_dependencies:
|
|
23
|
-
test: ^1.25.0
|
|
24
|
-
lints: ^4.0.0
|
|
25
|
-
|
|
26
|
-
dependency_overrides:
|
|
27
|
-
flutter_ota_kit_core:
|
|
28
|
-
path: ../../packages/core
|
|
29
|
-
flutter_ota_kit_plugin_core:
|
|
30
|
-
path: ../plugin-core
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import 'package:flutter_ota_kit_core/flutter_ota_kit_core.dart'
|
|
2
|
-
show AppVersionGetBundlesArgs, Bundle, Platform, nilUuid;
|
|
3
|
-
import 'package:flutter_ota_kit_plugin_core/flutter_ota_kit_plugin_core.dart'
|
|
4
|
-
show DatabaseBundleQueryOptions, DatabasePlugin;
|
|
5
|
-
import 'package:flutter_ota_kit_aws/flutter_ota_kit_aws.dart'
|
|
6
|
-
show S3DatabaseConfig, AwsS3ClientLike, AwsCloudFrontClientLike, s3Database;
|
|
7
|
-
import 'package:test/test.dart';
|
|
8
|
-
|
|
9
|
-
import 'mock_aws_s3_client.dart' show Store, MockAwsS3Client;
|
|
10
|
-
|
|
11
|
-
/// Records CloudFront invalidation calls for assertions.
|
|
12
|
-
class MockCloudFrontClient implements AwsCloudFrontClientLike {
|
|
13
|
-
MockCloudFrontClient();
|
|
14
|
-
|
|
15
|
-
final List<(String, List<String>)> invalidations = [];
|
|
16
|
-
|
|
17
|
-
@override
|
|
18
|
-
Future<void> createInvalidation(
|
|
19
|
-
String distributionId,
|
|
20
|
-
List<String> paths, {
|
|
21
|
-
bool shouldWait = false,
|
|
22
|
-
}) async {
|
|
23
|
-
invalidations.add((distributionId, List<String>.from(paths)));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Bundle _makeBundle({
|
|
28
|
-
required String id,
|
|
29
|
-
String channel = 'production',
|
|
30
|
-
String? targetAppVersion,
|
|
31
|
-
String? fingerprintHash,
|
|
32
|
-
}) => Bundle(
|
|
33
|
-
id: id,
|
|
34
|
-
channel: channel,
|
|
35
|
-
enabled: true,
|
|
36
|
-
shouldForceUpdate: false,
|
|
37
|
-
fileHash: 'h-$id',
|
|
38
|
-
platform: Platform.android,
|
|
39
|
-
targetAppVersion: targetAppVersion,
|
|
40
|
-
storageUri: 's3://test-bucket/$id',
|
|
41
|
-
fingerprintHash: fingerprintHash,
|
|
42
|
-
message: 'msg-$id',
|
|
43
|
-
patches: null,
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
void main() {
|
|
47
|
-
group('aws s3Database', () {
|
|
48
|
-
late Store store;
|
|
49
|
-
late MockCloudFrontClient cf;
|
|
50
|
-
late DatabasePlugin plugin;
|
|
51
|
-
|
|
52
|
-
S3DatabaseConfig config({
|
|
53
|
-
required AwsS3ClientLike Function(S3DatabaseConfig) clientFactory,
|
|
54
|
-
String? cloudfrontDistributionId,
|
|
55
|
-
}) => S3DatabaseConfig(
|
|
56
|
-
bucketName: 'test-bucket',
|
|
57
|
-
region: 'us-east-1',
|
|
58
|
-
accessKeyId: 'ak',
|
|
59
|
-
secretAccessKey: 'sk',
|
|
60
|
-
clientFactory: clientFactory,
|
|
61
|
-
cloudfrontDistributionId: cloudfrontDistributionId,
|
|
62
|
-
cloudfrontClientFactory: (_) => cf,
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
setUp(() {
|
|
66
|
-
store = Store();
|
|
67
|
-
cf = MockCloudFrontClient();
|
|
68
|
-
plugin = s3Database(
|
|
69
|
-
config(
|
|
70
|
-
clientFactory: (_) => MockAwsS3Client(store),
|
|
71
|
-
cloudfrontDistributionId: 'DIST123',
|
|
72
|
-
),
|
|
73
|
-
)();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('plugin metadata', () {
|
|
77
|
-
expect(plugin.name, 's3Database');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test(
|
|
81
|
-
'commitBundle writes update.json and invalidates CloudFront',
|
|
82
|
-
() async {
|
|
83
|
-
await plugin.appendBundle(
|
|
84
|
-
_makeBundle(id: 'b1', targetAppVersion: '1.0.0'),
|
|
85
|
-
);
|
|
86
|
-
await plugin.commitBundle();
|
|
87
|
-
|
|
88
|
-
final keys = store.objects.keys.toList();
|
|
89
|
-
expect(keys, contains('production/android/1.0.0/update.json'));
|
|
90
|
-
|
|
91
|
-
expect(cf.invalidations, isNotEmpty);
|
|
92
|
-
expect(cf.invalidations.first.$1, 'DIST123');
|
|
93
|
-
},
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
test('getUpdateInfo (appVersion) resolves committed bundle', () async {
|
|
97
|
-
await plugin.appendBundle(
|
|
98
|
-
_makeBundle(id: 'b1', targetAppVersion: '1.0.0'),
|
|
99
|
-
);
|
|
100
|
-
await plugin.commitBundle();
|
|
101
|
-
|
|
102
|
-
final info = await plugin.getUpdateInfo(
|
|
103
|
-
AppVersionGetBundlesArgs(
|
|
104
|
-
platform: Platform.android,
|
|
105
|
-
bundleId: nilUuid,
|
|
106
|
-
appVersion: '1.0.0',
|
|
107
|
-
channel: 'production',
|
|
108
|
-
minBundleId: nilUuid,
|
|
109
|
-
),
|
|
110
|
-
);
|
|
111
|
-
expect(info, isNotNull);
|
|
112
|
-
expect(info!.id, 'b1');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test('getBundles returns committed bundles', () async {
|
|
116
|
-
await plugin.appendBundle(
|
|
117
|
-
_makeBundle(id: 'b1', targetAppVersion: '1.0.0'),
|
|
118
|
-
);
|
|
119
|
-
await plugin.commitBundle();
|
|
120
|
-
|
|
121
|
-
final result = await plugin.getBundles(
|
|
122
|
-
const DatabaseBundleQueryOptions(limit: 100, offset: 0),
|
|
123
|
-
);
|
|
124
|
-
expect(result.data, hasLength(1));
|
|
125
|
-
expect(result.data.first.id, 'b1');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
test('deleteBundle removes update.json and invalidates', () async {
|
|
129
|
-
await plugin.appendBundle(
|
|
130
|
-
_makeBundle(id: 'b1', targetAppVersion: '1.0.0'),
|
|
131
|
-
);
|
|
132
|
-
await plugin.commitBundle();
|
|
133
|
-
expect(
|
|
134
|
-
store.objects.keys,
|
|
135
|
-
contains('production/android/1.0.0/update.json'),
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
cf.invalidations.clear();
|
|
139
|
-
final bundle = (await plugin.getBundles(
|
|
140
|
-
const DatabaseBundleQueryOptions(limit: 100, offset: 0),
|
|
141
|
-
)).data.first;
|
|
142
|
-
await plugin.deleteBundle(bundle);
|
|
143
|
-
await plugin.commitBundle();
|
|
144
|
-
|
|
145
|
-
expect(
|
|
146
|
-
store.objects.keys,
|
|
147
|
-
isNot(contains('production/android/1.0.0/update.json')),
|
|
148
|
-
);
|
|
149
|
-
expect(cf.invalidations, isNotEmpty);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
test('no CloudFront invalidation when distribution id omitted', () async {
|
|
153
|
-
final noCf = s3Database(
|
|
154
|
-
config(clientFactory: (_) => MockAwsS3Client(store)),
|
|
155
|
-
)();
|
|
156
|
-
await noCf.appendBundle(_makeBundle(id: 'b1', targetAppVersion: '1.0.0'));
|
|
157
|
-
await noCf.commitBundle();
|
|
158
|
-
expect(cf.invalidations, isEmpty);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|