diff --git a/Package.resolved b/Package.resolved index d835fd6..a8e8a24 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/awslabs/aws-sdk-swift.git", "state" : { - "revision" : "22ac271a961d9c8cec2308bf853f773c04146260", - "version" : "0.44.0" + "revision" : "14da8fcf13246e4f46cadc7a5ce291d839f3225d", + "version" : "0.45.0" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/smithy-lang/smithy-swift", "state" : { - "revision" : "c9caeb7c2df39ac0d4d4c6182c40426b7ec4485a", - "version" : "0.49.0" + "revision" : "a30764bf83af6876a3956aa394c838dcf2975cb3", + "version" : "0.50.0" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nicklockwood/SwiftFormat", "state" : { - "revision" : "4bf475154c1c98dcdf751037f930f8e5c72597a4", - "version" : "0.53.10" + "revision" : "dd989a46d0c6f15c016484bab8afe5e7a67a4022", + "version" : "0.54.0" } } ], diff --git a/Package.swift b/Package.swift index 0e54814..32178b6 100644 --- a/Package.swift +++ b/Package.swift @@ -23,6 +23,9 @@ import PackageDescription +let swiftSettings: [SwiftSetting] = [.enableExperimentalFeature("StrictConcurrency=complete"), + ] + let package = Package( name: "dynamo-db-tables", platforms: [ @@ -34,7 +37,7 @@ let package = Package( targets: ["DynamoDBTables"]), ], dependencies: [ - .package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.40.0"), + .package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.45.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"), .package(url: "https://github.com/JohnSundell/CollectionConcurrencyKit", from :"0.2.0"), @@ -47,11 +50,13 @@ let package = Package( .product(name: "Metrics", package: "swift-metrics"), .product(name: "AWSDynamoDB", package: "aws-sdk-swift"), .product(name: "CollectionConcurrencyKit", package: "CollectionConcurrencyKit"), - ]), + ], + swiftSettings: swiftSettings), .testTarget( name: "DynamoDBTablesTests", dependencies: [ .target(name: "DynamoDBTables"), - ]), + ], + swiftSettings: swiftSettings), ], swiftLanguageVersions: [.v5] ) diff --git a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable+updateItems.swift b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable+updateItems.swift index 6ba55ff..64eded0 100644 --- a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable+updateItems.swift +++ b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable+updateItems.swift @@ -245,7 +245,6 @@ public extension AWSDynamoDBCompositePrimaryKeyTable { isTransactionConflict = true return DynamoDBTableError.transactionConflict(message: cancellationReason.message) - case "ProvisionedThroughputExceeded": return DynamoDBTableError.transactionProvisionedThroughputExceeded(message: cancellationReason.message) case "ThrottlingError": diff --git a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable.swift b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable.swift index 17417c3..cced139 100644 --- a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable.swift +++ b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeyTable.swift @@ -24,13 +24,13 @@ // DynamoDBTables // -import AWSClientRuntime import AwsCommonRuntimeKit import AWSDynamoDB import ClientRuntime import Foundation import Logging import Metrics +import SmithyIdentityAPI public struct AWSDynamoDBTableMetrics { // metric to record if the `TransactWrite` API is retried @@ -51,7 +51,7 @@ public struct AWSDynamoDBCompositePrimaryKeyTable: DynamoDBCompositePrimaryKeyTa let logger: Logging.Logger public init(tableName: String, region: Swift.String, - awsCredentialIdentityResolver: (any AWSClientRuntime.AWSCredentialIdentityResolver)? = nil, + awsCredentialIdentityResolver: (any SmithyIdentityAPI.AWSCredentialIdentityResolver)? = nil, httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil, consistentRead: Bool = true, escapeSingleQuoteInPartiQL: Bool = false, diff --git a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeysProjection.swift b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeysProjection.swift index 94f41a7..234e461 100644 --- a/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeysProjection.swift +++ b/Sources/DynamoDBTables/AWSDynamoDBCompositePrimaryKeysProjection.swift @@ -24,12 +24,12 @@ // DynamoDBTables // -import AWSClientRuntime import AwsCommonRuntimeKit import AWSDynamoDB import ClientRuntime import Foundation import Logging +import SmithyIdentityAPI public struct AWSDynamoDBCompositePrimaryKeysProjection: DynamoDBCompositePrimaryKeysProjection { let dynamodb: AWSDynamoDB.DynamoDBClient @@ -42,7 +42,7 @@ public struct AWSDynamoDBCompositePrimaryKeysProjection: DynamoDBCompositePrimar } public init(tableName: String, region: Swift.String, - awsCredentialIdentityResolver: (any AWSClientRuntime.AWSCredentialIdentityResolver)? = nil, + awsCredentialIdentityResolver: (any SmithyIdentityAPI.AWSCredentialIdentityResolver)? = nil, httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil, logger: Logging.Logger? = nil) throws { diff --git a/Sources/DynamoDBTables/DynamoDBClientTypes_AttributeValue+Codable.swift b/Sources/DynamoDBTables/DynamoDBClientTypes_AttributeValue+Codable.swift index 3a31814..e0f5592 100644 --- a/Sources/DynamoDBTables/DynamoDBClientTypes_AttributeValue+Codable.swift +++ b/Sources/DynamoDBTables/DynamoDBClientTypes_AttributeValue+Codable.swift @@ -1,9 +1,9 @@ // Code generated by smithy-swift-codegen. DO NOT EDIT! // swiftlint:disable identifier_name cyclomatic_complexity function_body_length -import AWSClientRuntime import AWSDynamoDB import ClientRuntime +import Foundation public struct Key: CodingKey { public let stringValue: String @@ -93,7 +93,7 @@ extension DynamoDBClientTypes.AttributeValue: Swift.Codable { self = .n(n) return } - let bDecoded = try values.decodeIfPresent(ClientRuntime.Data.self, forKey: .b) + let bDecoded = try values.decodeIfPresent(Foundation.Data.self, forKey: .b) if let b = bDecoded { self = .b(b) return @@ -126,10 +126,10 @@ extension DynamoDBClientTypes.AttributeValue: Swift.Codable { self = .ns(ns) return } - let bsContainer = try values.decodeIfPresent([ClientRuntime.Data?].self, forKey: .bs) - var bsDecoded0: [ClientRuntime.Data]? = nil + let bsContainer = try values.decodeIfPresent([Foundation.Data?].self, forKey: .bs) + var bsDecoded0: [Foundation.Data]? = nil if let bsContainer { - bsDecoded0 = [ClientRuntime.Data]() + bsDecoded0 = [Foundation.Data]() for blob0 in bsContainer { if let blob0 { bsDecoded0?.append(blob0) diff --git a/Tests/DynamoDBTablesTests/SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests.swift b/Tests/DynamoDBTablesTests/SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests.swift index 695b87f..d7c1663 100644 --- a/Tests/DynamoDBTablesTests/SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests.swift +++ b/Tests/DynamoDBTablesTests/SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests.swift @@ -129,7 +129,7 @@ class SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests: XCTestCase { for _ in 0 ..< 10 { let query: [ExpectedQueryableTypes] = try await table.query(forPartitionKey: "partitionId", - sortKeyCondition: .equals("sortId")) + sortKeyCondition: .equals("sortId")) guard query.count == 1, case let .testTypeA(firstDatabaseItem) = query[0] else { return XCTFail("Expected to retrieve item and there wasn't the correct number or type.") @@ -174,7 +174,7 @@ class SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests: XCTestCase { for _ in 0 ..< 10 { let query: [DatabaseRowType] = try await table.monomorphicQuery(forPartitionKey: "partitionId", - sortKeyCondition: .equals("sortId")) + sortKeyCondition: .equals("sortId")) guard query.count == 1, let firstQuery = query.first else { return XCTFail("Expected to retrieve item and there wasn't the correct number or type.")