@_nazmiforreal/flutter-ota 0.1.0 → 0.1.1

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.
Files changed (177) hide show
  1. package/bin/flutter-patcher.js +37 -39
  2. package/dart-src/packages/cli-tools/.dart_tool/package_config.json +496 -0
  3. package/dart-src/packages/cli-tools/.dart_tool/package_graph.json +743 -0
  4. package/dart-src/packages/cli-tools/.gitkeep +0 -0
  5. package/dart-src/packages/cli-tools/bin/flutter_patcher.dart +9 -0
  6. package/dart-src/packages/cli-tools/lib/flutter_patcher_cli.dart +73 -0
  7. package/dart-src/packages/cli-tools/lib/src/backend.dart +162 -0
  8. package/dart-src/packages/cli-tools/lib/src/cli_base.dart +56 -0
  9. package/dart-src/packages/cli-tools/lib/src/commands/build.dart +99 -0
  10. package/dart-src/packages/cli-tools/lib/src/commands/bundle.dart +151 -0
  11. package/dart-src/packages/cli-tools/lib/src/commands/channel.dart +140 -0
  12. package/dart-src/packages/cli-tools/lib/src/commands/config_command.dart +113 -0
  13. package/dart-src/packages/cli-tools/lib/src/commands/console.dart +55 -0
  14. package/dart-src/packages/cli-tools/lib/src/commands/deploy.dart +95 -0
  15. package/dart-src/packages/cli-tools/lib/src/commands/doctor.dart +48 -0
  16. package/dart-src/packages/cli-tools/lib/src/commands/fingerprint.dart +29 -0
  17. package/dart-src/packages/cli-tools/lib/src/commands/init.dart +82 -0
  18. package/dart-src/packages/cli-tools/lib/src/commands/keys.dart +55 -0
  19. package/dart-src/packages/cli-tools/lib/src/commands/migrate.dart +132 -0
  20. package/dart-src/packages/cli-tools/lib/src/commands/rollback.dart +41 -0
  21. package/dart-src/packages/cli-tools/lib/src/config.dart +715 -0
  22. package/dart-src/packages/cli-tools/lib/src/operations.dart +206 -0
  23. package/dart-src/packages/cli-tools/lib/src/pack.dart +417 -0
  24. package/dart-src/packages/cli-tools/lib/src/sign.dart +60 -0
  25. package/dart-src/packages/cli-tools/lib/src/util.dart +86 -0
  26. package/dart-src/packages/cli-tools/migrations/cloudflare/0001_hot-updater_init.sql +16 -0
  27. package/dart-src/packages/cli-tools/migrations/cloudflare/0002_hot-updater_0.13.0.sql +8 -0
  28. package/dart-src/packages/cli-tools/migrations/cloudflare/0003_hot-updater_0.18.0.sql +38 -0
  29. package/dart-src/packages/cli-tools/migrations/cloudflare/0004_hot-updater_0.29.0.sql +11 -0
  30. package/dart-src/packages/cli-tools/migrations/cloudflare/0005_hot-updater_0.31.0.sql +24 -0
  31. package/dart-src/packages/cli-tools/migrations/cloudflare/bundles.sql +42 -0
  32. package/dart-src/packages/cli-tools/migrations/supabase/20250103114225_init.sql +228 -0
  33. package/dart-src/packages/cli-tools/migrations/supabase/20250314000000_hot-updater_0.13.0.sql +134 -0
  34. package/dart-src/packages/cli-tools/migrations/supabase/20250516000000_hot-updater_0.18.0.sql +194 -0
  35. package/dart-src/packages/cli-tools/migrations/supabase/20251014000000_hot-updater_0.21.0.sql +184 -0
  36. package/dart-src/packages/cli-tools/migrations/supabase/20260401000000_hot-updater_0.29.0.sql +503 -0
  37. package/dart-src/packages/cli-tools/migrations/supabase/20260414000000_hot-updater_0.30.0.sql +50 -0
  38. package/dart-src/packages/cli-tools/migrations/supabase/20260422000000_hot-updater_0.31.0.sql +20 -0
  39. package/dart-src/packages/cli-tools/migrations/supabase/20260520014100_hot-updater_rls.sql +48 -0
  40. package/dart-src/packages/cli-tools/pubspec.lock +638 -0
  41. package/dart-src/packages/cli-tools/pubspec.yaml +37 -0
  42. package/dart-src/packages/core/lib/flutter_patcher_core.dart +29 -0
  43. package/dart-src/packages/core/lib/src/app_update_info.dart +111 -0
  44. package/dart-src/packages/core/lib/src/bundle.dart +191 -0
  45. package/dart-src/packages/core/lib/src/bundle_artifacts.dart +39 -0
  46. package/dart-src/packages/core/lib/src/bundle_patch_artifact.dart +47 -0
  47. package/dart-src/packages/core/lib/src/changed_asset.dart +77 -0
  48. package/dart-src/packages/core/lib/src/get_bundles_args.dart +78 -0
  49. package/dart-src/packages/core/lib/src/metadata.dart +31 -0
  50. package/dart-src/packages/core/lib/src/patch_info.dart +284 -0
  51. package/dart-src/packages/core/lib/src/platform.dart +15 -0
  52. package/dart-src/packages/core/lib/src/rollout.dart +209 -0
  53. package/dart-src/packages/core/lib/src/semver.dart +70 -0
  54. package/dart-src/packages/core/lib/src/semver_range.dart +358 -0
  55. package/dart-src/packages/core/lib/src/semver_version.dart +94 -0
  56. package/dart-src/packages/core/lib/src/status.dart +24 -0
  57. package/dart-src/packages/core/lib/src/strategy.dart +10 -0
  58. package/dart-src/packages/core/lib/src/update_bundle_params.dart +30 -0
  59. package/dart-src/packages/core/lib/src/uuid.dart +45 -0
  60. package/dart-src/packages/core/pubspec.lock +381 -0
  61. package/dart-src/packages/core/pubspec.yaml +9 -0
  62. package/dart-src/packages/core/tool/dbg.dart +6 -0
  63. package/dart-src/plugins/aws/.gitkeep +0 -0
  64. package/dart-src/plugins/aws/lib/flutter_patcher_aws.dart +12 -0
  65. package/dart-src/plugins/aws/lib/src/aws_cloudfront_client.dart +207 -0
  66. package/dart-src/plugins/aws/lib/src/aws_cloudfront_signer.dart +130 -0
  67. package/dart-src/plugins/aws/lib/src/aws_config.dart +59 -0
  68. package/dart-src/plugins/aws/lib/src/aws_database.dart +198 -0
  69. package/dart-src/plugins/aws/lib/src/aws_lambda_edge_storage.dart +72 -0
  70. package/dart-src/plugins/aws/lib/src/aws_s3_client.dart +312 -0
  71. package/dart-src/plugins/aws/lib/src/aws_ssm_client.dart +125 -0
  72. package/dart-src/plugins/aws/lib/src/aws_storage.dart +20 -0
  73. package/dart-src/plugins/aws/lib/src/aws_storage_profile.dart +123 -0
  74. package/dart-src/plugins/aws/lib/src/with_cloudfront_signed_url.dart +136 -0
  75. package/dart-src/plugins/aws/pubspec.lock +435 -0
  76. package/dart-src/plugins/aws/pubspec.yaml +22 -0
  77. package/dart-src/plugins/cloudflare/.gitkeep +0 -0
  78. package/dart-src/plugins/cloudflare/lib/flutter_patcher_cloudflare.dart +18 -0
  79. package/dart-src/plugins/cloudflare/lib/src/cloudflare_worker_database.dart +29 -0
  80. package/dart-src/plugins/cloudflare/lib/src/d1_build_where.dart +93 -0
  81. package/dart-src/plugins/cloudflare/lib/src/d1_bundle_mapper.dart +131 -0
  82. package/dart-src/plugins/cloudflare/lib/src/d1_client.dart +66 -0
  83. package/dart-src/plugins/cloudflare/lib/src/d1_config.dart +30 -0
  84. package/dart-src/plugins/cloudflare/lib/src/d1_database.dart +16 -0
  85. package/dart-src/plugins/cloudflare/lib/src/d1_database_plugin.dart +314 -0
  86. package/dart-src/plugins/cloudflare/lib/src/r2_config.dart +50 -0
  87. package/dart-src/plugins/cloudflare/lib/src/r2_s3_client.dart +287 -0
  88. package/dart-src/plugins/cloudflare/lib/src/r2_storage.dart +23 -0
  89. package/dart-src/plugins/cloudflare/lib/src/r2_storage_profile.dart +110 -0
  90. package/dart-src/plugins/cloudflare/migrations/0001_hot-updater_init.sql +16 -0
  91. package/dart-src/plugins/cloudflare/migrations/0002_hot-updater_0.13.0.sql +8 -0
  92. package/dart-src/plugins/cloudflare/migrations/0003_hot-updater_0.18.0.sql +38 -0
  93. package/dart-src/plugins/cloudflare/migrations/0004_hot-updater_0.29.0.sql +11 -0
  94. package/dart-src/plugins/cloudflare/migrations/0005_hot-updater_0.31.0.sql +24 -0
  95. package/dart-src/plugins/cloudflare/pubspec.lock +411 -0
  96. package/dart-src/plugins/cloudflare/pubspec.yaml +20 -0
  97. package/dart-src/plugins/cloudflare/sql/bundles.sql +42 -0
  98. package/dart-src/plugins/plugin-core/lib/flutter_patcher_plugin_core.dart +42 -0
  99. package/dart-src/plugins/plugin-core/lib/src/asset_storage_layout.dart +94 -0
  100. package/dart-src/plugins/plugin-core/lib/src/bundle_storage_layout.dart +44 -0
  101. package/dart-src/plugins/plugin-core/lib/src/bundle_unit_of_work.dart +259 -0
  102. package/dart-src/plugins/plugin-core/lib/src/bundle_unit_of_work_store.dart +20 -0
  103. package/dart-src/plugins/plugin-core/lib/src/calculate_pagination.dart +29 -0
  104. package/dart-src/plugins/plugin-core/lib/src/compression_format.dart +63 -0
  105. package/dart-src/plugins/plugin-core/lib/src/content_addressed_assets.dart +22 -0
  106. package/dart-src/plugins/plugin-core/lib/src/create_blob_database_plugin.dart +853 -0
  107. package/dart-src/plugins/plugin-core/lib/src/create_database_plugin.dart +525 -0
  108. package/dart-src/plugins/plugin-core/lib/src/create_storage_key_builder.dart +15 -0
  109. package/dart-src/plugins/plugin-core/lib/src/create_storage_plugin.dart +130 -0
  110. package/dart-src/plugins/plugin-core/lib/src/filter_compatible_app_versions.dart +18 -0
  111. package/dart-src/plugins/plugin-core/lib/src/generate_min_bundle_id.dart +19 -0
  112. package/dart-src/plugins/plugin-core/lib/src/get_update_info.dart +241 -0
  113. package/dart-src/plugins/plugin-core/lib/src/is_object.dart +5 -0
  114. package/dart-src/plugins/plugin-core/lib/src/legacy_asset_storage_layout.dart +9 -0
  115. package/dart-src/plugins/plugin-core/lib/src/paginate_bundles.dart +112 -0
  116. package/dart-src/plugins/plugin-core/lib/src/parse_storage_uri.dart +44 -0
  117. package/dart-src/plugins/plugin-core/lib/src/query_bundles.dart +70 -0
  118. package/dart-src/plugins/plugin-core/lib/src/request_update_bundle_state.dart +62 -0
  119. package/dart-src/plugins/plugin-core/lib/src/resolve_update_info_from_bundles.dart +43 -0
  120. package/dart-src/plugins/plugin-core/lib/src/storage_profile.dart +27 -0
  121. package/dart-src/plugins/plugin-core/lib/src/types.dart +454 -0
  122. package/dart-src/plugins/plugin-core/lib/src/uuidv7.dart +41 -0
  123. package/dart-src/plugins/plugin-core/pubspec.lock +396 -0
  124. package/dart-src/plugins/plugin-core/pubspec.yaml +15 -0
  125. package/dart-src/plugins/postgres/.gitkeep +0 -0
  126. package/dart-src/plugins/postgres/lib/flutter_patcher_postgres.dart +17 -0
  127. package/dart-src/plugins/postgres/lib/src/postgres_bundle_mapper.dart +130 -0
  128. package/dart-src/plugins/postgres/lib/src/postgres_client.dart +90 -0
  129. package/dart-src/plugins/postgres/lib/src/postgres_config.dart +35 -0
  130. package/dart-src/plugins/postgres/lib/src/postgres_database.dart +302 -0
  131. package/dart-src/plugins/postgres/lib/src/postgres_get_update_info.dart +120 -0
  132. package/dart-src/plugins/postgres/lib/src/postgres_storage.dart +205 -0
  133. package/dart-src/plugins/postgres/lib/src/postgres_types.dart +132 -0
  134. package/dart-src/plugins/postgres/pubspec.lock +427 -0
  135. package/dart-src/plugins/postgres/pubspec.yaml +18 -0
  136. package/dart-src/plugins/postgres/sql/bundles.sql +45 -0
  137. package/dart-src/plugins/postgres/sql/get_target_app_version_list.sql +21 -0
  138. package/dart-src/plugins/postgres/sql/get_update_info.spec.ts +171 -0
  139. package/dart-src/plugins/postgres/sql/get_update_info_by_app_version.sql +126 -0
  140. package/dart-src/plugins/postgres/sql/get_update_info_by_fingerprint_hash.sql +125 -0
  141. package/dart-src/plugins/postgres/sql/hash_user_id.sql +30 -0
  142. package/dart-src/plugins/postgres/sql/is_device_eligible.sql +237 -0
  143. package/dart-src/plugins/postgres/sql/prepareSql.ts +11 -0
  144. package/dart-src/plugins/standalone/.gitkeep +0 -0
  145. package/dart-src/plugins/standalone/lib/flutter_patcher_standalone.dart +12 -0
  146. package/dart-src/plugins/standalone/lib/src/standalone_config.dart +107 -0
  147. package/dart-src/plugins/standalone/lib/src/standalone_database.dart +233 -0
  148. package/dart-src/plugins/standalone/lib/src/standalone_storage.dart +175 -0
  149. package/dart-src/plugins/standalone/pubspec.lock +411 -0
  150. package/dart-src/plugins/standalone/pubspec.yaml +18 -0
  151. package/dart-src/plugins/supabase/lib/edge.dart +10 -0
  152. package/dart-src/plugins/supabase/lib/flutter_patcher_supabase.dart +21 -0
  153. package/dart-src/plugins/supabase/lib/src/supabase_bundle_mapper.dart +129 -0
  154. package/dart-src/plugins/supabase/lib/src/supabase_client_adapter.dart +154 -0
  155. package/dart-src/plugins/supabase/lib/src/supabase_client_http.dart +516 -0
  156. package/dart-src/plugins/supabase/lib/src/supabase_config.dart +34 -0
  157. package/dart-src/plugins/supabase/lib/src/supabase_database.dart +422 -0
  158. package/dart-src/plugins/supabase/lib/src/supabase_edge_function_database.dart +32 -0
  159. package/dart-src/plugins/supabase/lib/src/supabase_edge_function_storage.dart +99 -0
  160. package/dart-src/plugins/supabase/lib/src/supabase_signed_url_batcher.dart +145 -0
  161. package/dart-src/plugins/supabase/lib/src/supabase_storage.dart +298 -0
  162. package/dart-src/plugins/supabase/lib/src/types.dart +130 -0
  163. package/dart-src/plugins/supabase/pubspec.lock +515 -0
  164. package/dart-src/plugins/supabase/pubspec.yaml +19 -0
  165. package/dart-src/plugins/supabase/supabase/edge-functions/index.ts +44 -0
  166. package/dart-src/plugins/supabase/supabase/edge-functions/runtime.docker.integration.spec.ts +968 -0
  167. package/dart-src/plugins/supabase/supabase/migrations/20250103114225_init.sql +228 -0
  168. package/dart-src/plugins/supabase/supabase/migrations/20250314000000_hot-updater_0.13.0.sql +134 -0
  169. package/dart-src/plugins/supabase/supabase/migrations/20250516000000_hot-updater_0.18.0.sql +194 -0
  170. package/dart-src/plugins/supabase/supabase/migrations/20251014000000_hot-updater_0.21.0.sql +184 -0
  171. package/dart-src/plugins/supabase/supabase/migrations/20260401000000_hot-updater_0.29.0.sql +503 -0
  172. package/dart-src/plugins/supabase/supabase/migrations/20260414000000_hot-updater_0.30.0.sql +50 -0
  173. package/dart-src/plugins/supabase/supabase/migrations/20260422000000_hot-updater_0.31.0.sql +20 -0
  174. package/dart-src/plugins/supabase/supabase/migrations/20260520014100_hot-updater_rls.sql +48 -0
  175. package/package.json +2 -1
  176. package/scripts/postinstall.js +32 -23
  177. /package/bin/{flutter-patcher-linux → flutter-patcher-linux-x64} +0 -0
@@ -0,0 +1,132 @@
1
+ import 'package:flutter_patcher_core/flutter_patcher_core.dart'
2
+ show Platform;
3
+
4
+ /// Database row for the `bundles` table (snake_case columns).
5
+ ///
6
+ /// Faithful port of hot-updater `postgres/src/types.ts` `PostgresBundleRow`.
7
+ class PostgresBundleRow {
8
+ const PostgresBundleRow({
9
+ required this.id,
10
+ required this.channel,
11
+ required this.enabled,
12
+ required this.shouldForceUpdate,
13
+ required this.fileHash,
14
+ this.gitCommitHash,
15
+ this.message,
16
+ required this.platform,
17
+ this.targetAppVersion,
18
+ required this.storageUri,
19
+ this.fingerprintHash,
20
+ this.metadata,
21
+ this.manifestStorageUri,
22
+ this.manifestFileHash,
23
+ this.assetBaseStorageUri,
24
+ this.rolloutCohortCount,
25
+ this.targetCohorts,
26
+ });
27
+
28
+ factory PostgresBundleRow.fromJson(Map<String, dynamic> json) {
29
+ return PostgresBundleRow(
30
+ id: json['id'] as String,
31
+ channel: json['channel'] as String,
32
+ enabled: json['enabled'] as bool,
33
+ shouldForceUpdate: json['should_force_update'] as bool,
34
+ fileHash: json['file_hash'] as String,
35
+ gitCommitHash: json['git_commit_hash'] as String?,
36
+ message: json['message'] as String?,
37
+ platform: Platform.fromValue(json['platform'] as String),
38
+ targetAppVersion: json['target_app_version'] as String?,
39
+ storageUri: json['storage_uri'] as String,
40
+ fingerprintHash: json['fingerprint_hash'] as String?,
41
+ metadata: json['metadata'],
42
+ manifestStorageUri: json['manifest_storage_uri'] as String?,
43
+ manifestFileHash: json['manifest_file_hash'] as String?,
44
+ assetBaseStorageUri: json['asset_base_storage_uri'] as String?,
45
+ rolloutCohortCount: json['rollout_cohort_count'] as int?,
46
+ targetCohorts: (json['target_cohorts'] as List?)?.cast<String>(),
47
+ );
48
+ }
49
+
50
+ final String id;
51
+ final String channel;
52
+ final bool enabled;
53
+ final bool shouldForceUpdate;
54
+ final String fileHash;
55
+ final String? gitCommitHash;
56
+ final String? message;
57
+ final Platform platform;
58
+ final String? targetAppVersion;
59
+ final String storageUri;
60
+ final String? fingerprintHash;
61
+ final dynamic metadata;
62
+ final String? manifestStorageUri;
63
+ final String? manifestFileHash;
64
+ final String? assetBaseStorageUri;
65
+ final int? rolloutCohortCount;
66
+ final List<String>? targetCohorts;
67
+
68
+ Map<String, dynamic> toJson() => {
69
+ 'id': id,
70
+ 'channel': channel,
71
+ 'enabled': enabled,
72
+ 'should_force_update': shouldForceUpdate,
73
+ 'file_hash': fileHash,
74
+ 'git_commit_hash': gitCommitHash,
75
+ 'message': message,
76
+ 'platform': platform.name,
77
+ 'target_app_version': targetAppVersion,
78
+ 'storage_uri': storageUri,
79
+ 'fingerprint_hash': fingerprintHash,
80
+ 'metadata': metadata ?? const {},
81
+ 'manifest_storage_uri': manifestStorageUri,
82
+ 'manifest_file_hash': manifestFileHash,
83
+ 'asset_base_storage_uri': assetBaseStorageUri,
84
+ 'rollout_cohort_count': rolloutCohortCount,
85
+ 'target_cohorts': targetCohorts,
86
+ };
87
+ }
88
+
89
+ /// Database row for the `bundle_patches` table (snake_case columns).
90
+ ///
91
+ /// Faithful port of hot-updater `postgres/src/types.ts` `PostgresBundlePatchRow`.
92
+ class PostgresBundlePatchRow {
93
+ const PostgresBundlePatchRow({
94
+ required this.id,
95
+ required this.bundleId,
96
+ required this.baseBundleId,
97
+ required this.baseFileHash,
98
+ required this.patchFileHash,
99
+ required this.patchStorageUri,
100
+ required this.orderIndex,
101
+ });
102
+
103
+ factory PostgresBundlePatchRow.fromJson(Map<String, dynamic> json) {
104
+ return PostgresBundlePatchRow(
105
+ id: json['id'] as String,
106
+ bundleId: json['bundle_id'] as String,
107
+ baseBundleId: json['base_bundle_id'] as String,
108
+ baseFileHash: json['base_file_hash'] as String,
109
+ patchFileHash: json['patch_file_hash'] as String,
110
+ patchStorageUri: json['patch_storage_uri'] as String,
111
+ orderIndex: json['order_index'] as int,
112
+ );
113
+ }
114
+
115
+ final String id;
116
+ final String bundleId;
117
+ final String baseBundleId;
118
+ final String baseFileHash;
119
+ final String patchFileHash;
120
+ final String patchStorageUri;
121
+ final int orderIndex;
122
+
123
+ Map<String, dynamic> toJson() => {
124
+ 'id': id,
125
+ 'bundle_id': bundleId,
126
+ 'base_bundle_id': baseBundleId,
127
+ 'base_file_hash': baseFileHash,
128
+ 'patch_file_hash': patchFileHash,
129
+ 'patch_storage_uri': patchStorageUri,
130
+ 'order_index': orderIndex,
131
+ };
132
+ }
@@ -0,0 +1,427 @@
1
+ # Generated by pub
2
+ # See https://dart.dev/tools/pub/glossary#lockfile
3
+ packages:
4
+ _fe_analyzer_shared:
5
+ dependency: transitive
6
+ description:
7
+ name: _fe_analyzer_shared
8
+ sha256: "9a3386eea899815698dd55995277cf7cb8572ee52b399a6edfb7ae2b50e5fc19"
9
+ url: "https://pub.dev"
10
+ source: hosted
11
+ version: "105.0.0"
12
+ analyzer:
13
+ dependency: transitive
14
+ description:
15
+ name: analyzer
16
+ sha256: "62993bed6eadbe9596c5c20d5c167e7bc563c5fe266657a04ddeb93bdb84f4c9"
17
+ url: "https://pub.dev"
18
+ source: hosted
19
+ version: "14.1.0"
20
+ args:
21
+ dependency: transitive
22
+ description:
23
+ name: args
24
+ sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
25
+ url: "https://pub.dev"
26
+ source: hosted
27
+ version: "2.7.0"
28
+ async:
29
+ dependency: transitive
30
+ description:
31
+ name: async
32
+ sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
33
+ url: "https://pub.dev"
34
+ source: hosted
35
+ version: "2.13.1"
36
+ boolean_selector:
37
+ dependency: transitive
38
+ description:
39
+ name: boolean_selector
40
+ sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
41
+ url: "https://pub.dev"
42
+ source: hosted
43
+ version: "2.1.2"
44
+ buffer:
45
+ dependency: transitive
46
+ description:
47
+ name: buffer
48
+ sha256: "389da2ec2c16283c8787e0adaede82b1842102f8c8aae2f49003a766c5c6b3d1"
49
+ url: "https://pub.dev"
50
+ source: hosted
51
+ version: "1.2.3"
52
+ charcode:
53
+ dependency: transitive
54
+ description:
55
+ name: charcode
56
+ sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a
57
+ url: "https://pub.dev"
58
+ source: hosted
59
+ version: "1.4.0"
60
+ cli_config:
61
+ dependency: transitive
62
+ description:
63
+ name: cli_config
64
+ sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec
65
+ url: "https://pub.dev"
66
+ source: hosted
67
+ version: "0.2.0"
68
+ collection:
69
+ dependency: transitive
70
+ description:
71
+ name: collection
72
+ sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
73
+ url: "https://pub.dev"
74
+ source: hosted
75
+ version: "1.19.1"
76
+ convert:
77
+ dependency: transitive
78
+ description:
79
+ name: convert
80
+ sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
81
+ url: "https://pub.dev"
82
+ source: hosted
83
+ version: "3.1.2"
84
+ coverage:
85
+ dependency: transitive
86
+ description:
87
+ name: coverage
88
+ sha256: "956a3de0725ca232ad353565a8290d3357592bf4250f6f298a185e2d949c5d3d"
89
+ url: "https://pub.dev"
90
+ source: hosted
91
+ version: "1.15.1"
92
+ crypto:
93
+ dependency: transitive
94
+ description:
95
+ name: crypto
96
+ sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
97
+ url: "https://pub.dev"
98
+ source: hosted
99
+ version: "3.0.7"
100
+ file:
101
+ dependency: transitive
102
+ description:
103
+ name: file
104
+ sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
105
+ url: "https://pub.dev"
106
+ source: hosted
107
+ version: "7.0.1"
108
+ flutter_patcher_core:
109
+ dependency: "direct main"
110
+ description:
111
+ path: "../../packages/core"
112
+ relative: true
113
+ source: path
114
+ version: "0.1.0"
115
+ flutter_patcher_plugin_core:
116
+ dependency: "direct main"
117
+ description:
118
+ path: "../plugin-core"
119
+ relative: true
120
+ source: path
121
+ version: "0.0.1"
122
+ frontend_server_client:
123
+ dependency: transitive
124
+ description:
125
+ name: frontend_server_client
126
+ sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
127
+ url: "https://pub.dev"
128
+ source: hosted
129
+ version: "4.0.0"
130
+ glob:
131
+ dependency: transitive
132
+ description:
133
+ name: glob
134
+ sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
135
+ url: "https://pub.dev"
136
+ source: hosted
137
+ version: "2.1.3"
138
+ http_multi_server:
139
+ dependency: transitive
140
+ description:
141
+ name: http_multi_server
142
+ sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
143
+ url: "https://pub.dev"
144
+ source: hosted
145
+ version: "3.2.2"
146
+ http_parser:
147
+ dependency: transitive
148
+ description:
149
+ name: http_parser
150
+ sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
151
+ url: "https://pub.dev"
152
+ source: hosted
153
+ version: "4.1.2"
154
+ io:
155
+ dependency: transitive
156
+ description:
157
+ name: io
158
+ sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
159
+ url: "https://pub.dev"
160
+ source: hosted
161
+ version: "1.0.5"
162
+ lints:
163
+ dependency: "direct dev"
164
+ description:
165
+ name: lints
166
+ sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
167
+ url: "https://pub.dev"
168
+ source: hosted
169
+ version: "4.0.0"
170
+ logging:
171
+ dependency: transitive
172
+ description:
173
+ name: logging
174
+ sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
175
+ url: "https://pub.dev"
176
+ source: hosted
177
+ version: "1.3.0"
178
+ matcher:
179
+ dependency: transitive
180
+ description:
181
+ name: matcher
182
+ sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
183
+ url: "https://pub.dev"
184
+ source: hosted
185
+ version: "0.12.20"
186
+ meta:
187
+ dependency: transitive
188
+ description:
189
+ name: meta
190
+ sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
191
+ url: "https://pub.dev"
192
+ source: hosted
193
+ version: "1.19.0"
194
+ mime:
195
+ dependency: transitive
196
+ description:
197
+ name: mime
198
+ sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
199
+ url: "https://pub.dev"
200
+ source: hosted
201
+ version: "1.0.6"
202
+ node_preamble:
203
+ dependency: transitive
204
+ description:
205
+ name: node_preamble
206
+ sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
207
+ url: "https://pub.dev"
208
+ source: hosted
209
+ version: "2.0.2"
210
+ package_config:
211
+ dependency: transitive
212
+ description:
213
+ name: package_config
214
+ sha256: ffcf4cf3d6c0b74ac43708d9f56625506e8a68aa935abe9d267a7330f320eb5d
215
+ url: "https://pub.dev"
216
+ source: hosted
217
+ version: "3.0.0"
218
+ path:
219
+ dependency: transitive
220
+ description:
221
+ name: path
222
+ sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
223
+ url: "https://pub.dev"
224
+ source: hosted
225
+ version: "1.9.1"
226
+ pool:
227
+ dependency: transitive
228
+ description:
229
+ name: pool
230
+ sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d"
231
+ url: "https://pub.dev"
232
+ source: hosted
233
+ version: "1.5.2"
234
+ postgres:
235
+ dependency: "direct main"
236
+ description:
237
+ name: postgres
238
+ sha256: "123de5cbadc56a7e8d9fa485c780b6b56940b4081f4c74f3a5578682757c299b"
239
+ url: "https://pub.dev"
240
+ source: hosted
241
+ version: "3.5.12"
242
+ pub_semver:
243
+ dependency: transitive
244
+ description:
245
+ name: pub_semver
246
+ sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
247
+ url: "https://pub.dev"
248
+ source: hosted
249
+ version: "2.2.0"
250
+ shelf:
251
+ dependency: transitive
252
+ description:
253
+ name: shelf
254
+ sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
255
+ url: "https://pub.dev"
256
+ source: hosted
257
+ version: "1.4.2"
258
+ shelf_packages_handler:
259
+ dependency: transitive
260
+ description:
261
+ name: shelf_packages_handler
262
+ sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
263
+ url: "https://pub.dev"
264
+ source: hosted
265
+ version: "3.0.2"
266
+ shelf_static:
267
+ dependency: transitive
268
+ description:
269
+ name: shelf_static
270
+ sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
271
+ url: "https://pub.dev"
272
+ source: hosted
273
+ version: "1.1.3"
274
+ shelf_web_socket:
275
+ dependency: transitive
276
+ description:
277
+ name: shelf_web_socket
278
+ sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
279
+ url: "https://pub.dev"
280
+ source: hosted
281
+ version: "3.0.0"
282
+ source_map_stack_trace:
283
+ dependency: transitive
284
+ description:
285
+ name: source_map_stack_trace
286
+ sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
287
+ url: "https://pub.dev"
288
+ source: hosted
289
+ version: "2.1.2"
290
+ source_maps:
291
+ dependency: transitive
292
+ description:
293
+ name: source_maps
294
+ sha256: "14c2945847669b44089bb1222f66873d7ff7103c58911917f2a63c5a62327898"
295
+ url: "https://pub.dev"
296
+ source: hosted
297
+ version: "0.10.14"
298
+ source_span:
299
+ dependency: transitive
300
+ description:
301
+ name: source_span
302
+ sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
303
+ url: "https://pub.dev"
304
+ source: hosted
305
+ version: "1.10.2"
306
+ stack_trace:
307
+ dependency: transitive
308
+ description:
309
+ name: stack_trace
310
+ sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
311
+ url: "https://pub.dev"
312
+ source: hosted
313
+ version: "1.12.1"
314
+ stream_channel:
315
+ dependency: transitive
316
+ description:
317
+ name: stream_channel
318
+ sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
319
+ url: "https://pub.dev"
320
+ source: hosted
321
+ version: "2.1.4"
322
+ string_scanner:
323
+ dependency: transitive
324
+ description:
325
+ name: string_scanner
326
+ sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
327
+ url: "https://pub.dev"
328
+ source: hosted
329
+ version: "1.4.1"
330
+ term_glyph:
331
+ dependency: transitive
332
+ description:
333
+ name: term_glyph
334
+ sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
335
+ url: "https://pub.dev"
336
+ source: hosted
337
+ version: "1.2.2"
338
+ test:
339
+ dependency: "direct dev"
340
+ description:
341
+ name: test
342
+ sha256: "0d5ba5602ec3baa28c8ce365e1efc5575969c765f45c554a3e167dc7945b9c30"
343
+ url: "https://pub.dev"
344
+ source: hosted
345
+ version: "1.31.2"
346
+ test_api:
347
+ dependency: transitive
348
+ description:
349
+ name: test_api
350
+ sha256: "475610b2aa23c19687cce2961e44b0cc57cafe220f67c2b80201231b2a07fbe7"
351
+ url: "https://pub.dev"
352
+ source: hosted
353
+ version: "0.7.13"
354
+ test_core:
355
+ dependency: transitive
356
+ description:
357
+ name: test_core
358
+ sha256: a39c204a4fc7a7ccb04a2b985e359fda3cc37e45e0b8ac61c3fb1a05aa832132
359
+ url: "https://pub.dev"
360
+ source: hosted
361
+ version: "0.6.19"
362
+ typed_data:
363
+ dependency: transitive
364
+ description:
365
+ name: typed_data
366
+ sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
367
+ url: "https://pub.dev"
368
+ source: hosted
369
+ version: "1.4.0"
370
+ vm_service:
371
+ dependency: transitive
372
+ description:
373
+ name: vm_service
374
+ sha256: "5f37239c4851efcef929cea7824e76df7f2f0970aef85d66bbc430afa40e72f0"
375
+ url: "https://pub.dev"
376
+ source: hosted
377
+ version: "15.3.0"
378
+ watcher:
379
+ dependency: transitive
380
+ description:
381
+ name: watcher
382
+ sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
383
+ url: "https://pub.dev"
384
+ source: hosted
385
+ version: "1.2.1"
386
+ web:
387
+ dependency: transitive
388
+ description:
389
+ name: web
390
+ sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
391
+ url: "https://pub.dev"
392
+ source: hosted
393
+ version: "1.1.1"
394
+ web_socket:
395
+ dependency: transitive
396
+ description:
397
+ name: web_socket
398
+ sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"
399
+ url: "https://pub.dev"
400
+ source: hosted
401
+ version: "1.0.1"
402
+ web_socket_channel:
403
+ dependency: transitive
404
+ description:
405
+ name: web_socket_channel
406
+ sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
407
+ url: "https://pub.dev"
408
+ source: hosted
409
+ version: "3.0.3"
410
+ webkit_inspection_protocol:
411
+ dependency: transitive
412
+ description:
413
+ name: webkit_inspection_protocol
414
+ sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
415
+ url: "https://pub.dev"
416
+ source: hosted
417
+ version: "1.2.1"
418
+ yaml:
419
+ dependency: transitive
420
+ description:
421
+ name: yaml
422
+ sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
423
+ url: "https://pub.dev"
424
+ source: hosted
425
+ version: "3.1.3"
426
+ sdks:
427
+ dart: ">=3.11.0 <4.0.0"
@@ -0,0 +1,18 @@
1
+ name: flutter_patcher_postgres
2
+ description: Postgres plugin for flutter_patcher — database backend.
3
+ version: 0.1.0
4
+ publish_to: none
5
+
6
+ environment:
7
+ sdk: ">=3.3.0 <4.0.0"
8
+
9
+ dependencies:
10
+ flutter_patcher_core:
11
+ path: ../../packages/core
12
+ flutter_patcher_plugin_core:
13
+ path: ../../plugins/plugin-core
14
+ postgres: ^3.4.0
15
+
16
+ dev_dependencies:
17
+ test: ^1.25.0
18
+ lints: ^4.0.0
@@ -0,0 +1,45 @@
1
+ -- HotUpdater.bundles
2
+
3
+ CREATE TYPE platforms AS ENUM ('ios', 'android');
4
+
5
+ CREATE TABLE bundles (
6
+ id uuid PRIMARY KEY,
7
+ platform platforms NOT NULL,
8
+ should_force_update boolean NOT NULL,
9
+ enabled boolean NOT NULL,
10
+ file_hash text NOT NULL,
11
+ git_commit_hash text,
12
+ message text,
13
+ channel text NOT NULL DEFAULT 'production',
14
+ storage_uri text NOT NULL,
15
+ target_app_version text,
16
+ fingerprint_hash text,
17
+ CONSTRAINT check_version_or_fingerprint CHECK (
18
+ (target_app_version IS NOT NULL) OR (fingerprint_hash IS NOT NULL)
19
+ ),
20
+ metadata jsonb DEFAULT '{}'::jsonb,
21
+ manifest_storage_uri text,
22
+ manifest_file_hash text,
23
+ asset_base_storage_uri text,
24
+ rollout_cohort_count INTEGER DEFAULT 1000
25
+ CHECK (rollout_cohort_count >= 0 AND rollout_cohort_count <= 1000),
26
+ target_cohorts TEXT[]
27
+ );
28
+
29
+ CREATE TABLE bundle_patches (
30
+ id text PRIMARY KEY,
31
+ bundle_id uuid NOT NULL REFERENCES bundles(id) ON DELETE CASCADE,
32
+ base_bundle_id uuid NOT NULL REFERENCES bundles(id) ON DELETE CASCADE,
33
+ base_file_hash text NOT NULL,
34
+ patch_file_hash text NOT NULL,
35
+ patch_storage_uri text NOT NULL,
36
+ order_index integer NOT NULL DEFAULT 0
37
+ );
38
+
39
+ CREATE INDEX bundles_target_app_version_idx ON bundles(target_app_version);
40
+ CREATE INDEX bundles_fingerprint_hash_idx ON bundles(fingerprint_hash);
41
+ CREATE INDEX bundles_channel_idx ON bundles(channel);
42
+ CREATE INDEX bundles_rollout_idx ON bundles(rollout_cohort_count);
43
+ CREATE INDEX bundles_target_cohorts_idx ON bundles USING GIN (target_cohorts);
44
+ CREATE INDEX bundle_patches_bundle_id_idx ON bundle_patches(bundle_id);
45
+ CREATE INDEX bundle_patches_base_bundle_id_idx ON bundle_patches(base_bundle_id);
@@ -0,0 +1,21 @@
1
+ -- HotUpdater.get_target_app_version_list
2
+
3
+ CREATE OR REPLACE FUNCTION get_target_app_version_list (
4
+ app_platform platforms,
5
+ min_bundle_id uuid
6
+ )
7
+ RETURNS TABLE (
8
+ target_app_version text
9
+ )
10
+ LANGUAGE plpgsql
11
+ AS
12
+ $$
13
+ BEGIN
14
+ RETURN QUERY
15
+ SELECT b.target_app_version
16
+ FROM bundles b
17
+ WHERE b.platform = app_platform
18
+ AND b.id >= min_bundle_id
19
+ GROUP BY b.target_app_version;
20
+ END;
21
+ $$;