diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 896d93cf4e..5005f3e58d 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -174,10 +174,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -209,6 +209,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -275,11 +276,11 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -308,10 +309,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -344,10 +345,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -377,6 +378,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -428,10 +430,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -471,6 +473,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -520,12 +523,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -551,12 +554,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -580,6 +583,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -671,10 +675,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -729,10 +733,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -775,10 +779,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -819,10 +823,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -870,12 +874,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -904,12 +908,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -942,12 +946,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -978,6 +982,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -1014,10 +1019,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1073,12 +1078,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -1121,12 +1126,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -1168,10 +1173,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1236,10 +1241,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1276,10 +1281,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1315,10 +1320,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1361,10 +1366,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1405,10 +1410,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1443,10 +1448,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1482,10 +1487,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1513,10 +1518,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1904,10 +1909,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" # Group dependencies which have a constraint set in the global "pubspec.yaml" groups: device_info_plus: @@ -1948,10 +1953,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1979,10 +1984,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2007,6 +2012,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2014,6 +2020,9 @@ updates: built_value: patterns: - "built_value" + drift: + patterns: + - "drift" intl: patterns: - "intl" @@ -2050,6 +2059,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2075,6 +2085,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2099,6 +2110,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2160,6 +2172,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2182,6 +2195,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2205,10 +2219,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2248,10 +2262,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2280,10 +2294,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3187,11 +3201,11 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_db_common" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_storage_s3_dart" - package-ecosystem: "pub" directory: "packages/storage/amplify_storage_s3/example" @@ -3210,10 +3224,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3257,10 +3271,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3301,10 +3315,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" # Group dependencies which have a constraint set in the global "pubspec.yaml" groups: async: @@ -3350,10 +3364,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3384,10 +3398,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3418,12 +3432,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -3458,10 +3472,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3497,6 +3511,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" diff --git a/.github/workflows/amplify_api_dart.yaml b/.github/workflows/amplify_api_dart.yaml index 6961d7a08f..88a3a85db4 100644 --- a/.github/workflows/amplify_api_dart.yaml +++ b/.github/workflows/amplify_api_dart.yaml @@ -24,6 +24,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -50,6 +52,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_core.yaml b/.github/workflows/amplify_core.yaml index 4e860cb45e..60bb40b7ff 100644 --- a/.github/workflows/amplify_core.yaml +++ b/.github/workflows/amplify_core.yaml @@ -22,6 +22,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -46,6 +48,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_datastore.yaml b/.github/workflows/amplify_datastore.yaml index 9d6f8f5958..03facfd76b 100644 --- a/.github/workflows/amplify_datastore.yaml +++ b/.github/workflows/amplify_datastore.yaml @@ -22,6 +22,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -46,6 +48,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_datastore_plugin_interface.yaml b/.github/workflows/amplify_datastore_plugin_interface.yaml index a6550afd87..4399997ded 100644 --- a/.github/workflows/amplify_datastore_plugin_interface.yaml +++ b/.github/workflows/amplify_datastore_plugin_interface.yaml @@ -20,6 +20,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -42,6 +44,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_push_notifications.yaml b/.github/workflows/amplify_push_notifications.yaml index 93f79bffde..db29a6a34c 100644 --- a/.github/workflows/amplify_push_notifications.yaml +++ b/.github/workflows/amplify_push_notifications.yaml @@ -19,6 +19,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/**/*.dart' @@ -52,6 +54,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/**/*.dart' diff --git a/.github/workflows/amplify_push_notifications_example.yaml b/.github/workflows/amplify_push_notifications_example.yaml index 97b9b0ad30..730d5f4750 100644 --- a/.github/workflows/amplify_push_notifications_example.yaml +++ b/.github/workflows/amplify_push_notifications_example.yaml @@ -16,6 +16,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/example/**/*.dart' @@ -48,6 +50,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/example/**/*.dart' diff --git a/.github/workflows/aws_logging_cloudwatch.yaml b/.github/workflows/aws_logging_cloudwatch.yaml index 90af71948a..936449a852 100644 --- a/.github/workflows/aws_logging_cloudwatch.yaml +++ b/.github/workflows/aws_logging_cloudwatch.yaml @@ -20,6 +20,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*' @@ -44,6 +46,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*' diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart b/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart index ac54bd8ac1..d06246afdf 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart +++ b/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart @@ -1,6 +1,5 @@ import 'package:amplify_logging_cloudwatch/src/amplify_log_stream_name_provider.dart'; import 'package:amplify_logging_cloudwatch/src/path_provider/flutter_path_provider.dart'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/aws_logging_cloudwatch.dart'; /// {@macro aws_logging_cloudwatch.cloudwatch_logger_plugin} @@ -17,7 +16,6 @@ class AmplifyCloudWatchLoggerPlugin extends CloudWatchLoggerPlugin { defaultLogStreamNameProvider: AmplifyLogStreamNameProvider().defaultLogStreamName, ), - logStore: DartQueuedItemStore(null), remoteLoggingConstraintProvider: pluginConfig.defaultRemoteConfiguration == null ? null diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml b/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml index 91bea196cd..13b701cbba 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml +++ b/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml @@ -11,12 +11,9 @@ environment: dependencies: amplify_core: ">=1.4.0 <1.5.0" - amplify_db_common_dart: ">=0.3.0+1 <0.4.0" aws_common: ">=0.6.0 <0.7.0" aws_logging_cloudwatch: ^0.1.0 - collection: ^1.15.0 device_info_plus: ^9.0.0 - drift: ">=2.12.0 <2.13.0" flutter: sdk: flutter intl: ">=0.18.0 <1.0.0" diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart b/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart deleted file mode 100644 index c49b105780..0000000000 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; -import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; -import 'package:test/test.dart'; - -void main() { - late DartQueuedItemStore db; - - group('DartQueuedItemStore ', () { - setUpAll(() { - db = DartQueuedItemStore('/tmp'); - }); - - tearDownAll(() async { - await db.clear(); - }); - - setUp(() async { - await db.clear(); - }); - - Future> getAll() async { - return db.getCount(100); - } - - test('writes values to storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(values.length); - final readValues = readItems.map((e) => e.value); - expect(readValues, equals(values)); - }); - - test('writes values to storage with enable queue rotation', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem( - value, - DateTime.now().toIso8601String(), - enableQueueRotation: true, - ); - } - - final readItems = await getAll(); - expect(readItems.length, 1); - expect(readItems.first.value, values.last); - }); - - test('returns first n items in storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(3); - final readValues = readItems.map((e) => e.value); - expect(readValues, equals(values.sublist(0, 3))); - }); - - test( - 'returns all stored items when get request size exceeds stored item count', - () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(100); - final readValues = readItems.map((e) => e.value); - expect(readValues, values); - }); - - test('deletes all items in storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - await db.deleteItems(await getAll()); - - final readItems = await getAll(); - expect(readItems, isEmpty); - }); - - test('deletes first subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - await db.deleteItems(await db.getCount(3)); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(3)); - }); - - test('deletes middle subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(3, 7); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['0', '1', '2', '7', '8', '9']); - }); - - test('deletes last subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(7); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(0, 7)); - }); - - test('deletes first, middle, and last subsets of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - const valuesToDelete = ['0', '1', '4', '5', '8', '9']; - final itemsToDelete = (await getAll()).where((item) { - return valuesToDelete.contains(item.value); - }); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['2', '3', '6', '7']); - }); - - test('deletes inner left and right subsets of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - const valuesToDelete = ['1', '2', '4', '5', '7', '8']; - final itemsToDelete = (await getAll()).where((item) { - return valuesToDelete.contains(item.value); - }); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['0', '3', '6', '9']); - }); - - test('deletes the first stored item', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(0, 1); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(1)); - }); - - test('deletes the last stored item', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(9); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(0, 9)); - }); - - test('throws no error when deleting all items twice', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - var readValues = await getAll(); - - await db.deleteItems(readValues); - await db.deleteItems(readValues); - - readValues = await getAll(); - - expect(readValues, isEmpty); - }); - - test('returns all stored items', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values); - }); - - test('returns empty list when no items are stored', () async { - final readItems = await getAll(); - expect(readItems, isEmpty); - }); - - test( - 'checks if storage is full', - () async { - const capacityLimit = 1; - - final largeItem = '0' * 10240; // 10KB for example - - for (var i = 0; i < 5; i++) { - await db.addItem(largeItem, DateTime.now().toIso8601String()); - } - - var result = db.isFull(capacityLimit); - expect(result, isFalse); - - for (var i = 0; i < 100; i++) { - await db.addItem(largeItem, DateTime.now().toIso8601String()); - } - - result = db.isFull(capacityLimit); - expect(result, isTrue); - }, - ); - }); -} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite b/packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite new file mode 100644 index 0000000000..89304fcb4b Binary files /dev/null and b/packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite differ diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart index 49b7f09715..a39904a5d4 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/cloudwatch_logger_plugin.dart @@ -8,7 +8,8 @@ import 'package:amplify_core/amplify_core.dart'; // ignore: invalid_use_of_internal_member, implementation_imports import 'package:amplify_core/src/http/amplify_category_method.dart'; import 'package:aws_logging_cloudwatch/aws_logging_cloudwatch.dart'; -import 'package:aws_logging_cloudwatch/src/queued_item_store/in_memory_queued_item_store.dart'; +import 'package:aws_logging_cloudwatch/src/path_provider/app_path_provider.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/sdk/cloud_watch_logs.dart'; import 'package:aws_logging_cloudwatch/src/stoppable_timer.dart'; @@ -54,8 +55,6 @@ class CloudWatchLoggerPlugin extends AWSLoggerPlugin required CloudWatchPluginConfig pluginConfig, RemoteLoggingConstraintProvider? remoteLoggingConstraintProvider, CloudWatchLogStreamProvider? logStreamProvider, - // TODO(nikahsn): remove after moving queued item store implementation from - // amplify_logging_cloudwath to aws_logging_cloudwatch @protected QueuedItemStore? logStore, }) : _enabled = pluginConfig.enable, _pluginConfig = pluginConfig, @@ -71,10 +70,8 @@ class CloudWatchLoggerPlugin extends AWSLoggerPlugin region: pluginConfig.region, credentialsProvider: credentialsProvider, ), - // TODO(nikahsn): move queued item store implementation from - // amplify_logging_cloudwath to aws_logging_cloudwatch and use - // DartQueueItemStore instead of InMemoryQueuedItemStore - _logStore = logStore ?? InMemoryQueuedItemStore(), + _logStore = + logStore ?? DartQueuedItemStore(const DartAppPathProvider()), _logStreamProvider = logStreamProvider ?? DefaultCloudWatchLogStreamProvider( logGroupName: pluginConfig.logGroupName, diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider.dart new file mode 100644 index 0000000000..646ebc61d7 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider.dart @@ -0,0 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +export 'app_path_provider_stub.dart' + if (dart.library.html) 'app_path_provider_html.dart' + if (dart.library.io) 'app_path_provider_io.dart'; diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_html.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_html.dart new file mode 100644 index 0000000000..bf50dca4a6 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_html.dart @@ -0,0 +1,22 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'package:amplify_core/amplify_core.dart'; + +/// {@template aws_logging_cloudwatch.app_path_provider} +/// Provides App paths for aws_logging_cloudwatch package. +/// {@endtemplate} +class DartAppPathProvider implements AppPathProvider { + /// {@macro aws_logging_cloudwatch.app_path_provider} + const DartAppPathProvider(); + + @override + Future getApplicationSupportPath() async { + return ''; + } + + @override + Future getTemporaryPath() async { + return ''; + } +} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart new file mode 100644 index 0000000000..87fe157320 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart @@ -0,0 +1,24 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:io'; + +import 'package:amplify_core/amplify_core.dart'; + +/// {@template aws_logging_cloudwatch.app_path_provider} +/// Provides App paths for aws_logging_cloudwatch package. +/// {@endtemplate} +class DartAppPathProvider implements AppPathProvider { + /// {@macro aws_logging_cloudwatch.app_path_provider} + const DartAppPathProvider(); + + @override + Future getApplicationSupportPath() async { + return Directory.current.path; + } + + @override + Future getTemporaryPath() async { + return Directory.systemTemp.path; + } +} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart new file mode 100644 index 0000000000..068f8f04f2 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart @@ -0,0 +1,26 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'package:amplify_core/amplify_core.dart'; + +/// {@template aws_logging_cloudwatch.app_path_provider} +/// Provides App paths for aws_logging_cloudwatch package. +/// {@endtemplate} +class DartAppPathProvider implements AppPathProvider { + /// {@macro aws_logging_cloudwatch.app_path_provider} + const DartAppPathProvider(); + + @override + Future getApplicationSupportPath() async { + throw UnimplementedError( + 'getApplicationSupportPath() has not been implemented in the current platform.', + ); + } + + @override + Future getTemporaryPath() async { + throw UnimplementedError( + 'getTemporaryPath() has not been implemented in the current platform.', + ); + } +} diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart similarity index 94% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart index fd2bd1fee4..5db1a8d647 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart @@ -3,7 +3,7 @@ import 'dart:async'; -import 'package:aws_common/aws_common.dart'; +import 'package:amplify_core/amplify_core.dart'; // ignore: implementation_imports import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; @@ -14,7 +14,7 @@ import 'package:meta/meta.dart'; class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} // ignore: avoid_unused_constructor_parameters - DartQueuedItemStore(String? storagePath) { + DartQueuedItemStore(AppPathProvider appPathProvider) { throw UnimplementedError('constructor has not been implemented.'); } diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart similarity index 77% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart index c4cb9ef090..2ea1ae0c5a 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart @@ -3,23 +3,17 @@ import 'dart:async'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/drift/drift_queued_item_store.dart'; -import 'package:aws_common/aws_common.dart'; +import 'package:amplify_core/amplify_core.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/drift/drift_queued_item_store.dart'; // ignore: implementation_imports import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; -import 'package:path_provider/path_provider.dart'; /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} - factory DartQueuedItemStore(String? storagePath) { - final FutureOr path; - if (storagePath == null) { - path = getApplicationSupportDirectory().then((value) => value.path); - } else { - path = storagePath; - } + factory DartQueuedItemStore(AppPathProvider pathProvider) { + final FutureOr path = pathProvider.getApplicationSupportPath(); final database = DriftQueuedItemStore(path); return DartQueuedItemStore._(database); } diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart similarity index 93% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart index 9cc7c50b96..deac3ff6cb 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart @@ -6,8 +6,8 @@ import 'dart:async'; import 'package:amplify_core/amplify_core.dart'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/index_db/indexed_db_adapter.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/in_memory_queued_item_store.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/index_db/indexed_db_adapter.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; @@ -17,7 +17,7 @@ class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.index_db_queued_item_store} // ignore: avoid_unused_constructor_parameters - DartQueuedItemStore(String? storagePath); + DartQueuedItemStore(AppPathProvider appPathProvider); late final Future _database = () async { if (await IndexedDbAdapter.checkIsIndexedDBSupported()) { diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml b/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml index 095c3f2ee3..90d70b085f 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml @@ -10,10 +10,13 @@ environment: dependencies: amplify_core: ">=1.4.0 <1.5.0" + amplify_db_common_dart: ">=0.3.0+1 <0.4.0" aws_common: ">=0.6.0 <0.7.0" aws_signature_v4: ">=0.5.0 <0.6.0" built_collection: ^5.1.1 built_value: ">=8.6.0 <8.7.0" + collection: ^1.15.0 + drift: ">=2.12.0 <2.13.0" fixnum: ^1.1.0 intl: ">=0.18.0 <1.0.0" json_annotation: ">=4.8.1 <4.9.0" diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart index ab035a6ca2..3576e0daa0 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart @@ -1,6 +1,8 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import 'package:aws_logging_cloudwatch/src/path_provider/app_path_provider.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/in_memory_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:test/test.dart'; @@ -231,7 +233,7 @@ void main() { await db.addItem('0', DateTime.now().toIso8601String()); } - var result = db.isFull(capacityLimit); + var result = await db.isFull(capacityLimit); expect(result, isFalse); // add enough items to exceed capacity limit of 1mb @@ -239,7 +241,245 @@ void main() { await db.addItem('0', DateTime.now().toIso8601String()); } - result = db.isFull(capacityLimit); + result = await db.isFull(capacityLimit); + expect(result, isTrue); + }, + ); + }); + + group('DartQueuedItemStore ', () { + setUpAll(() { + db = DartQueuedItemStore(const DartAppPathProvider()); + }); + + tearDownAll(() async { + await db.clear(); + }); + + setUp(() async { + await db.clear(); + }); + + Future> getAll() async { + return db.getCount(100); + } + + test('writes values to storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(values.length); + final readValues = readItems.map((e) => e.value); + expect(readValues, equals(values)); + }); + + test('writes values to storage with enable queue rotation', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem( + value, + DateTime.now().toIso8601String(), + enableQueueRotation: true, + ); + } + + final readItems = await getAll(); + expect(readItems.length, 1); + expect(readItems.first.value, values.last); + }); + + test('returns first n items in storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(3); + final readValues = readItems.map((e) => e.value); + expect(readValues, equals(values.sublist(0, 3))); + }); + + test( + 'returns all stored items when get request size exceeds stored item count', + () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(100); + final readValues = readItems.map((e) => e.value); + expect(readValues, values); + }); + + test('deletes all items in storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + await db.deleteItems(await getAll()); + + final readItems = await getAll(); + expect(readItems, isEmpty); + }); + + test('deletes first subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + await db.deleteItems(await db.getCount(3)); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(3)); + }); + + test('deletes middle subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(3, 7); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['0', '1', '2', '7', '8', '9']); + }); + + test('deletes last subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(7); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(0, 7)); + }); + + test('deletes first, middle, and last subsets of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + const valuesToDelete = ['0', '1', '4', '5', '8', '9']; + final itemsToDelete = (await getAll()).where((item) { + return valuesToDelete.contains(item.value); + }); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['2', '3', '6', '7']); + }); + + test('deletes inner left and right subsets of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + const valuesToDelete = ['1', '2', '4', '5', '7', '8']; + final itemsToDelete = (await getAll()).where((item) { + return valuesToDelete.contains(item.value); + }); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['0', '3', '6', '9']); + }); + + test('deletes the first stored item', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(0, 1); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(1)); + }); + + test('deletes the last stored item', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(9); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(0, 9)); + }); + + test('throws no error when deleting all items twice', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + var readValues = await getAll(); + + await db.deleteItems(readValues); + await db.deleteItems(readValues); + + readValues = await getAll(); + + expect(readValues, isEmpty); + }); + + test('returns all stored items', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values); + }); + + test('returns empty list when no items are stored', () async { + final readItems = await getAll(); + expect(readItems, isEmpty); + }); + + test( + 'checks if storage is full', + () async { + const capacityLimit = 1; + + final largeItem = '0' * 10240; // 10KB for example + + for (var i = 0; i < 5; i++) { + await db.addItem(largeItem, DateTime.now().toIso8601String()); + } + + var result = await db.isFull(capacityLimit); + expect(result, isFalse); + + for (var i = 0; i < 100; i++) { + await db.addItem(largeItem, DateTime.now().toIso8601String()); + } + + result = await db.isFull(capacityLimit); expect(result, isTrue); }, );