diff --git a/.codecov.yml b/.codecov.yml index b36f658506..79188b8fad 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,6 +3,7 @@ codecov: coverage: status: + patch: off project: default: threshold: 1% diff --git a/.github/composite_actions/get_platform_parameters/action.yml b/.github/composite_actions/get_platform_parameters/action.yml index c9e8e61e07..7ac2d4f612 100644 --- a/.github/composite_actions/get_platform_parameters/action.yml +++ b/.github/composite_actions/get_platform_parameters/action.yml @@ -17,6 +17,9 @@ outputs: destination: description: "The destination associated with the given platform and Xcode version" value: ${{ steps.get-destination.outputs.destination }} + device: + description: "The device name used in the destination" + value: ${{ steps.get-destination.outputs.device }} sdk: description: "The SDK associated with the given platform" value: ${{ steps.get-sdk.outputs.sdk }} @@ -38,9 +41,8 @@ runs: - id: get-xcode-version run: | - LATEST_XCODE_VERSION=14.3.1 - MINIMUM_XCODE_VERSION_IOS_MAC=14.1.0 - MINIMUM_XCODE_VERSION_WATCH_TV=14.3.1 + LATEST_XCODE_VERSION=15.3.0 + MINIMUM_XCODE_VERSION=15.0.1 INPUT_XCODE_VERSION=${{ inputs.xcode_version }} @@ -48,13 +50,7 @@ runs: latest) XCODE_VERSION=$LATEST_XCODE_VERSION ;; minimum) - INPUT_PLATFORM=${{ inputs.platform }} - case $INPUT_PLATFORM in - iOS|macOS) - XCODE_VERSION=$MINIMUM_XCODE_VERSION_IOS_MAC ;; - tvOS|watchOS) - XCODE_VERSION=$MINIMUM_XCODE_VERSION_WATCH_TV ;; - esac ;; + XCODE_VERSION=$MINIMUM_XCODE_VERSION ;; *) XCODE_VERSION=$INPUT_XCODE_VERSION ;; esac @@ -68,23 +64,42 @@ runs: INPUT_DESTINATION='${{ inputs.destination }}' INPUT_XCODE_VERSION=${{ inputs.xcode_version }} - DESTINATION_MAPPING='{ - "minimum": { - "iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1", - "tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1", - "watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.1", - "macOS": "platform=macOS,arch=x86_64" - }, - "latest": { - "iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.4", - "tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4", - "watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4", - "macOS": "platform=macOS,arch=x86_64" - } - }' + case $INPUT_PLATFORM/$INPUT_XCODE_VERSION in + iOS/latest) + DEVICE="iPhone 15" + OS_VERSION="17.4" + ;; + iOS/*) + DEVICE="iPhone 14" + OS_VERSION="17.0.1" + ;; + tvOS/latest) + DEVICE="Apple TV 4K (3rd generation)" + OS_VERSION="17.4" + ;; + tvOS/*) + DEVICE="Apple TV 4K (3rd generation)" + OS_VERSION="17.0" + ;; + watchOS/latest) + DEVICE="Apple Watch Series 9 (45mm)" + OS_VERSION="10.4" + ;; + watchOS/*) + DEVICE="Apple Watch Series 8 (45mm)" + OS_VERSION="10.0" + ;; + esac + + DESTINATION_MAPPING="{ + \"iOS\": \"platform=iOS Simulator,name=$DEVICE,OS=$OS_VERSION\", + \"tvOS\": \"platform=tvOS Simulator,name=$DEVICE,OS=$OS_VERSION\", + \"watchOS\": \"platform=watchOS Simulator,name=$DEVICE,OS=$OS_VERSION\", + \"macOS\": \"platform=macOS,arch=arm64\" + }" if [ -z "$INPUT_DESTINATION" ]; then - DESTINATION=$(echo $DESTINATION_MAPPING | jq -r ".\"$INPUT_XCODE_VERSION\".$INPUT_PLATFORM") + DESTINATION=$(echo $DESTINATION_MAPPING | jq -r ".$INPUT_PLATFORM") else DESTINATION=$INPUT_DESTINATION fi @@ -94,6 +109,7 @@ runs: exit 1 fi echo "destination=$DESTINATION" >> $GITHUB_OUTPUT + echo "device=$DEVICE" >> $GITHUB_OUTPUT shell: bash - id: get-sdk diff --git a/.github/workflows/build_minimum_supported_swift_platforms.yml b/.github/workflows/build_minimum_supported_swift_platforms.yml index 0e0522a479..7f6052abfc 100644 --- a/.github/workflows/build_minimum_supported_swift_platforms.yml +++ b/.github/workflows/build_minimum_supported_swift_platforms.yml @@ -27,7 +27,7 @@ jobs: uses: ./.github/workflows/build_scheme.yml with: scheme: Amplify-Build - os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }} + os-runner: 'macos-latest' xcode-version: 'minimum' platform: ${{ matrix.platform }} save_build_cache: false diff --git a/.github/workflows/build_scheme.yml b/.github/workflows/build_scheme.yml index 1ec3b433fc..df802858ee 100644 --- a/.github/workflows/build_scheme.yml +++ b/.github/workflows/build_scheme.yml @@ -16,7 +16,7 @@ on: os-runner: type: string - default: 'macos-13' + default: 'macos-latest' save_build_cache: type: boolean diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 9b1631d149..1de1725fd1 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -15,14 +15,14 @@ jobs: strategy: matrix: include: - - os: macos-13 - xcode-version: 14.3.1 - device: iPhone 14 Pro - version: 16.4 - - os: macos-12 - xcode-version: 14.1 - device: iPhone 13 Pro - version: 16.1 + - os: macos-latest + xcode-version: 15.3.0 + device: iPhone 15 + version: 17.4 + - os: macos-latest + xcode-version: 15.0.1 + device: iPhone 14 + version: 17.0.1 name: Canary Test - Xcode ${{ matrix.xcode-version }} runs-on: ${{ matrix.os }} steps: @@ -39,7 +39,7 @@ jobs: run: amplify init --quickstart --frontend ios - name: Setup Ruby - uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 + uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0 with: ruby-version: '3.2.1' bundler-cache: true diff --git a/.github/workflows/integ_test_push_notifications.yml b/.github/workflows/integ_test_push_notifications.yml index ff8c2c6a2a..89cfa8d756 100644 --- a/.github/workflows/integ_test_push_notifications.yml +++ b/.github/workflows/integ_test_push_notifications.yml @@ -26,7 +26,7 @@ permissions: jobs: push-notification-integration-tests: name: ${{ matrix.platform }} Tests | PushNotificationHostApp - runs-on: macos-13 + runs-on: macos-latest timeout-minutes: 30 environment: IntegrationTest strategy: diff --git a/.github/workflows/release_kickoff.yml b/.github/workflows/release_kickoff.yml index 86145a487c..76fc248335 100644 --- a/.github/workflows/release_kickoff.yml +++ b/.github/workflows/release_kickoff.yml @@ -1,5 +1,5 @@ # Creates a PR to push main to release branch to kick-off the release workflow -name: Release Amplify iOS +name: Release Amplify iOS on: workflow_dispatch: @@ -10,7 +10,7 @@ permissions: jobs: release: name: Release - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 diff --git a/.github/workflows/run_integration_tests.yml b/.github/workflows/run_integration_tests.yml index 36adfa4645..cf7e5d57df 100644 --- a/.github/workflows/run_integration_tests.yml +++ b/.github/workflows/run_integration_tests.yml @@ -4,7 +4,7 @@ on: inputs: os-runner: type: string - default: 'macos-13' + default: 'macos-latest' scheme: description: 'The scheme to run the tests' required: true @@ -17,7 +17,7 @@ on: required: false type: string xcode_version: - description: 'The verion of Xcode used to run these tests' + description: 'The version of Xcode used to run these tests' default: 'latest' type: string destination: diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index c3ef4fc588..d071290a38 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -32,6 +32,9 @@ on: required: false type: string default: '-test-iterations 3 -retry-tests-on-failure' + os-runner: + description: 'runs-on input' + type: string permissions: contents: read @@ -39,7 +42,7 @@ permissions: jobs: unit-tests: name: ${{ inputs.platform }} Tests | ${{ inputs.scheme }} - runs-on: macos-13 + runs-on: ${{ inputs.os-runner }} timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout repository diff --git a/.github/workflows/run_unit_tests_platforms.yml b/.github/workflows/run_unit_tests_platforms.yml index 852cbd1b12..972a4e64dd 100644 --- a/.github/workflows/run_unit_tests_platforms.yml +++ b/.github/workflows/run_unit_tests_platforms.yml @@ -21,6 +21,10 @@ on: required: false type: string default: '-test-iterations 3 -retry-tests-on-failure' + os-runner: + description: 'runs-on input' + type: string + default: 'macos-latest' permissions: contents: read @@ -43,4 +47,5 @@ jobs: platform: ${{ matrix.platform }} generate_coverage_report: ${{ github.event_name != 'workflow_dispatch' && matrix.platform == 'iOS' && inputs.generate_coverage_report }} timeout-minutes: ${{ inputs.timeout-minutes }} - test_iterations_flags: ${{ inputs.test_iterations_flags }} \ No newline at end of file + test_iterations_flags: ${{ inputs.test_iterations_flags }} + os-runner: ${{ inputs.os-runner }} \ No newline at end of file diff --git a/.github/workflows/stress_test.yml b/.github/workflows/stress_test.yml index 32764beef5..7c9aa6692e 100644 --- a/.github/workflows/stress_test.yml +++ b/.github/workflows/stress_test.yml @@ -14,7 +14,7 @@ concurrency: jobs: prepare-for-test: - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest outputs: destination: ${{ steps.platform.outputs.destination }} @@ -40,7 +40,7 @@ jobs: auth-stress-test: needs: prepare-for-test - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest env: DESTINATION: ${{ needs.prepare-for-test.outputs.destination }} @@ -71,7 +71,7 @@ jobs: geo-stress-test: needs: prepare-for-test - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest env: DESTINATION: ${{ needs.prepare-for-test.outputs.destination }} @@ -102,7 +102,7 @@ jobs: storage-stress-test: needs: prepare-for-test - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest env: DESTINATION: ${{ needs.prepare-for-test.outputs.destination }} @@ -133,7 +133,7 @@ jobs: datastore-stress-test: needs: prepare-for-test - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest env: DESTINATION: ${{ needs.prepare-for-test.outputs.destination }} @@ -164,7 +164,7 @@ jobs: graphql-api-stress-test: needs: prepare-for-test - runs-on: macos-13 + runs-on: macos-latest environment: IntegrationTest env: DESTINATION: ${{ needs.prepare-for-test.outputs.destination }} diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index c8f3a74225..008683f254 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -70,8 +70,7 @@ jobs: AWSPredictionsPlugin, AWSPinpointAnalyticsPlugin, AWSPinpointPushNotificationsPlugin, - AWSS3StoragePlugin, - CoreMLPredictionsPlugin + AWSS3StoragePlugin ] uses: ./.github/workflows/run_unit_tests_platforms.yml with: @@ -96,8 +95,7 @@ jobs: { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' }, { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' }, { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' }, - { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' }, - { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' } + { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' } ] uses: ./.github/workflows/upload_coverage_report.yml with: diff --git a/Amplify/Core/Support/AmplifyAsyncSequence.swift b/Amplify/Core/Support/AmplifyAsyncSequence.swift index b98c0f17bb..0320b6c9a3 100644 --- a/Amplify/Core/Support/AmplifyAsyncSequence.swift +++ b/Amplify/Core/Support/AmplifyAsyncSequence.swift @@ -11,8 +11,8 @@ public typealias WeakAmplifyAsyncSequenceRef = WeakRef: AsyncSequence, Cancellable { public typealias Iterator = AsyncStream.Iterator - private var asyncStream: AsyncStream! = nil - private var continuation: AsyncStream.Continuation! = nil + private let asyncStream: AsyncStream + private let continuation: AsyncStream.Continuation private var parent: Cancellable? public private(set) var isCancelled: Bool = false @@ -20,9 +20,7 @@ public class AmplifyAsyncSequence: AsyncSequence, Cancellable public init(parent: Cancellable? = nil, bufferingPolicy: AsyncStream.Continuation.BufferingPolicy = .unbounded) { self.parent = parent - asyncStream = AsyncStream(Element.self, bufferingPolicy: bufferingPolicy) { continuation in - self.continuation = continuation - } + (asyncStream, continuation) = AsyncStream.makeStream(of: Element.self, bufferingPolicy: bufferingPolicy) } public func makeAsyncIterator() -> Iterator { diff --git a/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift b/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift index 38772392da..3bb58d9f64 100644 --- a/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift +++ b/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift @@ -11,8 +11,8 @@ public typealias WeakAmplifyAsyncThrowingSequenceRef = WeakRef: AsyncSequence, Cancellable { public typealias Iterator = AsyncThrowingStream.Iterator - private var asyncStream: AsyncThrowingStream! = nil - private var continuation: AsyncThrowingStream.Continuation! = nil + private let asyncStream: AsyncThrowingStream + private let continuation: AsyncThrowingStream.Continuation private var parent: Cancellable? public private(set) var isCancelled: Bool = false @@ -20,9 +20,7 @@ public class AmplifyAsyncThrowingSequence: AsyncSequence, Can public init(parent: Cancellable? = nil, bufferingPolicy: AsyncThrowingStream.Continuation.BufferingPolicy = .unbounded) { self.parent = parent - asyncStream = AsyncThrowingStream(Element.self, bufferingPolicy: bufferingPolicy, { continuation in - self.continuation = continuation - }) + (asyncStream, continuation) = AsyncThrowingStream.makeStream(of: Element.self, bufferingPolicy: bufferingPolicy) } public func makeAsyncIterator() -> Iterator { diff --git a/Amplify/Core/Support/TaskQueue.swift b/Amplify/Core/Support/TaskQueue.swift index a09bfcc4d8..b7ba5c0553 100644 --- a/Amplify/Core/Support/TaskQueue.swift +++ b/Amplify/Core/Support/TaskQueue.swift @@ -10,12 +10,11 @@ import Foundation /// A helper for executing asynchronous work serially. public class TaskQueue { typealias Block = @Sendable () async -> Void - private var streamContinuation: AsyncStream.Continuation! + private let streamContinuation: AsyncStream.Continuation public init() { - let stream = AsyncStream.init { continuation in - streamContinuation = continuation - } + let (stream, continuation) = AsyncStream.makeStream(of: Block.self) + self.streamContinuation = continuation Task { for await block in stream { diff --git a/Amplify/DevMenu/AmplifyDevMenu.swift b/Amplify/DevMenu/AmplifyDevMenu.swift index 796027de86..b54767e3db 100644 --- a/Amplify/DevMenu/AmplifyDevMenu.swift +++ b/Amplify/DevMenu/AmplifyDevMenu.swift @@ -12,6 +12,7 @@ import UIKit /// Presents a developer menu using the provided `DevMenuPresentationContextProvider` /// upon notification from a `TriggerRecognizer`. Default recognizer is a `LongPressGestureRecognizer` +@MainActor public final class AmplifyDevMenu: DevMenuBehavior, TriggerDelegate { weak var devMenuPresentationContextProvider: DevMenuPresentationContextProvider? diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListDecoder.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListDecoder.swift index c6050bb2d7..e75add220b 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListDecoder.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListDecoder.swift @@ -7,6 +7,7 @@ import Foundation import Amplify +import AWSPluginsCore /// This decoder is registered and used to detect various data payloads objects to store /// inside an AppSyncListProvider when decoding to the Lazy `List` type as a "not yet loaded" List. If the data payload @@ -18,6 +19,7 @@ public struct AppSyncListDecoder: ModelListDecoder { let appSyncAssociatedIdentifiers: [String] let appSyncAssociatedFields: [String] let apiName: String? + let authMode: AWSAuthorizationType? } /// Used by the custom decoder implemented in the `List` type to detect if the payload can be diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListPayload.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListPayload.swift index 6205e6c448..033c718d86 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListPayload.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListPayload.swift @@ -16,11 +16,14 @@ public struct AppSyncListPayload: Codable { let graphQLData: JSONValue let apiName: String? + let authMode: AWSAuthorizationType? public init(graphQLData: JSONValue, apiName: String?, + authMode: AWSAuthorizationType?, variables: [String: JSONValue]?) { self.apiName = apiName + self.authMode = authMode self.variables = variables self.graphQLData = graphQLData } diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListProvider.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListProvider.swift index 2edf147c1b..4f1eaab6f0 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListProvider.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListProvider.swift @@ -14,6 +14,9 @@ public class AppSyncListProvider: ModelListProvider { /// The API friendly name used to reference the API to call let apiName: String? + /// The auth mode used for this API call + let authMode: AWSAuthorizationType? + /// The limit for each page size var limit: Int? = 1_000 @@ -42,7 +45,8 @@ public class AppSyncListProvider: ModelListProvider { convenience init(payload: AppSyncListPayload) throws { let listResponse = try AppSyncListResponse.initWithMetadata(type: Element.self, graphQLData: payload.graphQLData, - apiName: payload.apiName) + apiName: payload.apiName, + authMode: payload.authMode) self.init(elements: listResponse.items, nextToken: listResponse.nextToken, @@ -59,27 +63,34 @@ public class AppSyncListProvider: ModelListProvider { convenience init(metadata: AppSyncListDecoder.Metadata) { self.init(associatedIdentifiers: metadata.appSyncAssociatedIdentifiers, associatedFields: metadata.appSyncAssociatedFields, - apiName: metadata.apiName) + apiName: metadata.apiName, + authMode: metadata.authMode) } // Internal initializer for testing init(elements: [Element], nextToken: String? = nil, apiName: String? = nil, + authMode: AWSAuthorizationType? = nil, limit: Int? = nil, filter: [String: Any]? = nil) { self.loadedState = .loaded(elements: elements, nextToken: nextToken, filter: filter) self.apiName = apiName + self.authMode = authMode self.limit = limit } // Internal initializer for testing - init(associatedIdentifiers: [String], associatedFields: [String], apiName: String? = nil) { + init(associatedIdentifiers: [String], + associatedFields: [String], + apiName: String? = nil, + authMode: AWSAuthorizationType? = nil) { self.loadedState = .notLoaded(associatedIdentifiers: associatedIdentifiers, associatedFields: associatedFields) self.apiName = apiName + self.authMode = authMode } // MARK: APIs @@ -128,14 +139,16 @@ public class AppSyncListProvider: ModelListProvider { modelSchema: Element.schema, filter: filter, limit: limit, - apiName: apiName) + apiName: apiName, + authMode: authMode) do { let graphQLResponse = try await Amplify.API.query(request: request) switch graphQLResponse { case .success(let graphQLData): guard let listResponse = try? AppSyncListResponse.initWithMetadata(type: Element.self, graphQLData: graphQLData, - apiName: self.apiName) else { + apiName: self.apiName, + authMode: self.authMode) else { throw CoreError.listOperation(""" The AppSync response return successfully, but could not decode to AWSAppSyncListResponse from: \(graphQLData) @@ -196,7 +209,8 @@ public class AppSyncListProvider: ModelListProvider { filter: filter, limit: limit, nextToken: nextToken, - apiName: apiName) + apiName: apiName, + authMode: authMode) do { let graphQLResponse = try await Amplify.API.query(request: request) switch graphQLResponse { @@ -225,7 +239,8 @@ public class AppSyncListProvider: ModelListProvider { let metadata = AppSyncListDecoder.Metadata.init( appSyncAssociatedIdentifiers: associatedIdentifiers, appSyncAssociatedFields: associatedFields, - apiName: apiName) + apiName: apiName, + authMode: authMode) var container = encoder.singleValueContainer() try container.encode(metadata) case .loaded(let elements, _, _): diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListResponse.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListResponse.swift index 7f83ab4ce7..a30821853d 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListResponse.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncListResponse.swift @@ -7,6 +7,7 @@ import Amplify import Foundation +import AWSPluginsCore /// Resembles the AppSync's GraphQL response for a list operation. struct AppSyncListResponse: Codable { @@ -25,10 +26,14 @@ extension AppSyncListResponse { /// model metadata on its array associations. static func initWithMetadata(type: Element.Type, graphQLData: JSONValue, - apiName: String?) throws -> AppSyncListResponse { + apiName: String?, + authMode: AWSAuthorizationType?) throws -> AppSyncListResponse { var elements = [Element]() if case let .array(jsonArray) = graphQLData["items"] { - let jsonArrayWithMetadata = AppSyncModelMetadataUtils.addMetadata(toModelArray: jsonArray, apiName: apiName) + let jsonArrayWithMetadata = AppSyncModelMetadataUtils.addMetadata( + toModelArray: jsonArray, + apiName: apiName, + authMode: authMode) let encoder = JSONEncoder() encoder.dateEncodingStrategy = ModelDateFormatting.encodingStrategy diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelDecoder.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelDecoder.swift index b70728b052..dab2e44756 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelDecoder.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelDecoder.swift @@ -7,6 +7,7 @@ import Foundation import Amplify +import AWSPluginsCore /// This decoder is registered and used to detect various data payloads to store /// inside an `AppSyncModelProvider` when decoding to the `LazyReference` as a "not yet loaded" Reference. If the data payload @@ -17,11 +18,16 @@ public struct AppSyncModelDecoder: ModelProviderDecoder { struct Metadata: Codable { let identifiers: [LazyReferenceIdentifier] let apiName: String? + let authMode: AWSAuthorizationType? let source: String - init(identifiers: [LazyReferenceIdentifier], apiName: String?, source: String = ModelProviderRegistry.DecoderSource.appSync) { + init(identifiers: [LazyReferenceIdentifier], + apiName: String?, + authMode: AWSAuthorizationType?, + source: String = ModelProviderRegistry.DecoderSource.appSync) { self.identifiers = identifiers self.apiName = apiName + self.authMode = authMode self.source = source } } diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelMetadata.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelMetadata.swift index d03f8623ac..20f0b88dd0 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelMetadata.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelMetadata.swift @@ -7,6 +7,7 @@ import Amplify import Foundation +import AWSPluginsCore /// Holds the methods to traverse and maniupulate the response data object by injecting public struct AppSyncModelMetadataUtils { @@ -25,15 +26,17 @@ public struct AppSyncModelMetadataUtils { } static func addMetadata(toModelArray graphQLDataArray: [JSONValue], - apiName: String?) -> [JSONValue] { + apiName: String?, + authMode: AWSAuthorizationType?) -> [JSONValue] { return graphQLDataArray.map { (graphQLData) -> JSONValue in - addMetadata(toModel: graphQLData, apiName: apiName) + addMetadata(toModel: graphQLData, apiName: apiName, authMode: authMode) } } static func addMetadata( toModel graphQLData: JSONValue, apiName: String?, + authMode: AWSAuthorizationType?, source: String = ModelProviderRegistry.DecoderSource.appSync) -> JSONValue { guard case var .object(modelJSON) = graphQLData else { @@ -89,6 +92,7 @@ public struct AppSyncModelMetadataUtils { if let modelIdentifierMetadata = createModelIdentifierMetadata(associatedModelType, modelObject: modelObject, apiName: apiName, + authMode: authMode, source: source) { if let serializedMetadata = try? encoder.encode(modelIdentifierMetadata), let metadataJSON = try? decoder.decode(JSONValue.self, from: serializedMetadata) { @@ -104,7 +108,9 @@ public struct AppSyncModelMetadataUtils { // add metadata to its fields, to create not loaded LazyReference objects // only if the model type allowsfor lazy loading functionality else if associatedModelType.rootPath != nil { - let nestedModelWithMetadata = addMetadata(toModel: nestedModelJSON, apiName: apiName) + let nestedModelWithMetadata = addMetadata(toModel: nestedModelJSON, + apiName: apiName, + authMode: authMode) modelJSON.updateValue(nestedModelWithMetadata, forKey: modelField.name) } // otherwise do nothing to the data. @@ -120,7 +126,8 @@ public struct AppSyncModelMetadataUtils { if modelJSON[modelField.name] == nil { let appSyncModelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: identifiers, appSyncAssociatedFields: modelField.associatedFieldNames, - apiName: apiName) + apiName: apiName, + authMode: authMode) if let serializedMetadata = try? encoder.encode(appSyncModelMetadata), let metadataJSON = try? decoder.decode(JSONValue.self, from: serializedMetadata) { log.verbose("Adding [\(modelField.name): \(metadataJSON)]") @@ -141,13 +148,16 @@ public struct AppSyncModelMetadataUtils { associatedModelType.rootPath != nil { for (index, item) in graphQLDataArray.enumerated() { - let modelJSON = AppSyncModelMetadataUtils.addMetadata(toModel: item, apiName: apiName) + let modelJSON = AppSyncModelMetadataUtils.addMetadata(toModel: item, + apiName: apiName, + authMode: authMode) graphQLDataArray[index] = modelJSON } graphQLDataObject["items"] = JSONValue.array(graphQLDataArray) let payload = AppSyncListPayload(graphQLData: JSONValue.object(graphQLDataObject), apiName: apiName, + authMode: authMode, variables: nil) if let serializedPayload = try? encoder.encode(payload), @@ -171,6 +181,7 @@ public struct AppSyncModelMetadataUtils { static func createModelIdentifierMetadata(_ associatedModel: Model.Type, modelObject: [String: JSONValue], apiName: String?, + authMode: AWSAuthorizationType?, source: String) -> AppSyncModelDecoder.Metadata? { let primarykeys = associatedModel.schema.primaryKey var identifiers = [LazyReferenceIdentifier]() @@ -188,6 +199,7 @@ public struct AppSyncModelMetadataUtils { return AppSyncModelDecoder.Metadata( identifiers: identifiers, apiName: apiName, + authMode: authMode, source: source) } else { return nil diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelProvider.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelProvider.swift index 680c5afd14..cdcaa16d88 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelProvider.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Core/AppSyncModelProvider.swift @@ -12,6 +12,7 @@ import AWSPluginsCore public class AppSyncModelProvider: ModelProvider { let apiName: String? + let authMode: AWSAuthorizationType? let source: String var loadedState: ModelProviderState @@ -20,12 +21,14 @@ public class AppSyncModelProvider: ModelProvider { self.loadedState = .notLoaded(identifiers: metadata.identifiers) self.apiName = metadata.apiName self.source = metadata.source + self.authMode = metadata.authMode } // Creates a "loaded" provider init(model: ModelType?) { self.loadedState = .loaded(model: model) self.apiName = nil + self.authMode = nil self.source = ModelProviderRegistry.DecoderSource.appSync } @@ -41,7 +44,8 @@ public class AppSyncModelProvider: ModelProvider { } let request = GraphQLRequest.getRequest(ModelType.self, byIdentifiers: identifiers, - apiName: apiName) + apiName: apiName, + authMode: authMode) log.verbose("Loading \(ModelType.modelName) with \(identifiers)") let graphQLResponse = try await Amplify.API.query(request: request) switch graphQLResponse { @@ -67,6 +71,7 @@ public class AppSyncModelProvider: ModelProvider { let metadata = AppSyncModelDecoder.Metadata( identifiers: identifiers ?? [], apiName: apiName, + authMode: authMode, source: source) try metadata.encode(to: encoder) diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Decode/GraphQLResponseDecoder+DecodeData.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Decode/GraphQLResponseDecoder+DecodeData.swift index ea37cc8343..425a0c46c5 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Decode/GraphQLResponseDecoder+DecodeData.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Decode/GraphQLResponseDecoder+DecodeData.swift @@ -52,22 +52,26 @@ extension GraphQLResponseDecoder { modelJSON = AppSyncModelMetadataUtils.addMetadata( toModel: item, apiName: request.apiName, + authMode: request.authMode as? AWSAuthorizationType, source: ModelProviderRegistry.DecoderSource.dataStore) } else { modelJSON = AppSyncModelMetadataUtils.addMetadata( toModel: item, - apiName: request.apiName) + apiName: request.apiName, + authMode: request.authMode as? AWSAuthorizationType) } graphQLDataArray[index] = modelJSON } graphQLDataObject["items"] = JSONValue.array(graphQLDataArray) let payload = AppSyncListPayload(graphQLData: JSONValue.object(graphQLDataObject), apiName: request.apiName, + authMode: request.authMode as? AWSAuthorizationType, variables: try getVariablesJSON()) serializedJSON = try encoder.encode(payload) } else if AppSyncModelMetadataUtils.shouldAddMetadata(toModel: graphQLData) { // 4 let modelJSON = AppSyncModelMetadataUtils.addMetadata(toModel: graphQLData, - apiName: request.apiName) + apiName: request.apiName, + authMode: request.authMode as? AWSAuthorizationType) serializedJSON = try encoder.encode(modelJSON) } else { // 5 serializedJSON = try encoder.encode(graphQLData) diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Utils/GraphQLRequest+toListQuery.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Utils/GraphQLRequest+toListQuery.swift index 130e3d4167..d023097d9d 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Utils/GraphQLRequest+toListQuery.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Support/Utils/GraphQLRequest+toListQuery.swift @@ -16,7 +16,8 @@ extension GraphQLRequest { filter: [String: Any]? = nil, limit: Int? = nil, nextToken: String? = nil, - apiName: String? = nil) -> GraphQLRequest { + apiName: String? = nil, + authMode: AWSAuthorizationType?) -> GraphQLRequest { var documentBuilder = ModelBasedGraphQLDocumentBuilder(modelSchema: modelSchema, operationType: .query) documentBuilder.add(decorator: DirectiveNameDecorator(type: .list)) @@ -29,12 +30,14 @@ extension GraphQLRequest { document: document.stringValue, variables: document.variables, responseType: responseType.self, - decodePath: document.name) + decodePath: document.name, + authMode: authMode) } static func getRequest(_ modelType: M.Type, byIdentifiers identifiers: [LazyReferenceIdentifier], - apiName: String?) -> GraphQLRequest { + apiName: String?, + authMode: AWSAuthorizationType?) -> GraphQLRequest { var documentBuilder = ModelBasedGraphQLDocumentBuilder(modelSchema: modelType.schema, operationType: .query) documentBuilder.add(decorator: DirectiveNameDecorator(type: .get)) @@ -46,6 +49,7 @@ extension GraphQLRequest { document: document.stringValue, variables: document.variables, responseType: M?.self, - decodePath: document.name) + decodePath: document.name, + authMode: authMode) } } diff --git a/AmplifyPlugins/API/Tests/APIHostApp/APIHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/API/Tests/APIHostApp/APIHostApp.xcodeproj/project.pbxproj index 2d967426e6..d8901be09c 100644 --- a/AmplifyPlugins/API/Tests/APIHostApp/APIHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/API/Tests/APIHostApp/APIHostApp.xcodeproj/project.pbxproj @@ -319,20 +319,11 @@ 681B35A52A4396F00074F369 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35A42A4396F00074F369 /* Amplify */; }; 681B35A72A4396F00074F369 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35A62A4396F00074F369 /* AWSAPIPlugin */; }; 681B35A92A4396F00074F369 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35A82A4396F00074F369 /* AWSCognitoAuthPlugin */; }; - 681B35AB2A4396F90074F369 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35AA2A4396F90074F369 /* Amplify */; }; - 681B35AD2A4396F90074F369 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35AC2A4396F90074F369 /* AWSAPIPlugin */; }; - 681B35AF2A4396F90074F369 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35AE2A4396F90074F369 /* AWSCognitoAuthPlugin */; }; - 681B35B12A4397000074F369 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35B02A4397000074F369 /* Amplify */; }; - 681B35B32A4397000074F369 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35B22A4397000074F369 /* AWSAPIPlugin */; }; - 681B35B52A4397000074F369 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35B42A4397000074F369 /* AWSCognitoAuthPlugin */; }; 681B35BA2A43970A0074F369 /* RESTWithIAMIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21698BC728899BC8004BD994 /* RESTWithIAMIntegrationTests.swift */; }; 681B35BB2A43970A0074F369 /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE6F28E7451D0000C36A /* AsyncTesting.swift */; }; 681B35BC2A43970A0074F369 /* TestConfigHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 395906B828AC4C3A004B96B1 /* TestConfigHelper.swift */; }; 681B35BD2A43970A0074F369 /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE7128E7451D0000C36A /* XCTestCase+AsyncTesting.swift */; }; 681B35BE2A43970A0074F369 /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE7028E7451D0000C36A /* AsyncExpectation.swift */; }; - 681B35C92A4397180074F369 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35C82A4397180074F369 /* Amplify */; }; - 681B35CB2A4397180074F369 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35CA2A4397180074F369 /* AWSAPIPlugin */; }; - 681B35CD2A4397180074F369 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B35CC2A4397180074F369 /* AWSCognitoAuthPlugin */; }; 681DFE7228E7451E0000C36A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE6F28E7451D0000C36A /* AsyncTesting.swift */; }; 681DFE7328E7451E0000C36A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE6F28E7451D0000C36A /* AsyncTesting.swift */; }; 681DFE7428E7451E0000C36A /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE7028E7451D0000C36A /* AsyncExpectation.swift */; }; @@ -832,9 +823,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 681B35AD2A4396F90074F369 /* AWSAPIPlugin in Frameworks */, - 681B35AB2A4396F90074F369 /* Amplify in Frameworks */, - 681B35AF2A4396F90074F369 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -842,9 +830,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 681B35B32A4397000074F369 /* AWSAPIPlugin in Frameworks */, - 681B35B12A4397000074F369 /* Amplify in Frameworks */, - 681B35B52A4397000074F369 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -852,9 +837,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 681B35CB2A4397180074F369 /* AWSAPIPlugin in Frameworks */, - 681B35C92A4397180074F369 /* Amplify in Frameworks */, - 681B35CD2A4397180074F369 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1735,9 +1717,6 @@ ); name = AWSAPIPluginFunctionalTestsWatch; packageProductDependencies = ( - 681B35AA2A4396F90074F369 /* Amplify */, - 681B35AC2A4396F90074F369 /* AWSAPIPlugin */, - 681B35AE2A4396F90074F369 /* AWSCognitoAuthPlugin */, ); productName = AWSAPIPluginFunctionalTests; productReference = 681B35892A43962D0074F369 /* AWSAPIPluginFunctionalTestsWatch.xctest */; @@ -1759,9 +1738,6 @@ ); name = AWSAPIPluginGraphQLLambdaAuthTestsWatch; packageProductDependencies = ( - 681B35B02A4397000074F369 /* Amplify */, - 681B35B22A4397000074F369 /* AWSAPIPlugin */, - 681B35B42A4397000074F369 /* AWSCognitoAuthPlugin */, ); productName = AWSAPIPluginGraphQLLambdaAuthTests; productReference = 681B35A12A4396CF0074F369 /* AWSAPIPluginGraphQLLambdaAuthTestsWatch.xctest */; @@ -1783,9 +1759,6 @@ ); name = AWSAPIPluginRESTIAMTestsWatch; packageProductDependencies = ( - 681B35C82A4397180074F369 /* Amplify */, - 681B35CA2A4397180074F369 /* AWSAPIPlugin */, - 681B35CC2A4397180074F369 /* AWSCognitoAuthPlugin */, ); productName = AWSAPIPluginRESTIAMTests; productReference = 681B35C52A43970A0074F369 /* AWSAPIPluginRESTIAMTestsWatch.xctest */; @@ -3815,42 +3788,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSCognitoAuthPlugin; }; - 681B35AA2A4396F90074F369 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 681B35AC2A4396F90074F369 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 681B35AE2A4396F90074F369 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 681B35B02A4397000074F369 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 681B35B22A4397000074F369 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 681B35B42A4397000074F369 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 681B35C82A4397180074F369 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 681B35CA2A4397180074F369 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 681B35CC2A4397180074F369 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 21E73E6328898D7800D7DB7E /* Project object */; diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListDecoderTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListDecoderTests.swift index 0ce8f19840..87b2917b08 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListDecoderTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListDecoderTests.swift @@ -42,7 +42,7 @@ class AppSyncListDecoderTests: XCTestCase { ], "nextToken": "nextToken" ] - let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: nil, variables: nil) + let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: nil, authMode: nil, variables: nil) let data = try encoder.encode(appSyncPayload) let harness = try decoder.decode(AppSyncListDecoderHarness.self, from: data) @@ -70,7 +70,7 @@ class AppSyncListDecoderTests: XCTestCase { ], "nextToken": "nextToken" ] - let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: nil, variables: nil) + let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: nil, authMode: nil, variables: nil) let data = try encoder.encode(appSyncPayload) let result = try decoder.decode(AppSyncListDecoderHarness.self, from: data) XCTAssertNil(result.listProvider) @@ -79,7 +79,8 @@ class AppSyncListDecoderTests: XCTestCase { func testShouldDecodeFromModelMetadata() throws { let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let data = try encoder.encode(modelMetadata) let harness = try decoder.decode(AppSyncListDecoderHarness.self, from: data) XCTAssertNotNil(harness.listProvider) diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListPayloadTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListPayloadTests.swift index 86fd5f1e6c..51fac4dac3 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListPayloadTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListPayloadTests.swift @@ -22,6 +22,7 @@ class AppSyncListPayloadTests: XCTestCase { ] let payload = AppSyncListPayload(graphQLData: JSONValue.null, apiName: "apiName", + authMode: nil, variables: variables) guard let limit = payload.limit else { @@ -51,7 +52,8 @@ class AppSyncListPayloadTests: XCTestCase { "missingLimit": 500 ] let payload = AppSyncListPayload(graphQLData: JSONValue.null, - apiName: "apiName", + apiName: "apiName", + authMode: nil, variables: variables) XCTAssertNil(payload.graphQLFilter) @@ -60,7 +62,8 @@ class AppSyncListPayloadTests: XCTestCase { func testRetrieveNilFilterAndLimit_MissingVariables() { let payload = AppSyncListPayload(graphQLData: JSONValue.null, - apiName: "apiName", + apiName: "apiName", + authMode: nil, variables: nil) XCTAssertNil(payload.graphQLFilter) diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderPaginationTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderPaginationTests.swift index 47710842e3..57843d9c92 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderPaginationTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderPaginationTests.swift @@ -36,7 +36,8 @@ extension AppSyncListProviderTests { func testNotLoadedStateHasNextPageFalse() { let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -109,13 +110,16 @@ extension AppSyncListProviderTests { func testLoadedStateGetNextPageFailure_GraphQLErrorResponse() async { mockAPIPlugin.responders[.queryRequestResponse] = - QueryRequestResponder> { _ in + QueryRequestResponder> { request in + + XCTAssertEqual(request.apiName, "apiName") + XCTAssertEqual(request.authMode as? AWSAuthorizationType, .amazonCognitoUserPools) let event: GraphQLOperation>.OperationResult = .success( .failure(GraphQLResponseError.error([GraphQLError]()))) return event } let elements = [Comment4(content: "content")] - let provider = AppSyncListProvider(elements: elements, nextToken: "nextToken") + let provider = AppSyncListProvider(elements: elements, nextToken: "nextToken", apiName: "apiName", authMode: .amazonCognitoUserPools) guard case .loaded = provider.loadedState else { XCTFail("Should be loaded") return @@ -138,7 +142,8 @@ extension AppSyncListProviderTests { func testNotLoadedStateGetNextPageFailure() async { let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderTests.swift index 0116c9c206..1e02c9beaf 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListProviderTests.swift @@ -59,7 +59,10 @@ class AppSyncListProviderTests: XCTestCase { ], "limit": 500 ] - let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: "apiName", variables: variables) + let appSyncPayload = AppSyncListPayload(graphQLData: json, + apiName: "apiName", + authMode: nil, + variables: variables) let provider = try AppSyncListProvider(payload: appSyncPayload) guard case .loaded(let elements, let nextToken, let filter) = provider.loadedState else { XCTFail("Should be in loaded state") @@ -82,7 +85,10 @@ class AppSyncListProviderTests: XCTestCase { ], "nextToken": "nextToken" ] - let appSyncPayload = AppSyncListPayload(graphQLData: json, apiName: nil, variables: nil) + let appSyncPayload = AppSyncListPayload(graphQLData: json, + apiName: nil, + authMode: nil, + variables: nil) do { _ = try AppSyncListProvider(payload: appSyncPayload) } catch _ as DecodingError { @@ -95,7 +101,8 @@ class AppSyncListProviderTests: XCTestCase { func testInitWithModelMetadataShouldBeNotLoadedState() throws { let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded(let associatedIdentifiers, let associatedFields) = provider.loadedState else { XCTFail("Should be in not loaded state") @@ -120,7 +127,9 @@ class AppSyncListProviderTests: XCTestCase { func testNotLoadedStateLoadSuccess() async throws { mockAPIPlugin.responders[.queryRequestResponse] = - QueryRequestResponder { _ in + QueryRequestResponder { request in + XCTAssertEqual(request.apiName, "apiName") + XCTAssertEqual(request.authMode as? AWSAuthorizationType, .amazonCognitoUserPools) let json: JSONValue = [ "items": [ [ @@ -138,7 +147,8 @@ class AppSyncListProviderTests: XCTestCase { } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: .amazonCognitoUserPools) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -175,7 +185,8 @@ class AppSyncListProviderTests: XCTestCase { } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -222,7 +233,8 @@ class AppSyncListProviderTests: XCTestCase { } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -259,7 +271,8 @@ class AppSyncListProviderTests: XCTestCase { } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -294,8 +307,9 @@ class AppSyncListProviderTests: XCTestCase { return event } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], - appSyncAssociatedFields: ["post"], - apiName: "apiName") + appSyncAssociatedFields: ["post"], + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") @@ -344,7 +358,8 @@ class AppSyncListProviderTests: XCTestCase { } let modelMetadata = AppSyncListDecoder.Metadata(appSyncAssociatedIdentifiers: ["postId"], appSyncAssociatedFields: ["post"], - apiName: "apiName") + apiName: "apiName", + authMode: nil) let provider = AppSyncListProvider(metadata: modelMetadata) guard case .notLoaded = provider.loadedState else { XCTFail("Should not be loaded") diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListResponseTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListResponseTests.swift index 26ffd3c4e6..37910a8fc9 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListResponseTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncListResponseTests.swift @@ -38,7 +38,8 @@ class AppSyncListResponseTests: XCTestCase { ] let listResponse = try AppSyncListResponse.initWithMetadata(type: Post4.self, graphQLData: graphQLData, - apiName: "apiName") + apiName: "apiName", + authMode: nil) XCTAssertEqual(listResponse.items.count, 2) XCTAssertEqual(listResponse.nextToken, "nextToken") @@ -59,8 +60,9 @@ class AppSyncListResponseTests: XCTestCase { ] ] let listResponse = try AppSyncListResponse.initWithMetadata(type: Comment4.self, - graphQLData: graphQLData, - apiName: "apiName") + graphQLData: graphQLData, + apiName: "apiName", + authMode: nil) XCTAssertEqual(listResponse.items.count, 2) XCTAssertNil(listResponse.nextToken) diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncModelMetadataTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncModelMetadataTests.swift index 8f1f3a40a4..f2ca4b3148 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncModelMetadataTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Core/AppSyncModelMetadataTests.swift @@ -54,19 +54,23 @@ class ModelMetadataTests: XCTestCase { "__typename": "Post4" ] ] - let posts = AppSyncModelMetadataUtils.addMetadata(toModelArray: jsonArray, apiName: "apiName") + let posts = AppSyncModelMetadataUtils.addMetadata(toModelArray: jsonArray, + apiName: "apiName", + authMode: .amazonCognitoUserPools) XCTAssertEqual(posts.count, 2) for post in posts { guard case .object(let associationData) = post["comments"], case .array(let associatedFields) = associationData["appSyncAssociatedFields"], case .array(let associatedIdentifiers) = associationData["appSyncAssociatedIdentifiers"], - case .string(let apiName) = associationData["apiName"] else { + case .string(let apiName) = associationData["apiName"], + case .string(let authMode) = associationData["authMode"] else { XCTFail("Missing association metadata for comments") return } XCTAssertEqual(associatedIdentifiers[0], "postId") XCTAssertEqual(associatedFields, ["post"]) XCTAssertEqual(apiName, "apiName") + XCTAssertEqual(authMode, "AMAZON_COGNITO_USER_POOLS") } } @@ -77,22 +81,24 @@ class ModelMetadataTests: XCTestCase { "__typename": "Post4" ] - let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: .apiKey) guard case .object(let associationData) = post["comments"], case .array(let associatedFields) = associationData["appSyncAssociatedFields"], case .array(let associatedIdentifiers) = associationData["appSyncAssociatedIdentifiers"], - case .string(let apiName) = associationData["apiName"] else { + case .string(let apiName) = associationData["apiName"], + case .string(let authMode) = associationData["authMode"] else { XCTFail("Missing association metadata for comments") return } XCTAssertEqual(associatedIdentifiers[0], "postId") XCTAssertEqual(associatedFields, ["post"]) XCTAssertEqual(apiName, "apiName") + XCTAssertEqual(authMode, "API_KEY") } func testAddMetadataToModelNoOp_NotAnObject() { let json: JSONValue = "notAnObject" - let result = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let result = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: nil) XCTAssertEqual(result, "notAnObject") } @@ -102,7 +108,7 @@ class ModelMetadataTests: XCTestCase { "title": JSONValue.init(stringLiteral: "title") ] - let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: nil) guard case .object(let postObject) = post, case .string = postObject["id"], case .string = postObject["title"] else { @@ -119,7 +125,7 @@ class ModelMetadataTests: XCTestCase { "__typename": "InvalidModelName" ] - let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: nil) guard case .object(let postObject) = post, case .string = postObject["id"], case .string = postObject["title"], @@ -136,7 +142,7 @@ class ModelMetadataTests: XCTestCase { "__typename": "Post4" ] - let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: nil) guard case .object(let postObject) = post, case .string = postObject["title"], case .string = postObject["__typename"] else { @@ -159,7 +165,7 @@ class ModelMetadataTests: XCTestCase { ] ] - let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName") + let post = AppSyncModelMetadataUtils.addMetadata(toModel: json, apiName: "apiName", authMode: nil) guard case .object(let associationData) = post["comments"], associationData["appSyncAssociatedField"] == nil, associationData["appSyncAssociatedIdentifiers"] == nil, diff --git a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Support/Utils/GraphQLRequestToListQueryTests.swift b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Support/Utils/GraphQLRequestToListQueryTests.swift index 955a1cf286..783ceb0c0c 100644 --- a/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Support/Utils/GraphQLRequestToListQueryTests.swift +++ b/AmplifyPlugins/API/Tests/AWSAPIPluginTests/Support/Utils/GraphQLRequestToListQueryTests.swift @@ -28,7 +28,8 @@ class GraphQLRequestToListQueryTests: XCTestCase { modelSchema: Comment4.schema, filter: predicate.graphQLFilter(for: Comment4.schema), limit: 1_000, - apiName: "apiName") + apiName: "apiName", + authMode: .awsIAM) XCTAssertNotNil(request) let expectedDocument = """ query ListComment4s($filter: ModelComment4FilterInput, $limit: Int) { @@ -50,6 +51,7 @@ class GraphQLRequestToListQueryTests: XCTestCase { XCTAssertEqual(request.document, expectedDocument) XCTAssertEqual(request.decodePath, "listComment4s") XCTAssertEqual(request.apiName, "apiName") + XCTAssertEqual(request.authMode as? AWSAuthorizationType, .awsIAM) guard let variables = request.variables else { XCTFail("The document doesn't contain variables") return @@ -76,7 +78,8 @@ class GraphQLRequestToListQueryTests: XCTestCase { let request = GraphQLRequest.listQuery(responseType: List.self, modelSchema: Comment4.schema, nextToken: "nextToken", - apiName: "apiName") + apiName: "apiName", + authMode: .amazonCognitoUserPools) XCTAssertNotNil(request) let expectedDocument = """ query ListComment4s($limit: Int, $nextToken: String) { @@ -98,6 +101,7 @@ class GraphQLRequestToListQueryTests: XCTestCase { XCTAssertEqual(request.document, expectedDocument) XCTAssertEqual(request.decodePath, "listComment4s") XCTAssertEqual(request.apiName, "apiName") + XCTAssertEqual(request.authMode as? AWSAuthorizationType, .amazonCognitoUserPools) guard let variables = request.variables else { XCTFail("The document doesn't contain variables") return @@ -119,7 +123,8 @@ class GraphQLRequestToListQueryTests: XCTestCase { filter: previousFilter, limit: 1_000, nextToken: "nextToken", - apiName: "apiName") + apiName: "apiName", + authMode: .function) XCTAssertNotNil(request) let expectedDocument = """ query ListComment4s($filter: ModelComment4FilterInput, $limit: Int, $nextToken: String) { @@ -141,6 +146,7 @@ class GraphQLRequestToListQueryTests: XCTestCase { XCTAssertEqual(request.document, expectedDocument) XCTAssertEqual(request.decodePath, "listComment4s") XCTAssertEqual(request.apiName, "apiName") + XCTAssertEqual(request.authMode as? AWSAuthorizationType, .function) guard let variables = request.variables else { XCTFail("The document doesn't contain variables") return diff --git a/AmplifyPlugins/Analytics/Tests/AnalyticsHostApp/AnalyticsHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Analytics/Tests/AnalyticsHostApp/AnalyticsHostApp.xcodeproj/project.pbxproj index ea8650abb3..561868fad5 100644 --- a/AmplifyPlugins/Analytics/Tests/AnalyticsHostApp/AnalyticsHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Analytics/Tests/AnalyticsHostApp/AnalyticsHostApp.xcodeproj/project.pbxproj @@ -29,9 +29,6 @@ 68DBE9592A3B6EAE002B73E3 /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9737697229519DEC0074B63A /* XCTestCase+AsyncTesting.swift */; }; 68DBE95A2A3B6EAE002B73E3 /* AWSPinpointAnalyticsPluginIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6857647828AE95ED000CE2E9 /* AWSPinpointAnalyticsPluginIntegrationTests.swift */; }; 68DBE95B2A3B6EAE002B73E3 /* TestConfigHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6857648828AE9951000CE2E9 /* TestConfigHelper.swift */; }; - 68DBE9662A3B6F2A002B73E3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68DBE9652A3B6F2A002B73E3 /* Amplify */; }; - 68DBE9682A3B6F2A002B73E3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68DBE9672A3B6F2A002B73E3 /* AWSCognitoAuthPlugin */; }; - 68DBE96A2A3B6F2A002B73E3 /* AWSPinpointAnalyticsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68DBE9692A3B6F2A002B73E3 /* AWSPinpointAnalyticsPlugin */; }; 9737697629519E050074B63A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9737697029519DEC0074B63A /* AsyncTesting.swift */; }; 9737697729519E050074B63A /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9737697129519DEC0074B63A /* AsyncExpectation.swift */; }; 9737697829519E050074B63A /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9737697229519DEC0074B63A /* XCTestCase+AsyncTesting.swift */; }; @@ -134,9 +131,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68DBE9662A3B6F2A002B73E3 /* Amplify in Frameworks */, - 68DBE96A2A3B6F2A002B73E3 /* AWSPinpointAnalyticsPlugin in Frameworks */, - 68DBE9682A3B6F2A002B73E3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -332,9 +326,6 @@ ); name = AWSPinpointAnalyticsPluginIntegrationTestsWatch; packageProductDependencies = ( - 68DBE9652A3B6F2A002B73E3 /* Amplify */, - 68DBE9672A3B6F2A002B73E3 /* AWSCognitoAuthPlugin */, - 68DBE9692A3B6F2A002B73E3 /* AWSPinpointAnalyticsPlugin */, ); productName = AWSPinpointAnalyticsPluginIntegrationTests; productReference = 68DBE9622A3B6EAE002B73E3 /* AWSPinpointAnalyticsPluginIntegrationTestsWatch.xctest */; @@ -1118,18 +1109,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSPinpointAnalyticsPlugin; }; - 68DBE9652A3B6F2A002B73E3 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68DBE9672A3B6F2A002B73E3 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68DBE9692A3B6F2A002B73E3 /* AWSPinpointAnalyticsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPinpointAnalyticsPlugin; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 6857645428AE94D9000CE2E9 /* Project object */; diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/hierarchical-state-machine-swift/CancellableAsyncStream.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/hierarchical-state-machine-swift/CancellableAsyncStream.swift index 35ce4b65c1..e25c67408f 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/hierarchical-state-machine-swift/CancellableAsyncStream.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/hierarchical-state-machine-swift/CancellableAsyncStream.swift @@ -23,14 +23,14 @@ class CancellableAsyncStream: AsyncSequence { } convenience init(with publisher: AnyPublisher) { - var cancellable: AnyCancellable? - self.init(asyncStream: AsyncStream { continuation in - cancellable = publisher.sink { _ in - continuation.finish() - } receiveValue: { - continuation.yield($0) - } - }, cancellable: cancellable) + let (asyncStream, contiuation) = AsyncStream.makeStream(of: Element.self) + let cancellable = publisher.sink { _ in + contiuation.finish() + } receiveValue: { + contiuation.yield($0) + } + + self.init(asyncStream: asyncStream, cancellable: cancellable) } func makeAsyncIterator() -> AsyncStream.AsyncIterator { diff --git a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj index 5d10a33c39..efe5f198a7 100644 --- a/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj @@ -100,8 +100,6 @@ 681B76BB2A3CBBAE004B59D9 /* AuthConfirmResetPasswordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97829202286E41FA000DE190 /* AuthConfirmResetPasswordTests.swift */; }; 681B76BC2A3CBBAE004B59D9 /* AuthDeleteUserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4821B2F1286B5F74000EC1D7 /* AuthDeleteUserTests.swift */; }; 681B76BF2A3CBBAE004B59D9 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 485CB5AE27B61EAA006CCEC7 /* README.md */; }; - 681B76C62A3CBE11004B59D9 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681B76C52A3CBE11004B59D9 /* Amplify */; }; - 681B76C82A3CBE11004B59D9 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681B76C72A3CBE11004B59D9 /* AWSCognitoAuthPlugin */; }; 681DFEAB28E747B80000C36A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEA828E747B80000C36A /* AsyncTesting.swift */; }; 681DFEAC28E747B80000C36A /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEA928E747B80000C36A /* AsyncExpectation.swift */; }; 681DFEAD28E747B80000C36A /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEAA28E747B80000C36A /* XCTestCase+AsyncTesting.swift */; }; @@ -257,8 +255,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 681B76C62A3CBE11004B59D9 /* Amplify in Frameworks */, - 681B76C82A3CBE11004B59D9 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -591,8 +587,6 @@ ); name = AuthIntegrationTestsWatch; packageProductDependencies = ( - 681B76C52A3CBE11004B59D9 /* Amplify */, - 681B76C72A3CBE11004B59D9 /* AWSCognitoAuthPlugin */, ); productName = AuthIntegrationTests; productReference = 681B76C42A3CBBAE004B59D9 /* AuthIntegrationTestsWatch.xctest */; @@ -1481,14 +1475,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSCognitoAuthPlugin; }; - 681B76C52A3CBE11004B59D9 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 681B76C72A3CBE11004B59D9 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; B4B9F45728F47C0A004F346F /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; diff --git a/AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthorizationType.swift b/AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthorizationType.swift index 465cc35337..10e03c70a9 100644 --- a/AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthorizationType.swift +++ b/AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthorizationType.swift @@ -46,6 +46,8 @@ public enum AWSAuthorizationType: String, AuthorizationMode { extension AWSAuthorizationType: CaseIterable { } +extension AWSAuthorizationType: Codable { } + /// Indicates whether the authotization type requires the auth plugin to operate. extension AWSAuthorizationType { public var requiresAuthPlugin: Bool { diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/project.pbxproj index f6fd20640b..034c36dfdf 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/project.pbxproj @@ -640,10 +640,6 @@ 681DFE9628E746FE0000C36A /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE8128E746C10000C36A /* AsyncExpectation.swift */; }; 681DFE9728E746FE0000C36A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFE8028E746C10000C36A /* AsyncTesting.swift */; }; 682D184B2A43DEF400BD034E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 682D184A2A43DEF400BD034E /* XCTest.framework */; }; - 682D184D2A43DF9E00BD034E /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 682D184C2A43DF9E00BD034E /* Amplify */; }; - 682D184F2A43DFB700BD034E /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 682D184E2A43DFB700BD034E /* AWSAPIPlugin */; }; - 682D18512A43DFB700BD034E /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 682D18502A43DFB700BD034E /* AWSCognitoAuthPlugin */; }; - 682D18532A43DFB700BD034E /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 682D18522A43DFB700BD034E /* AWSDataStorePlugin */; }; 68826CD12A439C2F005E85A7 /* DataStoreHostAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2118212F289BFB4B001B5945 /* DataStoreHostAppApp.swift */; }; 68826CD22A439C2F005E85A7 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21182131289BFB4B001B5945 /* ContentView.swift */; }; 68826CD42A43A149005E85A7 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68826CD32A43A149005E85A7 /* Amplify */; }; @@ -1018,22 +1014,6 @@ 68826E782A43A1DB005E85A7 /* AWSDataStoreCategoryPluginAuthIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFA92289BFE4E00B32A39 /* AWSDataStoreCategoryPluginAuthIntegrationTests.swift */; }; 68826E792A43A1DB005E85A7 /* TodoCustomOwnerImplicit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFA9C289BFE4E00B32A39 /* TodoCustomOwnerImplicit.swift */; }; 68826E7A2A43A1DB005E85A7 /* AWSDataStoreCategoryPluginAuthOwnerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFAA0289BFE4E00B32A39 /* AWSDataStoreCategoryPluginAuthOwnerIntegrationTests.swift */; }; - 68826E852A43A224005E85A7 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E842A43A224005E85A7 /* Amplify */; }; - 68826E872A43A224005E85A7 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E862A43A224005E85A7 /* AWSAPIPlugin */; }; - 68826E892A43A224005E85A7 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E882A43A224005E85A7 /* AWSCognitoAuthPlugin */; }; - 68826E8B2A43A224005E85A7 /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E8A2A43A224005E85A7 /* AWSDataStorePlugin */; }; - 68826E8F2A43A238005E85A7 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E8E2A43A238005E85A7 /* Amplify */; }; - 68826E912A43A238005E85A7 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E902A43A238005E85A7 /* AWSAPIPlugin */; }; - 68826E932A43A238005E85A7 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E922A43A238005E85A7 /* AWSCognitoAuthPlugin */; }; - 68826E952A43A238005E85A7 /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E942A43A238005E85A7 /* AWSDataStorePlugin */; }; - 68826E992A43A251005E85A7 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E982A43A251005E85A7 /* Amplify */; }; - 68826E9B2A43A251005E85A7 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E9A2A43A251005E85A7 /* AWSAPIPlugin */; }; - 68826E9D2A43A251005E85A7 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E9C2A43A251005E85A7 /* AWSCognitoAuthPlugin */; }; - 68826E9F2A43A251005E85A7 /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826E9E2A43A251005E85A7 /* AWSDataStorePlugin */; }; - 68826EAD2A43A280005E85A7 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68826EAC2A43A280005E85A7 /* Amplify */; }; - 68826EAF2A43A280005E85A7 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826EAE2A43A280005E85A7 /* AWSAPIPlugin */; }; - 68826EB12A43A280005E85A7 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826EB02A43A280005E85A7 /* AWSCognitoAuthPlugin */; }; - 68826EB32A43A280005E85A7 /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68826EB22A43A280005E85A7 /* AWSDataStorePlugin */; }; 68E9EB1D2A448C23001F713D /* Record.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFCC4289C06E300B32A39 /* Record.swift */; }; 68E9EB1E2A448C23001F713D /* PostEditor5+Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFCF3289C06E300B32A39 /* PostEditor5+Schema.swift */; }; 68E9EB1F2A448C23001F713D /* UserFollowers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFC95289C06E300B32A39 /* UserFollowers.swift */; }; @@ -1313,14 +1293,6 @@ 68E9EC3C2A448C47001F713D /* PrivatePrivateUPIAMPost+Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFAD9289BFE4E00B32A39 /* PrivatePrivateUPIAMPost+Schema.swift */; }; 68E9EC3D2A448C47001F713D /* GroupUPPost+Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFAAA289BFE4E00B32A39 /* GroupUPPost+Schema.swift */; }; 68E9EC3E2A448C47001F713D /* AWSDataStoreMultiAuthSingleRuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BBFAA4289BFE4E00B32A39 /* AWSDataStoreMultiAuthSingleRuleTests.swift */; }; - 68E9EC4B2A448C87001F713D /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC4A2A448C87001F713D /* Amplify */; }; - 68E9EC4D2A448C87001F713D /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC4C2A448C87001F713D /* AWSAPIPlugin */; }; - 68E9EC4F2A448C87001F713D /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC4E2A448C87001F713D /* AWSCognitoAuthPlugin */; }; - 68E9EC512A448C87001F713D /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC502A448C87001F713D /* AWSDataStorePlugin */; }; - 68E9EC532A448C8D001F713D /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC522A448C8D001F713D /* Amplify */; }; - 68E9EC552A448C8D001F713D /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC542A448C8D001F713D /* AWSAPIPlugin */; }; - 68E9EC572A448C8D001F713D /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC562A448C8D001F713D /* AWSCognitoAuthPlugin */; }; - 68E9EC592A448C8D001F713D /* AWSDataStorePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68E9EC582A448C8D001F713D /* AWSDataStorePlugin */; }; 970333C5295C5B160019981E /* DataStoreStressBaseTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970333C4295C5B160019981E /* DataStoreStressBaseTest.swift */; }; 970333E3295CCE490019981E /* AmplifyModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970333DF295CCE490019981E /* AmplifyModels.swift */; }; 970333E4295CCE490019981E /* PostStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970333E0295CCE490019981E /* PostStatus.swift */; }; @@ -2352,10 +2324,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68826E872A43A224005E85A7 /* AWSAPIPlugin in Frameworks */, - 68826E852A43A224005E85A7 /* Amplify in Frameworks */, - 68826E892A43A224005E85A7 /* AWSCognitoAuthPlugin in Frameworks */, - 68826E8B2A43A224005E85A7 /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2363,10 +2331,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68826E912A43A238005E85A7 /* AWSAPIPlugin in Frameworks */, - 68826E8F2A43A238005E85A7 /* Amplify in Frameworks */, - 68826E932A43A238005E85A7 /* AWSCognitoAuthPlugin in Frameworks */, - 68826E952A43A238005E85A7 /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2374,10 +2338,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68826E9B2A43A251005E85A7 /* AWSAPIPlugin in Frameworks */, - 68826E992A43A251005E85A7 /* Amplify in Frameworks */, - 68826E9D2A43A251005E85A7 /* AWSCognitoAuthPlugin in Frameworks */, - 68826E9F2A43A251005E85A7 /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2385,10 +2345,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 682D184F2A43DFB700BD034E /* AWSAPIPlugin in Frameworks */, - 682D184D2A43DF9E00BD034E /* Amplify in Frameworks */, - 682D18512A43DFB700BD034E /* AWSCognitoAuthPlugin in Frameworks */, - 682D18532A43DFB700BD034E /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2396,10 +2352,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68826EAF2A43A280005E85A7 /* AWSAPIPlugin in Frameworks */, - 68826EAD2A43A280005E85A7 /* Amplify in Frameworks */, - 68826EB12A43A280005E85A7 /* AWSCognitoAuthPlugin in Frameworks */, - 68826EB32A43A280005E85A7 /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2407,10 +2359,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68E9EC4D2A448C87001F713D /* AWSAPIPlugin in Frameworks */, - 68E9EC4B2A448C87001F713D /* Amplify in Frameworks */, - 68E9EC4F2A448C87001F713D /* AWSCognitoAuthPlugin in Frameworks */, - 68E9EC512A448C87001F713D /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2418,10 +2366,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68E9EC552A448C8D001F713D /* AWSAPIPlugin in Frameworks */, - 68E9EC532A448C8D001F713D /* Amplify in Frameworks */, - 68E9EC572A448C8D001F713D /* AWSCognitoAuthPlugin in Frameworks */, - 68E9EC592A448C8D001F713D /* AWSDataStorePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4256,10 +4200,6 @@ ); name = AWSDataStorePluginAuthIAMTestsWatch; packageProductDependencies = ( - 68826E842A43A224005E85A7 /* Amplify */, - 68826E862A43A224005E85A7 /* AWSAPIPlugin */, - 68826E882A43A224005E85A7 /* AWSCognitoAuthPlugin */, - 68826E8A2A43A224005E85A7 /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginAuthIAMTests; productReference = 68826CEF2A43A1B0005E85A7 /* AWSDataStorePluginAuthIAMTestsWatch.xctest */; @@ -4281,10 +4221,6 @@ ); name = AWSDataStorePluginCPKTestsWatch; packageProductDependencies = ( - 68826E8E2A43A238005E85A7 /* Amplify */, - 68826E902A43A238005E85A7 /* AWSAPIPlugin */, - 68826E922A43A238005E85A7 /* AWSCognitoAuthPlugin */, - 68826E942A43A238005E85A7 /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginCPKTests; productReference = 68826D622A43A1BA005E85A7 /* AWSDataStorePluginCPKTestsWatch.xctest */; @@ -4306,10 +4242,6 @@ ); name = AWSDataStorePluginLazyLoadTestsWatch; packageProductDependencies = ( - 68826E982A43A251005E85A7 /* Amplify */, - 68826E9A2A43A251005E85A7 /* AWSAPIPlugin */, - 68826E9C2A43A251005E85A7 /* AWSCognitoAuthPlugin */, - 68826E9E2A43A251005E85A7 /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginLazyLoadTests; productReference = 68826DF92A43A1C3005E85A7 /* AWSDataStorePluginLazyLoadTestsWatch.xctest */; @@ -4331,10 +4263,6 @@ ); name = AWSDataStorePluginV2TestsWatch; packageProductDependencies = ( - 682D184C2A43DF9E00BD034E /* Amplify */, - 682D184E2A43DFB700BD034E /* AWSAPIPlugin */, - 682D18502A43DFB700BD034E /* AWSCognitoAuthPlugin */, - 682D18522A43DFB700BD034E /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginV2Tests; productReference = 68826E642A43A1D1005E85A7 /* AWSDataStorePluginV2TestsWatch.xctest */; @@ -4356,10 +4284,6 @@ ); name = AWSDataStorePluginAuthCognitoTestsWatch; packageProductDependencies = ( - 68826EAC2A43A280005E85A7 /* Amplify */, - 68826EAE2A43A280005E85A7 /* AWSAPIPlugin */, - 68826EB02A43A280005E85A7 /* AWSCognitoAuthPlugin */, - 68826EB22A43A280005E85A7 /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginAuthCognitoTests; productReference = 68826E812A43A1DB005E85A7 /* AWSDataStorePluginAuthCognitoTestsWatch.xctest */; @@ -4381,10 +4305,6 @@ ); name = AWSDataStorePluginIntegrationTestsWatch; packageProductDependencies = ( - 68E9EC4A2A448C87001F713D /* Amplify */, - 68E9EC4C2A448C87001F713D /* AWSAPIPlugin */, - 68E9EC4E2A448C87001F713D /* AWSCognitoAuthPlugin */, - 68E9EC502A448C87001F713D /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginIntegrationTests; productReference = 68E9EBFA2A448C23001F713D /* AWSDataStorePluginIntegrationTestsWatch.xctest */; @@ -4406,10 +4326,6 @@ ); name = AWSDataStorePluginMultiAuthTestsWatch; packageProductDependencies = ( - 68E9EC522A448C8D001F713D /* Amplify */, - 68E9EC542A448C8D001F713D /* AWSAPIPlugin */, - 68E9EC562A448C8D001F713D /* AWSCognitoAuthPlugin */, - 68E9EC582A448C8D001F713D /* AWSDataStorePlugin */, ); productName = AWSDataStorePluginMultiAuthTests; productReference = 68E9EC452A448C47001F713D /* AWSDataStorePluginMultiAuthTestsWatch.xctest */; @@ -7651,22 +7567,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSDataStorePlugin; }; - 682D184C2A43DF9E00BD034E /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 682D184E2A43DFB700BD034E /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 682D18502A43DFB700BD034E /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 682D18522A43DFB700BD034E /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; 68826CD32A43A149005E85A7 /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; @@ -7683,102 +7583,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSDataStorePlugin; }; - 68826E842A43A224005E85A7 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68826E862A43A224005E85A7 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68826E882A43A224005E85A7 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68826E8A2A43A224005E85A7 /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; - 68826E8E2A43A238005E85A7 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68826E902A43A238005E85A7 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68826E922A43A238005E85A7 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68826E942A43A238005E85A7 /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; - 68826E982A43A251005E85A7 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68826E9A2A43A251005E85A7 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68826E9C2A43A251005E85A7 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68826E9E2A43A251005E85A7 /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; - 68826EAC2A43A280005E85A7 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68826EAE2A43A280005E85A7 /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68826EB02A43A280005E85A7 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68826EB22A43A280005E85A7 /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; - 68E9EC4A2A448C87001F713D /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68E9EC4C2A448C87001F713D /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68E9EC4E2A448C87001F713D /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68E9EC502A448C87001F713D /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; - 68E9EC522A448C8D001F713D /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 68E9EC542A448C8D001F713D /* AWSAPIPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSAPIPlugin; - }; - 68E9EC562A448C8D001F713D /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 68E9EC582A448C8D001F713D /* AWSDataStorePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSDataStorePlugin; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 21182124289BFB4B001B5945 /* Project object */; diff --git a/AmplifyPlugins/Geo/Tests/GeoHostApp/GeoHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Geo/Tests/GeoHostApp/GeoHostApp.xcodeproj/project.pbxproj index d5fc06bfce..7bd83879ae 100644 --- a/AmplifyPlugins/Geo/Tests/GeoHostApp/GeoHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Geo/Tests/GeoHostApp/GeoHostApp.xcodeproj/project.pbxproj @@ -22,9 +22,6 @@ 685777FE2A3CC0D8001CE5C1 /* AWSLocationGeoPluginIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97DB824628233A1D00FC2228 /* AWSLocationGeoPluginIntegrationTests.swift */; }; 685777FF2A3CC0D8001CE5C1 /* TestConfigHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97DB82542823466800FC2228 /* TestConfigHelper.swift */; }; 685778022A3CC0D8001CE5C1 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 97DB8244282339D200FC2228 /* README.md */; }; - 6857780B2A3CC0ED001CE5C1 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 6857780A2A3CC0ED001CE5C1 /* Amplify */; }; - 6857780D2A3CC0ED001CE5C1 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6857780C2A3CC0ED001CE5C1 /* AWSCognitoAuthPlugin */; }; - 6857780F2A3CC0ED001CE5C1 /* AWSLocationGeoPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6857780E2A3CC0ED001CE5C1 /* AWSLocationGeoPlugin */; }; 685778102A3CC1F4001CE5C1 /* GeoHostAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AD223128230B98001AFCC1 /* GeoHostAppApp.swift */; }; 685778112A3CC1F9001CE5C1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AD223328230B98001AFCC1 /* ContentView.swift */; }; 978B1D6429515FFB0079E55A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 978B1D5E29515DEF0079E55A /* AsyncTesting.swift */; }; @@ -124,9 +121,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6857780F2A3CC0ED001CE5C1 /* AWSLocationGeoPlugin in Frameworks */, - 6857780B2A3CC0ED001CE5C1 /* Amplify in Frameworks */, - 6857780D2A3CC0ED001CE5C1 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -308,9 +302,6 @@ ); name = AWSLocationGeoPluginIntegrationTestsWatch; packageProductDependencies = ( - 6857780A2A3CC0ED001CE5C1 /* Amplify */, - 6857780C2A3CC0ED001CE5C1 /* AWSCognitoAuthPlugin */, - 6857780E2A3CC0ED001CE5C1 /* AWSLocationGeoPlugin */, ); productName = AWSLocationGeoPluginIntegrationTests; productReference = 685778072A3CC0D8001CE5C1 /* AWSLocationGeoPluginIntegrationTestsWatch.xctest */; @@ -1177,18 +1168,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSCognitoAuthPlugin; }; - 6857780A2A3CC0ED001CE5C1 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 6857780C2A3CC0ED001CE5C1 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 6857780E2A3CC0ED001CE5C1 /* AWSLocationGeoPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSLocationGeoPlugin; - }; B44DCFA228F48EDD007FEC7C /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; diff --git a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/index.mjs b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/index.mjs index 7ce996c1ce..7283e7c862 100644 --- a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/index.mjs +++ b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/index.mjs @@ -69,6 +69,19 @@ app.post('/uninstall', async (req, res) => { } }) +app.post('/boot', async (req, res) => { + console.log("POST /boot ") + const { deviceId } = req.body + try { + const cmd = `xcrun simctl --set testing bootstatus ${deviceId} -b` + await run(cmd) + res.send("Done") + } catch (error) { + console.error("Failed to boot the device", error) + res.sendStatus(500) + } +}) + app.listen(9293, () => { console.log("Starting server") }) diff --git a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj index ddd6cfb305..7de7bad8f7 100644 --- a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj @@ -38,14 +38,10 @@ 6875F98D2A3CD258001C9AAF /* PushNotificationHostAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6084F1AE2967B87200434CBF /* PushNotificationHostAppUITests.swift */; }; 6875F98E2A3CD258001C9AAF /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6084F1C32968AA3A00434CBF /* Notification.swift */; }; 6875F9912A3CD258001C9AAF /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 6084F1BF2968A7ED00434CBF /* README.md */; }; - 6875F9992A3CD284001C9AAF /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F9982A3CD284001C9AAF /* Amplify */; }; - 6875F99B2A3CD284001C9AAF /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F99A2A3CD284001C9AAF /* AWSCognitoAuthPlugin */; }; - 6875F99D2A3CD284001C9AAF /* AWSPinpointPushNotificationsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F99C2A3CD284001C9AAF /* AWSPinpointPushNotificationsPlugin */; }; 6875F99F2A3CD31D001C9AAF /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F99E2A3CD31D001C9AAF /* Amplify */; }; 6875F9A12A3CD31D001C9AAF /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F9A02A3CD31D001C9AAF /* AWSCognitoAuthPlugin */; }; 6875F9A32A3CD31D001C9AAF /* AWSPinpointPushNotificationsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F9A22A3CD31D001C9AAF /* AWSPinpointPushNotificationsPlugin */; }; 6875F9A52A3CD37D001C9AAF /* AWSPinpointAnalyticsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F9A42A3CD37D001C9AAF /* AWSPinpointAnalyticsPlugin */; }; - 6875F9A72A3CD39C001C9AAF /* AWSPinpointAnalyticsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 6875F9A62A3CD39C001C9AAF /* AWSPinpointAnalyticsPlugin */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -137,10 +133,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6875F9992A3CD284001C9AAF /* Amplify in Frameworks */, - 6875F9A72A3CD39C001C9AAF /* AWSPinpointAnalyticsPlugin in Frameworks */, - 6875F99D2A3CD284001C9AAF /* AWSPinpointPushNotificationsPlugin in Frameworks */, - 6875F99B2A3CD284001C9AAF /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -333,10 +325,6 @@ ); name = PushNotificationWatchTests; packageProductDependencies = ( - 6875F9982A3CD284001C9AAF /* Amplify */, - 6875F99A2A3CD284001C9AAF /* AWSCognitoAuthPlugin */, - 6875F99C2A3CD284001C9AAF /* AWSPinpointPushNotificationsPlugin */, - 6875F9A62A3CD39C001C9AAF /* AWSPinpointAnalyticsPlugin */, ); productName = PushNotificationHostAppUITests; productReference = 6875F9952A3CD258001C9AAF /* PushNotificationWatchTests.xctest */; @@ -1057,18 +1045,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSPluginsCore; }; - 6875F9982A3CD284001C9AAF /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 6875F99A2A3CD284001C9AAF /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 6875F99C2A3CD284001C9AAF /* AWSPinpointPushNotificationsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPinpointPushNotificationsPlugin; - }; 6875F99E2A3CD31D001C9AAF /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; @@ -1085,10 +1061,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSPinpointAnalyticsPlugin; }; - 6875F9A62A3CD39C001C9AAF /* AWSPinpointAnalyticsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPinpointAnalyticsPlugin; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 60F60D872965040600B2D13D /* Project object */; diff --git a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/LocalServer.swift b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/LocalServer.swift index 6d7b245f70..03dc306481 100644 --- a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/LocalServer.swift +++ b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/LocalServer.swift @@ -13,6 +13,7 @@ enum LocalServer { case notifications(PinpointNotification) case uninstall(String) + case boot(String) } extension LocalServer { @@ -20,6 +21,7 @@ extension LocalServer { switch self { case .notifications: return "POST" case .uninstall: return "POST" + case .boot: return "POST" } } @@ -27,6 +29,7 @@ extension LocalServer { switch self { case .notifications: return "/notifications" case .uninstall: return "/uninstall" + case .boot: return "/boot" } } @@ -36,12 +39,14 @@ extension LocalServer { return try? JSONEncoder().encode(notification) case let .uninstall(deviceId): return try? JSONEncoder().encode(["deviceId": deviceId]) + case let .boot(deviceId): + return try? JSONEncoder().encode(["deviceId": deviceId]) } } var additionalRequestHeaders: [String: String]? { switch self { - case .notifications, .uninstall: + case .notifications, .uninstall, .boot: return ["Content-Type": "application/json"] } } diff --git a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/PushNotificationHostAppUITests.swift b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/PushNotificationHostAppUITests.swift index fbf25d42eb..21729ac2e1 100644 --- a/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/PushNotificationHostAppUITests.swift +++ b/AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/PushNotificationHostAppUITests.swift @@ -24,8 +24,10 @@ final class PushNotificationHostAppUITests: XCTestCase { return identifier }() - override func setUpWithError() throws { + @MainActor + override func setUp() async throws { continueAfterFailure = false + try await bootDevice() #if os(iOS) XCUIDevice.shared.orientation = .portrait #endif @@ -64,7 +66,12 @@ final class PushNotificationHostAppUITests: XCTestCase { let identifyUserButton = app.buttons["Identify User"] if identifyUserButton.waitForExistence(timeout: timeout) { + #if os(tvOS) + identifyUserButton.select(direction: .vertical) + #else identifyUserButton.tap() + #endif + } else { XCTFail("Failed to find 'Identify User' button") } @@ -84,7 +91,12 @@ final class PushNotificationHostAppUITests: XCTestCase { let registerDeviceButton = app.buttons["Register Device"] if registerDeviceButton.waitForExistence(timeout: timeout) { + #if os(tvOS) + registerDeviceButton.select(direction: .vertical) + #else registerDeviceButton.tap() + #endif + } else { XCTFail("Failed to find 'Register Device' button") } @@ -235,7 +247,12 @@ final class PushNotificationHostAppUITests: XCTestCase { private func initAmplify() { let initAmplifyButton = app.buttons["Init Amplify"] if initAmplifyButton.waitForExistence(timeout: timeout) { + #if os(tvOS) + initAmplifyButton.select(direction: .vertical) + #else initAmplifyButton.tap() + #endif + } else { XCTFail("Failed to find `Init Amplify` button") } @@ -249,7 +266,14 @@ final class PushNotificationHostAppUITests: XCTestCase { #endif if alert.waitForExistence(timeout: timeout) { XCTAssertTrue(anyElementContains(text: "Would Like to Send You Notifications", scope: alert).exists) + #if os(tvOS) + alert.buttons["Allow"].firstMatch.select(direction: .horizontal) + #elseif os(watchOS) + alert.swipeUp() alert.buttons["Allow"].tap() + #else + alert.buttons["Allow"].tap() + #endif } } @@ -282,6 +306,12 @@ final class PushNotificationHostAppUITests: XCTestCase { XCTAssertTrue((response as! HTTPURLResponse).statusCode < 300, "Failed to uninstall the App") } + private func bootDevice() async throws { + let request = LocalServer.boot(deviceIdentifier!).urlRequest + let (_, response) = try await URLSession.shared.data(for: request) + XCTAssertTrue((response as! HTTPURLResponse).statusCode < 300, "Failed to boot the device") + } + private func pressHomeButton() { XCUIDevice.shared.press(XCUIDevice.Button.home) let springboard = XCUIApplication.homeScreen @@ -314,18 +344,41 @@ final class PushNotificationHostAppUITests: XCTestCase { #if os(tvOS) extension XCUIElement { - func tap() { - XCUIRemote.shared.select(self) + func select(direction: Direction) { + XCUIRemote.shared.select(self, direction: direction) + } +} + +enum Direction { + case horizontal + case vertical + + func next() -> XCUIRemote.Button { + switch self { + case .horizontal: + return .right + case .vertical: + return .down + } + } + + func previous() -> XCUIRemote.Button { + switch self { + case .horizontal: + return .left + case .vertical: + return .up + } } } extension XCUIRemote { - func select(_ element: XCUIElement) { + func select(_ element: XCUIElement, direction: Direction) { let app = XCUIApplication() var isEndReached = false while !element.hasFocus { let previousElement = app.focusedElement - press(isEndReached ? .up : .down) + press(isEndReached ? direction.previous() : direction.next()) if previousElement == app.focusedElement { if isEndReached { XCTFail("Element \(element) was not found.") diff --git a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj index cdd34b7658..b8f9ed9229 100644 --- a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 6875F91E2A3CCCB7001C9AAF /* testImageLabels.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9054235F291425630000D108 /* testImageLabels.jpg */; }; 6875F91F2A3CCCB7001C9AAF /* testImageEntities.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542362291425630000D108 /* testImageEntities.jpg */; }; 6875F9202A3CCCB7001C9AAF /* testImageTextAll.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542361291425630000D108 /* testImageTextAll.jpg */; }; + 68C1547A2BE2B11A003C4CF8 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 68C154792BE2B11A003C4CF8 /* CoreMLPredictionsPlugin */; }; 902830062914027000897087 /* PredictionsHostAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 902830052914027000897087 /* PredictionsHostAppApp.swift */; }; 902830082914027000897087 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 902830072914027000897087 /* ContentView.swift */; }; 9028300A2914027100897087 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 902830092914027100897087 /* Assets.xcassets */; }; @@ -52,18 +53,6 @@ 90542370291425630000D108 /* testImageCeleb.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542363291425630000D108 /* testImageCeleb.jpg */; }; 90542371291425630000D108 /* testImageTextForms.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542364291425630000D108 /* testImageTextForms.jpg */; }; 90542372291425630000D108 /* audio.wav in Resources */ = {isa = PBXBuildFile; fileRef = 90542365291425630000D108 /* audio.wav */; }; - 90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30492AD47A71006B6FF3 /* Amplify */; }; - 90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304B2AD47A74006B6FF3 /* Amplify */; }; - 90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304D2AD47A78006B6FF3 /* Amplify */; }; - 90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */; }; - 90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */; }; - 90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */; }; - 90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */; }; - 90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */; }; - 90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */; }; - 90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */; }; - 90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */; }; - 90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -127,6 +116,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 68C1547A2BE2B11A003C4CF8 /* CoreMLPredictionsPlugin in Frameworks */, 681D7D8B2A42710F00F7C310 /* Amplify in Frameworks */, 681D7D8F2A42710F00F7C310 /* AWSPredictionsPlugin in Frameworks */, 681D7D8D2A42710F00F7C310 /* AWSCognitoAuthPlugin in Frameworks */, @@ -137,10 +127,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, - 90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */, - 90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */, - 90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -159,10 +145,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, - 90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */, - 90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */, - 90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -170,10 +152,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, - 90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */, - 90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */, - 90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -316,6 +294,7 @@ 681D7D8A2A42710F00F7C310 /* Amplify */, 681D7D8C2A42710F00F7C310 /* AWSCognitoAuthPlugin */, 681D7D8E2A42710F00F7C310 /* AWSPredictionsPlugin */, + 68C154792BE2B11A003C4CF8 /* CoreMLPredictionsPlugin */, ); productName = "NewApp Watch App"; productReference = 6875F8F02A3CCC84001C9AAF /* PredictionsWatchApp.app */; @@ -336,10 +315,6 @@ ); name = AWSPredictionsPluginIntegrationTestsWatch; packageProductDependencies = ( - 90CF304D2AD47A78006B6FF3 /* Amplify */, - 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */, - 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */, - 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */, ); productName = AWSPredictionsPluginIntegrationTests; productReference = 6875F9242A3CCCB7001C9AAF /* AWSPredictionsPluginIntegrationTestsWatch.xctest */; @@ -384,10 +359,6 @@ ); name = CoreMLPredictionsPluginIntegrationTests; packageProductDependencies = ( - 90CF30492AD47A71006B6FF3 /* Amplify */, - 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */, - 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */, - 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */, ); productName = CoreMLPredictionsPluginIntegrationTests; productReference = 90283033291402D500897087 /* CoreMLPredictionsPluginIntegrationTests.xctest */; @@ -408,10 +379,6 @@ ); name = AWSPredictionsPluginIntegrationTests; packageProductDependencies = ( - 90CF304B2AD47A74006B6FF3 /* Amplify */, - 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */, - 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */, - 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */, ); productName = AWSPredictionsPluginIntegrationTests; productReference = 903555F829141355004B83C2 /* AWSPredictionsPluginIntegrationTests.xctest */; @@ -1140,6 +1107,10 @@ isa = XCSwiftPackageProductDependency; productName = AWSPredictionsPlugin; }; + 68C154792BE2B11A003C4CF8 /* CoreMLPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = CoreMLPredictionsPlugin; + }; 9028304B2914042800897087 /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; @@ -1156,54 +1127,6 @@ isa = XCSwiftPackageProductDependency; productName = CoreMLPredictionsPlugin; }; - 90CF30492AD47A71006B6FF3 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 90CF304B2AD47A74006B6FF3 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 90CF304D2AD47A78006B6FF3 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPredictionsPlugin; - }; - 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = CoreMLPredictionsPlugin; - }; - 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPredictionsPlugin; - }; - 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = CoreMLPredictionsPlugin; - }; - 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSPredictionsPlugin; - }; - 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = CoreMLPredictionsPlugin; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 90282FFA2914027000897087 /* Project object */; diff --git a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/DefaultStorageTransferDatabaseTests.swift b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/DefaultStorageTransferDatabaseTests.swift index 127c151229..1a3722c373 100644 --- a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/DefaultStorageTransferDatabaseTests.swift +++ b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/DefaultStorageTransferDatabaseTests.swift @@ -217,7 +217,7 @@ class DefaultStorageTransferDatabaseTests: XCTestCase { } expectation.fulfill() } - waitForExpectations(timeout: 1) + waitForExpectations(timeout: 5) } /// Given: A DefaultStorageTransferDatabase @@ -228,7 +228,7 @@ class DefaultStorageTransferDatabaseTests: XCTestCase { database.prepareForBackground() { expectation.fulfill() } - waitForExpectations(timeout: 1) + waitForExpectations(timeout: 5) } /// Given: The StorageTransferDatabase Type diff --git a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/StorageServiceSessionDelegateTests.swift b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/StorageServiceSessionDelegateTests.swift index b8498a0387..ad4ffbd8d2 100644 --- a/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/StorageServiceSessionDelegateTests.swift +++ b/AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/StorageServiceSessionDelegateTests.swift @@ -164,7 +164,7 @@ class StorageServiceSessionDelegateTests: XCTestCase { ) delegate.urlSession(.shared, task: task, didCompleteWithError: error) - waitForExpectations(timeout: 1) + waitForExpectations(timeout: 5) XCTAssertEqual(storageTask.status, .unknown) XCTAssertEqual(service.unregisterCount, 0) } diff --git a/AmplifyPlugins/Storage/Tests/StorageHostApp/StorageHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Storage/Tests/StorageHostApp/StorageHostApp.xcodeproj/project.pbxproj index f3330c56ef..c363202fbf 100644 --- a/AmplifyPlugins/Storage/Tests/StorageHostApp/StorageHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Storage/Tests/StorageHostApp/StorageHostApp.xcodeproj/project.pbxproj @@ -9,9 +9,6 @@ /* Begin PBXBuildFile section */ 0311113528EBED6500D58441 /* Tests.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 0311113428EBED6500D58441 /* Tests.xcconfig */; }; 031BC3F328EC9B2C0047B2E8 /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 031BC3F228EC9B2C0047B2E8 /* AppIcon.xcassets */; }; - 488C2A732BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A722BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift */; }; - 488C2A752BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A742BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift */; }; - 488C2A772BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A762BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift */; }; 21D165C32BBEF329001E3D4B /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 21D165C22BBEF329001E3D4B /* amplify_outputs.json */; }; 21D165C42BBEF329001E3D4B /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 21D165C22BBEF329001E3D4B /* amplify_outputs.json */; }; 21F7630D2BD6B8640048845A /* AWSS3StoragePluginAccelerateIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 565DF16F2953BAEA000DCCF7 /* AWSS3StoragePluginAccelerateIntegrationTests.swift */; }; @@ -34,6 +31,9 @@ 21F7631E2BD6B8640048845A /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEB128E748270000C36A /* XCTestCase+AsyncTesting.swift */; }; 21F7631F2BD6B8640048845A /* AWSS3StoragePluginOptionsUsabilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 684FB08128BEAF8E00C8A6EB /* AWSS3StoragePluginOptionsUsabilityTests.swift */; }; 21F763202BD6B8640048845A /* TestConfigHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 684FB09D28BEAFE700C8A6EB /* TestConfigHelper.swift */; }; + 488C2A732BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A722BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift */; }; + 488C2A752BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A742BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift */; }; + 488C2A772BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488C2A762BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift */; }; 56043E9329FC4D33003E3424 /* amplifyconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = D5C0382101A0E23943FDF4CB /* amplifyconfiguration.json */; }; 562B9AA42A0D703700A96FC6 /* AWSS3StoragePluginRequestRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562B9AA32A0D703700A96FC6 /* AWSS3StoragePluginRequestRecorder.swift */; }; 562B9AA52A0D734E00A96FC6 /* AWSS3StoragePluginRequestRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562B9AA32A0D703700A96FC6 /* AWSS3StoragePluginRequestRecorder.swift */; }; @@ -61,9 +61,6 @@ 681D7D6E2A42647200F7C310 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D6D2A42647200F7C310 /* Amplify */; }; 681D7D702A42647200F7C310 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D6F2A42647200F7C310 /* AWSCognitoAuthPlugin */; }; 681D7D722A42647200F7C310 /* AWSS3StoragePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D712A42647200F7C310 /* AWSS3StoragePlugin */; }; - 681D7D772A4264D200F7C310 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D762A4264D200F7C310 /* Amplify */; }; - 681D7D792A4264D200F7C310 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D782A4264D200F7C310 /* AWSCognitoAuthPlugin */; }; - 681D7D7B2A4264D200F7C310 /* AWSS3StoragePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 681D7D7A2A4264D200F7C310 /* AWSS3StoragePlugin */; }; 681D7D852A426FF500F7C310 /* amplifyconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = D5C0382101A0E23943FDF4CB /* amplifyconfiguration.json */; }; 681DFEB228E748270000C36A /* AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEAF28E748270000C36A /* AsyncTesting.swift */; }; 681DFEB328E748270000C36A /* AsyncExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681DFEB028E748270000C36A /* AsyncExpectation.swift */; }; @@ -135,13 +132,13 @@ 0311113428EBED6500D58441 /* Tests.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Tests.xcconfig; sourceTree = ""; }; 0311113828EBEEA700D58441 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; }; 031BC3F228EC9B2C0047B2E8 /* AppIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = AppIcon.xcassets; sourceTree = ""; }; - 488C2A722BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginRemoveIntegrationTests.swift; sourceTree = ""; }; - 488C2A742BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginListObjectsIntegrationTests.swift; sourceTree = ""; }; - 488C2A762BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginGetURLIntegrationTests.swift; sourceTree = ""; }; 21D165C02BBEDF0A001E3D4B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 21D165C22BBEF329001E3D4B /* amplify_outputs.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = amplify_outputs.json; sourceTree = ""; }; 21F763262BD6B8640048845A /* AWSS3StoragePluginGen2IntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AWSS3StoragePluginGen2IntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 21F763272BD6B8950048845A /* AWSS3StoragePluginGen2IntegrationTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = AWSS3StoragePluginGen2IntegrationTests.xctestplan; sourceTree = ""; }; + 488C2A722BAE04DC009AD2BA /* AWSS3StoragePluginRemoveIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginRemoveIntegrationTests.swift; sourceTree = ""; }; + 488C2A742BAFCA7C009AD2BA /* AWSS3StoragePluginListObjectsIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginListObjectsIntegrationTests.swift; sourceTree = ""; }; + 488C2A762BAFD4B3009AD2BA /* AWSS3StoragePluginGetURLIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginGetURLIntegrationTests.swift; sourceTree = ""; }; 562B9AA32A0D703700A96FC6 /* AWSS3StoragePluginRequestRecorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginRequestRecorder.swift; sourceTree = ""; }; 565DF16F2953BAEA000DCCF7 /* AWSS3StoragePluginAccelerateIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSS3StoragePluginAccelerateIntegrationTests.swift; sourceTree = ""; }; 681D7D392A42637700F7C310 /* StorageWatchApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StorageWatchApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -202,9 +199,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 681D7D772A4264D200F7C310 /* Amplify in Frameworks */, - 681D7D792A4264D200F7C310 /* AWSCognitoAuthPlugin in Frameworks */, - 681D7D7B2A4264D200F7C310 /* AWSS3StoragePlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -435,9 +429,6 @@ ); name = AWSS3StoragePluginIntegrationTestsWatch; packageProductDependencies = ( - 681D7D762A4264D200F7C310 /* Amplify */, - 681D7D782A4264D200F7C310 /* AWSCognitoAuthPlugin */, - 681D7D7A2A4264D200F7C310 /* AWSS3StoragePlugin */, ); productName = AWSS3StoragePluginIntegrationTests; productReference = 681D7D6C2A4263E500F7C310 /* AWSS3StoragePluginIntegrationTestsWatch.xctest */; @@ -1306,18 +1297,6 @@ isa = XCSwiftPackageProductDependency; productName = AWSS3StoragePlugin; }; - 681D7D762A4264D200F7C310 /* Amplify */ = { - isa = XCSwiftPackageProductDependency; - productName = Amplify; - }; - 681D7D782A4264D200F7C310 /* AWSCognitoAuthPlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSCognitoAuthPlugin; - }; - 681D7D7A2A4264D200F7C310 /* AWSS3StoragePlugin */ = { - isa = XCSwiftPackageProductDependency; - productName = AWSS3StoragePlugin; - }; B4A5B59A2919730700D873D2 /* Amplify */ = { isa = XCSwiftPackageProductDependency; productName = Amplify; diff --git a/AmplifyTests/DevMenuTests/GestureRecognizerTests.swift b/AmplifyTests/DevMenuTests/GestureRecognizerTests.swift index 72dad242cf..5c82b10d6f 100644 --- a/AmplifyTests/DevMenuTests/GestureRecognizerTests.swift +++ b/AmplifyTests/DevMenuTests/GestureRecognizerTests.swift @@ -22,6 +22,7 @@ class GestureRecognizerTests: XCTestCase { /// - Then: /// - It should return true + @MainActor func testGestureRecognizerAddedToWindow() { let contextProvider = MockDevMenuContextProvider() let longPressGestureRecognizer = diff --git a/Gemfile.lock b/Gemfile.lock index 41b693fbca..b8a900ce0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,7 +249,8 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) @@ -267,6 +268,7 @@ GEM naturally sqlite3 (1.6.0) mini_portile2 (~> 2.8.0) + strscan (3.1.0) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) diff --git a/Package.resolved b/Package.resolved index 3e7e7f61f5..9e4cd5bcac 100644 --- a/Package.resolved +++ b/Package.resolved @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/stephencelis/SQLite.swift.git", "state" : { - "revision" : "e78ae0220e17525a15ac68c697a155eb7a672a8e", - "version" : "0.15.0" + "revision" : "a95fc6df17d108bd99210db5e8a9bac90fe984b8", + "version" : "0.15.3" } }, { diff --git a/Package.swift b/Package.swift index 25639dce9c..afe1ff72bc 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -10,7 +10,7 @@ let platforms: [SupportedPlatform] = [ ] let dependencies: [Package.Dependency] = [ .package(url: "https://github.com/awslabs/aws-sdk-swift.git", exact: "0.36.2"), - .package(url: "https://github.com/stephencelis/SQLite.swift.git", exact: "0.15.0"), + .package(url: "https://github.com/stephencelis/SQLite.swift.git", exact: "0.15.3"), .package(url: "https://github.com/mattgallagher/CwlPreconditionTesting.git", from: "2.1.0"), .package(url: "https://github.com/aws-amplify/amplify-swift-utils-notifications.git", from: "1.1.0") ] diff --git a/README.md b/README.md index d335796bc1..3f766dc3bf 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,13 @@ The Amplify Library for Swift is layered on the [AWS SDK for Swift](https://aws. > To use Amplify Swift with visionOS, you'll need to target the `visionos-preview` branch. > For more information, see [Platform Support](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview#platform-support) on the `visionos-preview` branch. +### Swift Version Support + +The current minimum supported Swift language version is **Swift 5.9**. + +> [!NOTE] +> The minimum Swift language version supported by Amplify Swift matches the version included in the minimum Xcode version allowed by Apple to upload apps to App Store Connect. Historically, Apple updates the minimum allowed Xcode version in April each year. You can expect Amplify Swift to update the minimum supported Swift version within the following 60 days. This is done to ensure Amplify Swift can provide modern Swift APIs and take advantage of Swift language improvements. + ## Semantic versioning We follow [semantic versioning](https://semver.org/) for our releases. @@ -51,7 +58,7 @@ Applications that evaluate all members of an enumeration using a `switch` statem ## License -This library is licensed under the Apache 2.0 License. +This library is licensed under the Apache 2.0 License. ## Installation @@ -59,10 +66,10 @@ Amplify requires the following Xcode versions, according to the targeted platfor | Platform | Xcode Version | | -------------:| ------------: | -| iOS | 14.1+ | -| macOS | 14.1+ | -| tvOS | 14.3+ | -| watchOS | 14.3+ | +| iOS | 15.0+ | +| macOS | 15.0+ | +| tvOS | 15.0+ | +| watchOS | 15.0+ | | visionOS | 15 beta 2+ | | For more detailed instructions, follow the getting started guides in our [documentation site](https://docs.amplify.aws/lib/q/platform/ios) | diff --git a/canaries/example/Gemfile.lock b/canaries/example/Gemfile.lock index f9a653355b..4c3e0d6832 100644 --- a/canaries/example/Gemfile.lock +++ b/canaries/example/Gemfile.lock @@ -168,7 +168,8 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (2.0.7) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -181,6 +182,7 @@ GEM simctl (1.6.8) CFPropertyList naturally + strscan (3.1.0) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -210,9 +212,11 @@ GEM PLATFORMS arm64-darwin-21 + arm64-darwin-22 universal-darwin-20 x86_64-darwin-19 x86_64-darwin-21 + x86_64-linux DEPENDENCIES fastlane