From 8930f2f3e23a2fdad76aec7f5b63c63bdb83b770 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Fri, 19 Jun 2026 12:14:30 +0100 Subject: [PATCH 1/7] Make protocol agnostic to usage --- .../Sources/CheckoutProtocolClient.swift | 1 + .../CheckoutCommunicationProtocol.swift | 2 +- .../ShopifyCheckoutKit/CheckoutProtocol.swift | 128 ++++++++++++++ .../CheckoutViewController.swift | 2 +- .../ShopifyCheckoutKit/CheckoutWebView.swift | 5 +- .../ShopifyCheckoutKit.swift | 6 +- .../ShopifyCheckoutKit}/WindowOpen.swift | 22 ++- .../CheckoutProtocolTests.swift | 157 ++++++++++++++++++ .../CheckoutWebViewControllerTests.swift | 4 +- .../CheckoutWebViewTests.swift | 34 ++-- .../CheckoutProtocol.swift | 67 -------- ...+URL.swift => CheckoutTransport+URL.swift} | 4 +- .../CheckoutTransport.swift | 9 + .../ShopifyCheckoutProtocol/Client.swift | 10 +- .../ShopifyCheckoutProtocol/Codec.swift | 6 +- .../ShopifyCheckoutProtocol/Descriptors.swift | 5 - .../Generated/Catalog.swift | 60 +++++++ ....swift => CheckoutTransportURLTests.swift} | 35 ++-- .../ClientTests.swift | 116 ++++++++----- .../CodecDecodeTests.swift | 57 +++---- .../CodecEncodeTests.swift | 84 +++------- .../DescriptorTests.swift | 126 +++----------- protocol/languages/typescript/src/index.d.ts | 2 +- protocol/languages/typescript/src/index.ts | 2 +- .../typescript/src/notifications.d.ts | 14 -- .../languages/typescript/src/notifications.ts | 81 --------- protocol/scripts/generate_models.mjs | 2 + protocol/scripts/generate_swift_catalog.mjs | 137 +++++++++++++++ 28 files changed, 709 insertions(+), 469 deletions(-) create mode 100644 platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift rename {protocol/languages/swift/Sources/ShopifyCheckoutProtocol => platforms/swift/Sources/ShopifyCheckoutKit}/WindowOpen.swift (78%) create mode 100644 platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift delete mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol.swift rename protocol/languages/swift/Sources/ShopifyCheckoutProtocol/{CheckoutProtocol+URL.swift => CheckoutTransport+URL.swift} (91%) create mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift create mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift rename protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/{CheckoutProtocolURLTests.swift => CheckoutTransportURLTests.swift} (66%) delete mode 100644 protocol/languages/typescript/src/notifications.d.ts delete mode 100644 protocol/languages/typescript/src/notifications.ts create mode 100644 protocol/scripts/generate_swift_catalog.mjs diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/CheckoutProtocolClient.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/CheckoutProtocolClient.swift index ca311f05..64ee0433 100644 --- a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/CheckoutProtocolClient.swift +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/CheckoutProtocolClient.swift @@ -1,4 +1,5 @@ import SafariServices +import ShopifyCheckoutKit import ShopifyCheckoutProtocol import UIKit diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift index 709d9889..5ab4fe46 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift @@ -7,4 +7,4 @@ public protocol CheckoutCommunicationProtocol: Sendable { func process(_ message: String) async -> String? } -extension CheckoutProtocol.Client: CheckoutCommunicationProtocol {} +extension CheckoutTransport.Client: CheckoutCommunicationProtocol {} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift new file mode 100644 index 00000000..19f36a39 --- /dev/null +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift @@ -0,0 +1,128 @@ +#if !COCOAPODS + import ShopifyCheckoutProtocol +#endif +import Foundation + +public enum CheckoutProtocol { + public typealias Client = CheckoutTransport.Client + + public static func url(for url: URL, delegations: [String] = []) -> URL { + CheckoutTransport.url(for: url, delegations: delegations) + } + + public static let defaultDelegations: [String] = ["window.open"] + + static let methodNotFoundCode = -32601 + static let methodNotFoundMessage = "Method not found" + + public static let complete = GeneratedProtocolCatalog.ecComplete + public static let error = GeneratedProtocolCatalog.ecError + public static let lineItemsChange = GeneratedProtocolCatalog.ecLineItemsChange + public static let messagesChange = GeneratedProtocolCatalog.ecMessagesChange + public static let start = GeneratedProtocolCatalog.ecStart + public static let totalsChange = GeneratedProtocolCatalog.ecTotalsChange + + static let supportedProtocolMethods: Set = [ + CheckoutTransport.readyMethod, + start.method, + complete.method, + error.method, + lineItemsChange.method, + messagesChange.method, + totalsChange.method, + windowOpen.method + ] + + static func supportedProtocolMethod(_ message: String) -> String? { + guard + let envelope = try? JSONDecoder().decode(MethodEnvelope.self, from: Data(message.utf8)), + envelope.jsonrpc == "2.0", + supportedProtocolMethods.contains(envelope.method) + else { + return nil + } + + return envelope.method + } + + static func methodNotFoundResponse(forUnsupportedProtocolRequest message: String) -> String? { + guard + let request = try? JSONDecoder().decode(RequestEnvelope.self, from: Data(message.utf8)), + request.jsonrpc == "2.0", + !supportedProtocolMethods.contains(request.method), + let id = request.id + else { + return nil + } + + let response = MethodNotFoundResponse( + id: id, + error: MethodNotFoundError(code: methodNotFoundCode, message: methodNotFoundMessage) + ) + let encoder = JSONEncoder() + encoder.outputFormatting = [.sortedKeys] + guard let data = try? encoder.encode(response) else { return nil } + return String(data: data, encoding: .utf8) + } +} + +private struct MethodEnvelope: Decodable { + let jsonrpc: String + let method: String +} + +private struct RequestEnvelope: Decodable { + let jsonrpc: String + let method: String + let id: RequestID? +} + +enum RequestID: Codable, Equatable { + case string(String) + case int(Int64) + case null + + init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + + if container.decodeNil() { + self = .null + } else if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode(Int64.self) { + self = .int(value) + } else { + throw DecodingError.typeMismatch( + RequestID.self, + DecodingError.Context( + codingPath: decoder.codingPath, + debugDescription: "JSON-RPC id must be a string, integer, or null" + ) + ) + } + } + + func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + + switch self { + case let .string(value): + try container.encode(value) + case let .int(value): + try container.encode(value) + case .null: + try container.encodeNil() + } + } +} + +private struct MethodNotFoundResponse: Encodable { + let jsonrpc = "2.0" + let id: RequestID + let error: MethodNotFoundError +} + +private struct MethodNotFoundError: Encodable { + let code: Int + let message: String +} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift index 0f59fc30..d9641a8b 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift @@ -33,7 +33,7 @@ public struct ShopifyCheckout: UIViewControllerRepresentable, CheckoutConfigurab var onFailAction: ((CheckoutError) -> Void)? public init(checkout url: URL) { - checkoutURL = CheckoutProtocol.url(for: url) + checkoutURL = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) } public func makeUIViewController(context _: Self.Context) -> CheckoutViewController { diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift index 8b12c432..0f93118c 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift @@ -230,7 +230,7 @@ class CheckoutWebView: WKWebView { /// the kit via `viewDelegate`. Per UCP spec, `unrecoverable` means no valid /// resource exists to act on, so consumers don't have to wire dismissal in /// every error handler. - lazy var defaultsClient: CheckoutProtocol.Client = .init() + lazy var defaultsClient: CheckoutTransport.Client = .init() .on(CheckoutProtocol.complete) { _ in CheckoutWebView.invalidate(disconnect: false) } @@ -458,7 +458,8 @@ extension CheckoutWebView: WKScriptMessageHandler { return } - if method == CheckoutProtocol.readyMethod, let response = CheckoutProtocol.acknowledgeReady(body) { + if method == CheckoutTransport.readyMethod, + let response = CheckoutTransport.acknowledgeReady(body, supportedDelegations: CheckoutProtocol.defaultDelegations) { OSLogger.shared.debug("Handling ec.ready: sending UCP ready acknowledgement, isPreload: \(isPreloadRequest)") Task { @MainActor in await checkoutBridge.sendResponse(self, messageBody: response) diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift b/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift index 32f56790..0ec705c8 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift @@ -48,7 +48,7 @@ public func preload(checkout url: URL) { return } - let decorated = CheckoutProtocol.url(for: url) + let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) CheckoutWebView.preload(checkout: decorated) } @@ -61,7 +61,7 @@ public func invalidate() { @MainActor @discardableResult public func present(checkout url: URL, from: UIViewController, delegate: (any CheckoutDelegate)? = nil, client: (any CheckoutCommunicationProtocol)? = nil) -> CheckoutViewController { - let decorated = CheckoutProtocol.url(for: url) + let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) let viewController = CheckoutViewController(checkout: decorated, delegate: delegate, client: client) from.present(viewController, animated: true) return viewController @@ -70,7 +70,7 @@ public func present(checkout url: URL, from: UIViewController, delegate: (any Ch @MainActor @discardableResult package func present(checkout url: URL, from: UIViewController, entryPoint: MetaData.EntryPoint, delegate: (any CheckoutDelegate)? = nil, client: (any CheckoutCommunicationProtocol)? = nil) -> CheckoutViewController { - let decorated = CheckoutProtocol.url(for: url) + let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) let viewController = CheckoutViewController(checkout: decorated, delegate: delegate, client: client, entryPoint: entryPoint) from.present(viewController, animated: true) return viewController diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/WindowOpen.swift b/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift similarity index 78% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/WindowOpen.swift rename to platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift index 213e15eb..31c098e6 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/WindowOpen.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift @@ -1,3 +1,6 @@ +#if !COCOAPODS + import ShopifyCheckoutProtocol +#endif import Foundation public struct WindowOpenRequest: EventPayload { @@ -37,12 +40,12 @@ public enum WindowOpenResult: ResponsePayload { public func encode(to encoder: Encoder) throws { switch self { case .success: - try UCPSuccessResult( - ucp: UCPSuccess(version: CheckoutProtocol.specVersion) + try WindowOpenSuccessBody( + ucp: WindowOpenUCP(version: CheckoutTransport.specVersion, status: "success") ).encode(to: encoder) case let .rejected(reason): try WindowOpenRejectedBody( - ucp: UCPError(version: CheckoutProtocol.specVersion), + ucp: WindowOpenUCP(version: CheckoutTransport.specVersion, status: "error"), messages: [ WindowOpenRejectedMessage(content: reason ?? "Window open rejected") ] @@ -53,7 +56,7 @@ public enum WindowOpenResult: ResponsePayload { extension CheckoutProtocol { public static let windowOpen = DelegationDescriptor( - method: "ec.window.open_request", + method: GeneratedProtocolCatalog.ecWindowOpenRequest.method, delegation: "window.open", decode: { params in try? JSONDecoder().decode(WindowOpenRequest.self, from: params) @@ -61,8 +64,17 @@ extension CheckoutProtocol { ) } +private struct WindowOpenUCP: Encodable { + let version: String + let status: String +} + +private struct WindowOpenSuccessBody: Encodable { + let ucp: WindowOpenUCP +} + private struct WindowOpenRejectedBody: Encodable { - let ucp: UCPError + let ucp: WindowOpenUCP let messages: [WindowOpenRejectedMessage] } diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift new file mode 100644 index 00000000..a3af43bf --- /dev/null +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift @@ -0,0 +1,157 @@ +import Foundation +#if !COCOAPODS + import ShopifyCheckoutProtocol +#endif +@testable import ShopifyCheckoutKit +import Testing + +@Suite("Embedded Checkout Protocol Curation") +struct CheckoutProtocolTests { + @Test func defaultDelegationsAdvertiseWindowOpen() { + #expect(CheckoutProtocol.defaultDelegations == ["window.open"]) + } + + @Test func supportedProtocolMethodsCoverReadyCuratedNotificationsAndWindowOpen() { + #expect(CheckoutProtocol.supportedProtocolMethods == [ + CheckoutTransport.readyMethod, + "ec.start", + "ec.complete", + "ec.error", + "ec.line_items.change", + "ec.messages.change", + "ec.totals.change", + "ec.window.open_request" + ]) + } + + @Test func supportedProtocolMethodsExcludeUncuratedCatalogMethods() { + #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ec.payment.credential_request")) + #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ec.fulfillment.change")) + #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ep.cart.ready")) + } + + @Test func supportedProtocolMethodParsesValidSupportedMessage() { + let message = #"{"jsonrpc":"2.0","method":"ec.start","params":{"checkout":{}}}"# + #expect(CheckoutProtocol.supportedProtocolMethod(message) == "ec.start") + } + + @Test func supportedProtocolMethodRejectsUnsupportedOrInvalidMessage() { + #expect(CheckoutProtocol.supportedProtocolMethod(#"{"jsonrpc":"2.0","method":"custom"}"#) == nil) + #expect(CheckoutProtocol.supportedProtocolMethod(#"{"jsonrpc":"1.0","method":"ec.start"}"#) == nil) + #expect(CheckoutProtocol.supportedProtocolMethod("not json") == nil) + } + + @Test func methodNotFoundResponseEncodesUnsupportedRequests() throws { + let response = try #require( + CheckoutProtocol.methodNotFoundResponse( + forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":"unsupported","params":{}}"# + ) + ) + let object = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) + + #expect(object["jsonrpc"] as? String == "2.0") + #expect(object["id"] as? String == "unsupported") + let error = try #require(object["error"] as? [String: Any]) + #expect(error["code"] as? Int == CheckoutProtocol.methodNotFoundCode) + #expect(error["message"] as? String == CheckoutProtocol.methodNotFoundMessage) + } + + @Test func methodNotFoundResponsePreservesNumericRequestID() throws { + let response = try #require( + CheckoutProtocol.methodNotFoundResponse( + forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":7,"params":{}}"# + ) + ) + let object = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) + #expect(object["id"] as? Int == 7) + } + + @Test func methodNotFoundResponsePreservesNullRequestID() throws { + let response = try #require( + CheckoutProtocol.methodNotFoundResponse( + forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":null,"params":{}}"# + ) + ) + let object = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) + #expect(object["id"] is NSNull) + } + + @Test func methodNotFoundResponseRejectsInvalidRequestIDs() { + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":true,"params":{}}"#) == nil) + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":{},"params":{}}"#) == nil) + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":1.5,"params":{}}"#) == nil) + } + + @Test func methodNotFoundResponseRejectsSupportedNotificationsOrInvalidMessages() { + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom"}"#) == nil) + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"ec.start","id":"supported"}"#) == nil) + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"1.0","method":"custom","id":"unsupported"}"#) == nil) + #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: "not json") == nil) + } +} + +@Suite("Window Open Delegation") +struct WindowOpenDelegationTests { + @Test func descriptorBindsWindowOpenMethodAndDelegation() { + #expect(CheckoutProtocol.windowOpen.method == "ec.window.open_request") + #expect(CheckoutProtocol.windowOpen.delegation == "window.open") + } + + @Test func requestPayloadDecodesValidURL() throws { + let payload = try JSONDecoder().decode( + WindowOpenRequest.self, + from: Data(#"{"url":"https://example.com/terms"}"#.utf8) + ) + #expect(payload.url == URL(string: "https://example.com/terms")) + } + + @Test func requestPayloadRejectsEmptyURL() { + #expect((try? JSONDecoder().decode(WindowOpenRequest.self, from: Data(#"{"url":""}"#.utf8))) == nil) + } + + @Test func requestPayloadRejectsMissingURL() { + #expect((try? JSONDecoder().decode(WindowOpenRequest.self, from: Data("{}".utf8))) == nil) + } + + @Test func requestPayloadRejectsNullURL() { + #expect((try? JSONDecoder().decode(WindowOpenRequest.self, from: Data(#"{"url":null}"#.utf8))) == nil) + } + + private struct EncodingFailure: Error {} + + private func encode(_ result: WindowOpenResult) throws -> [String: Any] { + let encoder = JSONEncoder() + encoder.outputFormatting = [.sortedKeys] + let data = try encoder.encode(result) + guard let object = try JSONSerialization.jsonObject(with: data) as? [String: Any] else { + throw EncodingFailure() + } + return object + } + + @Test func resultEncodesSuccessBody() throws { + let body = try encode(.success) + let ucp = try #require(body["ucp"] as? [String: Any]) + #expect(ucp["status"] as? String == "success") + #expect(ucp["version"] as? String == CheckoutTransport.specVersion) + } + + @Test func resultEncodesRejectedBody() throws { + let body = try encode(.rejected(reason: "canOpenURL returned false")) + let ucp = try #require(body["ucp"] as? [String: Any]) + #expect(ucp["status"] as? String == "error") + + let messages = try #require(body["messages"] as? [[String: Any]]) + #expect(messages.count == 1) + #expect(messages[0]["type"] as? String == "error") + #expect(messages[0]["code"] as? String == "window_open_rejected_error") + #expect(messages[0]["severity"] as? String == "unrecoverable") + #expect(messages[0]["content"] as? String == "canOpenURL returned false") + } + + @Test func resultEncodesRejectedWithNilReason() throws { + let body = try encode(.rejected(reason: nil)) + let messages = try #require(body["messages"] as? [[String: Any]]) + #expect(messages[0]["content"] as? String != "") + } +} diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift index 2666ebee..e56701c9 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift @@ -75,7 +75,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_presentationControllerDidDismiss_doesNotCleanUpBeforeViewDisappears() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutProtocol.url(for: url), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) @@ -93,7 +93,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_viewDidDisappear_cleansUpConsumedPreloadedWebViewWhenDismissed() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutProtocol.url(for: url), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift index 4894c9f8..48ba4fc7 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift @@ -276,7 +276,7 @@ class CheckoutWebViewTests: XCTestCase { XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) - let cached = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertFalse(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -286,7 +286,7 @@ class CheckoutWebViewTests: XCTestCase { func testRepeatedPreloadForMatchingCheckoutDoesNotReloadCachedWebView() { let webView = LoadedRequestObservableWebView() - let checkoutURL = CheckoutProtocol.url(for: url) + let checkoutURL = CheckoutTransport.url(for: url) _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: checkoutURL, entryPoint: nil)) CheckoutWebView.preload(checkout: checkoutURL) @@ -297,8 +297,8 @@ class CheckoutWebViewTests: XCTestCase { func testPresentingMatchingCheckoutReusesCachedWebViewWithoutEvictingIt() { ShopifyCheckoutKit.preload(checkout: url) - let first = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) - let second = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) + let first = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let second = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) XCTAssertTrue(first === second) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) @@ -308,7 +308,7 @@ class CheckoutWebViewTests: XCTestCase { ShopifyCheckoutKit.preload(checkout: url) let otherURL = try XCTUnwrap(URL(string: "http://shopify1.shopify.com/checkouts/cn/456")) - let fresh = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: otherURL)) + let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: otherURL)) XCTAssertNil(fresh.url) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) @@ -316,9 +316,9 @@ class CheckoutWebViewTests: XCTestCase { } func testPresentWithDifferentEntryPointDoesNotReusePreloadedWebView() { - CheckoutWebView.preload(checkout: CheckoutProtocol.url(for: url), entryPoint: .acceleratedCheckouts) + CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), entryPoint: .acceleratedCheckouts) - let fresh = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url), entryPoint: nil) + let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url), entryPoint: nil) XCTAssertNil(fresh.url) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) @@ -338,12 +338,12 @@ class CheckoutWebViewTests: XCTestCase { func testStalePreloadCacheIsRejectedImmediately() { let staleCreatedAt = Date(timeIntervalSinceNow: -6 * 60) - CheckoutWebView.preload(checkout: CheckoutProtocol.url(for: url), createdAt: staleCreatedAt) + CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), createdAt: staleCreatedAt) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) XCTAssertFalse(CheckoutWebView.preloadCache.hasActiveKeepAlive()) - let fresh = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) + let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) XCTAssertNil(fresh.url) XCTAssertTrue(fresh.isBridgeAttached) @@ -353,7 +353,7 @@ class CheckoutWebViewTests: XCTestCase { func testPreloadCacheExpiresAndStopsKeepAlive() { let nearlyStaleCreatedAt = Date(timeIntervalSinceNow: -(5 * 60 - 0.1)) - CheckoutWebView.preload(checkout: CheckoutProtocol.url(for: url), createdAt: nearlyStaleCreatedAt) + CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), createdAt: nearlyStaleCreatedAt) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -378,7 +378,7 @@ class CheckoutWebViewTests: XCTestCase { func testPreloadKeepAliveFailureInvalidatesCache() { let webView = ThrowingEvaluateJavaScriptWebView() - _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: CheckoutProtocol.url(for: url), entryPoint: nil)) + _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: CheckoutTransport.url(for: url), entryPoint: nil)) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -403,7 +403,7 @@ class CheckoutWebViewTests: XCTestCase { func testInvalidateDetachesCachedPreloadedWebView() { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) XCTAssertTrue(cached.isBridgeAttached) ShopifyCheckoutKit.invalidate() @@ -414,7 +414,7 @@ class CheckoutWebViewTests: XCTestCase { func testHTTPErrorInvalidatesPreloadCache() throws { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutProtocol.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) let link = try XCTUnwrap(cached.url) let response = try XCTUnwrap(HTTPURLResponse(url: link, statusCode: 403, httpVersion: nil, headerFields: nil)) @@ -536,7 +536,7 @@ class CheckoutWebViewTests: XCTestCase { let result = try XCTUnwrap(parsed["result"] as? [String: Any]) let ucp = try XCTUnwrap(result["ucp"] as? [String: Any]) XCTAssertEqual(ucp["status"] as? String, "success") - XCTAssertEqual(ucp["version"] as? String, CheckoutProtocol.specVersion) + XCTAssertEqual(ucp["version"] as? String, CheckoutTransport.specVersion) } @MainActor @@ -707,7 +707,7 @@ class CheckoutWebViewTests: XCTestCase { let body = #"{"jsonrpc":"2.0","method":"ec.window.open_request","id":"\#(id)","params":{"url":"https://example.com/terms"}}"# let responseSent = expectation(description: "response sent") MockCheckoutBridge.sendResponseExpectation = responseSent - view.client = CheckoutProtocol.Client() + view.client = CheckoutTransport.Client() .on(CheckoutProtocol.windowOpen) { _ in .rejected(reason: "consumer override") } @@ -772,7 +772,7 @@ class CheckoutWebViewTests: XCTestCase { /// and bypass the handler entirely. private func ecErrorBody(severity: String) -> String { return """ - {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"status":"error","version":"\(CheckoutProtocol.specVersion)"},"messages":[{"type":"error","code":"session_failed","content":"Session failed","severity":"\(severity)"}]}}} + {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"status":"error","version":"\(CheckoutTransport.specVersion)"},"messages":[{"type":"error","code":"session_failed","content":"Session failed","severity":"\(severity)"}]}}} """ } @@ -840,7 +840,7 @@ class CheckoutWebViewTests: XCTestCase { let consumerHandlerFired = expectation(description: "consumer handler fired") let dismissed = expectation(description: "viewDelegate received failure") mockDelegate.didFailWithErrorExpectation = dismissed - view.client = CheckoutProtocol.Client() + view.client = CheckoutTransport.Client() .on(CheckoutProtocol.error) { _ in consumerHandlerFired.fulfill() } diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol.swift deleted file mode 100644 index 55c6c31d..00000000 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol.swift +++ /dev/null @@ -1,67 +0,0 @@ -import Foundation - -public enum CheckoutProtocol { - public static let specVersion = "2026-04-08" - - public static let defaultDelegations: [String] = ["window.open"] - - package static let readyMethod = "ec.ready" - package static let parseErrorCode = -32700 - package static let parseErrorMessage = "Parse error" - package static let methodNotFoundCode = -32601 - package static let methodNotFoundMessage = "Method not found" - - public static let complete = NotificationDescriptor(method: "ec.complete") - public static let error = NotificationDescriptor(method: "ec.error") - public static let lineItemsChange = NotificationDescriptor( - method: "ec.line_items.change" - ) - public static let messagesChange = NotificationDescriptor( - method: "ec.messages.change" - ) - public static let start = NotificationDescriptor(method: "ec.start") - public static let totalsChange = NotificationDescriptor(method: "ec.totals.change") - - package static let supportedProtocolMethods: Set = [ - readyMethod, - start.method, - complete.method, - error.method, - lineItemsChange.method, - messagesChange.method, - totalsChange.method, - windowOpen.method - ] - - package static func supportedProtocolMethod(_ message: String) -> String? { - guard - let envelope = try? JSONDecoder().decode(JSONRPCEnvelope.self, from: Data(message.utf8)), - envelope.jsonrpc == "2.0", - supportedProtocolMethods.contains(envelope.method) - else { - return nil - } - - return envelope.method - } - - package static func methodNotFoundResponse(forUnsupportedProtocolRequest message: String) -> String? { - guard - let request = try? JSONDecoder().decode(JSONRPCEnvelope.self, from: Data(message.utf8)), - request.jsonrpc == "2.0", - !supportedProtocolMethods.contains(request.method), - let id = request.id - else { - return nil - } - - let response = JSONRPCErrorResponse( - id: id, - error: JSONRPCError(code: methodNotFoundCode, message: methodNotFoundMessage) - ) - let encoder = JSONEncoder() - encoder.outputFormatting = [.sortedKeys] - guard let data = try? encoder.encode(response) else { return nil } - return String(data: data, encoding: .utf8) - } -} diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol+URL.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift similarity index 91% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol+URL.swift rename to protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift index a876879b..01da875e 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutProtocol+URL.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift @@ -1,12 +1,12 @@ import Foundation -extension CheckoutProtocol { +extension CheckoutTransport { /// Returns the given checkout URL with the query parameters required to /// initiate the Embedded Checkout Protocol handshake (`ec_version`, /// `ec_delegate`). public static func url( for url: URL, - delegations: [String] = defaultDelegations + delegations: [String] = [] ) -> URL { guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false) else { return url diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift new file mode 100644 index 00000000..2e3bb47e --- /dev/null +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift @@ -0,0 +1,9 @@ +import Foundation + +public enum CheckoutTransport { + public static let specVersion = "2026-04-08" + + package static let readyMethod = "ec.ready" + package static let parseErrorCode = -32700 + package static let parseErrorMessage = "Parse error" +} diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift index 9a3c992c..8f1f2e26 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift @@ -1,6 +1,6 @@ import Foundation -extension CheckoutProtocol { +extension CheckoutTransport { public struct Client: Sendable, MutableCopyable { private var notificationHandlers: [String: @MainActor @Sendable (any EventPayload) -> Void] private var delegationEntries: [String: DelegationEntry] @@ -38,22 +38,22 @@ extension CheckoutProtocol { handler: { id, params in guard let payload = descriptor.decode(params) else { return nil } let result = await perform(payload) - return CheckoutProtocol.encodeResponse(id: id, result: result) + return CheckoutTransport.encodeResponse(id: id, result: result) } ) } } public func process(_ message: String) async -> String? { - let decoded = CheckoutProtocol.decode(jsonRpc: message) + let decoded = CheckoutTransport.decode(jsonRpc: message) switch decoded { case let .ready(id, requested): let accepted = requested.filter(Set(delegations).contains) - return CheckoutProtocol.encodeReadyResponse(id: id, acceptedDelegations: accepted) + return CheckoutTransport.encodeReadyResponse(id: id, acceptedDelegations: accepted) case let .error(id, code, message): - return CheckoutProtocol.encodeErrorResponse(id: id, code: code, message: message) + return CheckoutTransport.encodeErrorResponse(id: id, code: code, message: message) case let .notification(method, payload): await notificationHandlers[method]?(payload) diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift index 2bde1ae7..fa361af1 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift @@ -1,12 +1,12 @@ import Foundation -extension CheckoutProtocol { +extension CheckoutTransport { /// Returns an `ec.ready` response if the given message is an `ec.ready` request, /// otherwise `nil`. The response echoes the intersection of the merchant's /// requested delegations with `supportedDelegations` under a `delegate` array. public static func acknowledgeReady( _ message: String, - supportedDelegations: [String] = CheckoutProtocol.defaultDelegations + supportedDelegations: [String] = [] ) -> String? { switch decode(jsonRpc: message) { case let .ready(id, requested): @@ -22,7 +22,7 @@ extension CheckoutProtocol { } } -extension CheckoutProtocol { +extension CheckoutTransport { static func decode(jsonRpc: String) -> UCPMessage { guard let data = jsonRpc.data(using: .utf8) else { return .unknown(method: "", rawParams: jsonRpc) diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Descriptors.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Descriptors.swift index 488dff15..36574e80 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Descriptors.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Descriptors.swift @@ -10,11 +10,6 @@ public protocol EventPayload: Decodable, Sendable {} /// is explicit — preventing arbitrary `Encodable & Sendable` types from silently matching. public protocol ResponsePayload: Encodable, Sendable {} -extension Checkout: EventPayload {} -extension ErrorResponse: EventPayload {} -extension InstrumentsChangeResult: ResponsePayload {} -extension CredentialResult: ResponsePayload {} - public struct NotificationDescriptor: Sendable { public let method: String } diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift new file mode 100644 index 00000000..2c101129 --- /dev/null +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift @@ -0,0 +1,60 @@ +// This file is generated by protocol/scripts/generate_swift_catalog.mjs. +// Do not edit directly. + +import Foundation + +extension Checkout: EventPayload {} +extension ErrorResponse: EventPayload {} +extension JSONAny: EventPayload {} + +public enum GeneratedProtocolCatalog { + public static let ecReady = NotificationDescriptor(method: "ec.ready") + public static let ecAuth = NotificationDescriptor(method: "ec.auth") + public static let ecError = NotificationDescriptor(method: "ec.error") + public static let ecStart = NotificationDescriptor(method: "ec.start") + public static let ecComplete = NotificationDescriptor(method: "ec.complete") + public static let ecMessagesChange = NotificationDescriptor(method: "ec.messages.change") + public static let ecLineItemsChange = NotificationDescriptor(method: "ec.line_items.change") + public static let ecBuyerChange = NotificationDescriptor(method: "ec.buyer.change") + public static let ecTotalsChange = NotificationDescriptor(method: "ec.totals.change") + public static let ecPaymentChange = NotificationDescriptor(method: "ec.payment.change") + public static let ecPaymentInstrumentsChangeRequest = NotificationDescriptor(method: "ec.payment.instruments_change_request") + public static let ecPaymentCredentialRequest = NotificationDescriptor(method: "ec.payment.credential_request") + public static let ecWindowOpenRequest = NotificationDescriptor(method: "ec.window.open_request") + public static let ecFulfillmentChange = NotificationDescriptor(method: "ec.fulfillment.change") + public static let ecFulfillmentAddressChangeRequest = NotificationDescriptor(method: "ec.fulfillment.address_change_request") + public static let epCartReady = NotificationDescriptor(method: "ep.cart.ready") + public static let epCartAuth = NotificationDescriptor(method: "ep.cart.auth") + public static let epCartError = NotificationDescriptor(method: "ep.cart.error") + public static let epCartStart = NotificationDescriptor(method: "ep.cart.start") + public static let epCartComplete = NotificationDescriptor(method: "ep.cart.complete") + public static let epCartLineItemsChange = NotificationDescriptor(method: "ep.cart.line_items.change") + public static let epCartBuyerChange = NotificationDescriptor(method: "ep.cart.buyer.change") + public static let epCartMessagesChange = NotificationDescriptor(method: "ep.cart.messages.change") + + public static let allMethods: [String] = [ + ecReady.method, + ecAuth.method, + ecError.method, + ecStart.method, + ecComplete.method, + ecMessagesChange.method, + ecLineItemsChange.method, + ecBuyerChange.method, + ecTotalsChange.method, + ecPaymentChange.method, + ecPaymentInstrumentsChangeRequest.method, + ecPaymentCredentialRequest.method, + ecWindowOpenRequest.method, + ecFulfillmentChange.method, + ecFulfillmentAddressChangeRequest.method, + epCartReady.method, + epCartAuth.method, + epCartError.method, + epCartStart.method, + epCartComplete.method, + epCartLineItemsChange.method, + epCartBuyerChange.method, + epCartMessagesChange.method, + ] +} diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutProtocolURLTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift similarity index 66% rename from protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutProtocolURLTests.swift rename to protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift index 4595583c..877d57af 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutProtocolURLTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift @@ -2,7 +2,7 @@ import Foundation @testable import ShopifyCheckoutProtocol import Testing -@Suite("CheckoutProtocol URL Tests") +@Suite("CheckoutTransport URL Tests") struct CheckoutProtocolURLTests { private let baseURL = URL(string: "https://shop.com/cart/c/abc")! @@ -11,17 +11,22 @@ struct CheckoutProtocolURLTests { } @Test func appendsEcVersion() { - let items = queryItems(CheckoutProtocol.url(for: baseURL)) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutProtocol.specVersion))) + let items = queryItems(CheckoutTransport.url(for: baseURL)) + #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) } - @Test func appendsDefaultDelegate() { - let items = queryItems(CheckoutProtocol.url(for: baseURL)) + @Test func omitsDelegateByDefault() { + let items = queryItems(CheckoutTransport.url(for: baseURL)) + #expect(!items.contains(where: { $0.name == "ec_delegate" })) + } + + @Test func appendsSuppliedDelegate() { + let items = queryItems(CheckoutTransport.url(for: baseURL, delegations: ["window.open"])) #expect(items.contains(URLQueryItem(name: "ec_delegate", value: "window.open"))) } @Test func joinsMultipleDelegationsWithComma() { - let result = CheckoutProtocol.url( + let result = CheckoutTransport.url( for: baseURL, delegations: ["window.open", "payment.credential"] ) @@ -30,29 +35,29 @@ struct CheckoutProtocolURLTests { } @Test func omitsDelegateWhenEmpty() { - let items = queryItems(CheckoutProtocol.url(for: baseURL, delegations: [])) + let items = queryItems(CheckoutTransport.url(for: baseURL, delegations: [])) #expect(!items.contains(where: { $0.name == "ec_delegate" })) } @Test func preservesExistingQueryItems() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?key=cart_token&utm_source=email")) - let items = queryItems(CheckoutProtocol.url(for: url)) + let items = queryItems(CheckoutTransport.url(for: url)) #expect(items.contains(URLQueryItem(name: "key", value: "cart_token"))) #expect(items.contains(URLQueryItem(name: "utm_source", value: "email"))) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutProtocol.specVersion))) + #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) } @Test func replacesCallerSuppliedProtocolQueryItems() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_version=stale&ec_delegate=custom")) - let items = queryItems(CheckoutProtocol.url(for: url)) + let items = queryItems(CheckoutTransport.url(for: url, delegations: ["window.open"])) - #expect(items.filter { $0.name == "ec_version" }.map(\.value) == [CheckoutProtocol.specVersion]) + #expect(items.filter { $0.name == "ec_version" }.map(\.value) == [CheckoutTransport.specVersion]) #expect(items.filter { $0.name == "ec_delegate" }.map(\.value) == ["window.open"]) } @Test func isIdempotentOnRecall() { - let once = CheckoutProtocol.url(for: baseURL) - let twice = CheckoutProtocol.url(for: once) + let once = CheckoutTransport.url(for: baseURL, delegations: ["window.open"]) + let twice = CheckoutTransport.url(for: once, delegations: ["window.open"]) let items = queryItems(twice) #expect(items.filter { $0.name == "ec_version" }.count == 1) @@ -61,9 +66,9 @@ struct CheckoutProtocolURLTests { @Test func removesExistingDelegationWhenDelegationsAreEmpty() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_delegate=custom")) - let items = queryItems(CheckoutProtocol.url(for: url, delegations: [])) + let items = queryItems(CheckoutTransport.url(for: url, delegations: [])) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutProtocol.specVersion))) + #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) #expect(!items.contains { $0.name == "ec_delegate" }) } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift index 3f32d899..697a7316 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift @@ -2,6 +2,49 @@ import Foundation @testable import ShopifyCheckoutProtocol import Testing +private struct TestURLPayload: EventPayload { + let url: URL? + + init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let raw = try container.decode(String.self, forKey: .url) + url = URL(string: raw) + } + + private enum CodingKeys: String, CodingKey { + case url + } +} + +private enum TestDelegationResult: ResponsePayload { + case success + case rejected(reason: String) + + func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + switch self { + case .success: + try container.encode(["status": "success"], forKey: .ucp) + case let .rejected(reason): + try container.encode(["status": "error"], forKey: .ucp) + try container.encode([["content": reason]], forKey: .messages) + } + } + + private enum CodingKeys: String, CodingKey { + case ucp + case messages + } +} + +private let windowOpenDescriptor = DelegationDescriptor( + method: GeneratedProtocolCatalog.ecWindowOpenRequest.method, + delegation: "window.open", + decode: { params in + try? JSONDecoder().decode(TestURLPayload.self, from: params) + } +) + @Suite("Client Tests") struct ClientTests { private func notificationFixture() throws -> String { @@ -16,8 +59,8 @@ struct ClientTests { @Test @MainActor func notificationDispatchesToRegisteredHandler() async throws { var receivedCheckout: Checkout? - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.start) { checkout in + let client = CheckoutTransport.Client() + .on(GeneratedProtocolCatalog.ecStart) { checkout in receivedCheckout = checkout } @@ -30,8 +73,8 @@ struct ClientTests { @Test @MainActor func notificationDoesNotFireUnregisteredHandler() async throws { var completeFired = false - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.complete) { (_: Checkout) in + let client = CheckoutTransport.Client() + .on(GeneratedProtocolCatalog.ecComplete) { (_: Checkout) in completeFired = true } @@ -42,8 +85,8 @@ struct ClientTests { } @Test @MainActor func notificationReturnsNil() async throws { - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.start) { (_: Checkout) in } + let client = CheckoutTransport.Client() + .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in } let response = try await client.process(notificationFixture()) @@ -53,9 +96,9 @@ struct ClientTests { @Test @MainActor func multipleNotificationHandlersOnDifferentEvents() async throws { var startFired = false var completeFired = false - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.start) { (_: Checkout) in startFired = true } - .on(CheckoutProtocol.complete) { (_: Checkout) in completeFired = true } + let client = CheckoutTransport.Client() + .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in startFired = true } + .on(GeneratedProtocolCatalog.ecComplete) { (_: Checkout) in completeFired = true } _ = try await client.process(notificationFixture()) @@ -64,24 +107,22 @@ struct ClientTests { } @Test @MainActor func unknownMessageReturnsNil() async { - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.start) { (_: Checkout) in } + let client = CheckoutTransport.Client() + .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in } let response = await client.process("not valid json") #expect(response == nil) } - @Test @MainActor func windowOpenRequestDispatchesToRegisteredHandler() async throws { + @Test @MainActor func delegationRequestDispatchesToRegisteredHandler() async throws { let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com/terms"}} """# - var receivedURL: URL? - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.windowOpen) { payload in - receivedURL = payload.url - return .success + let client = CheckoutTransport.Client() + .on(windowOpenDescriptor) { payload in + payload.url == URL(string: "https://example.com/terms") ? .success : .rejected(reason: "unexpected url") } let response = try #require(await client.process(request)) @@ -91,16 +132,15 @@ struct ClientTests { let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) #expect(ucp["status"] as? String == "success") - #expect(receivedURL == URL(string: "https://example.com/terms")) } - @Test @MainActor func windowOpenRequestEncodesRejectedResult() async throws { + @Test @MainActor func delegationRequestEncodesRejectedResult() async throws { let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.windowOpen) { _ in + let client = CheckoutTransport.Client() + .on(windowOpenDescriptor) { _ in .rejected(reason: "no presenter available") } @@ -115,8 +155,8 @@ struct ClientTests { #expect(messages[0]["content"] as? String == "no presenter available") } - @Test @MainActor func windowOpenRequestReturnsNilWhenHandlerNotRegistered() async { - let client = CheckoutProtocol.Client() + @Test @MainActor func delegationRequestReturnsNilWhenHandlerNotRegistered() async { + let client = CheckoutTransport.Client() let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# @@ -125,9 +165,9 @@ struct ClientTests { #expect(response == nil) } - @Test @MainActor func windowOpenRequestWithNullURLReturnsInvalidParamsError() async throws { - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.windowOpen) { _ in .success } + @Test @MainActor func delegationRequestWithNullURLReturnsInvalidParamsError() async throws { + let client = CheckoutTransport.Client() + .on(windowOpenDescriptor) { _ in .success } let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":null}} """# @@ -141,14 +181,14 @@ struct ClientTests { #expect(error["message"] as? String == "Invalid params") } - @Test @MainActor func windowOpenRequestLastHandlerWins() async throws { + @Test @MainActor func delegationRequestLastHandlerWins() async throws { let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.windowOpen) { _ in .rejected(reason: "first") } - .on(CheckoutProtocol.windowOpen) { _ in .success } + let client = CheckoutTransport.Client() + .on(windowOpenDescriptor) { _ in .rejected(reason: "first") } + .on(windowOpenDescriptor) { _ in .success } let response = try #require(await client.process(request)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) @@ -157,13 +197,13 @@ struct ClientTests { #expect(ucp["status"] as? String == "success") } - @Test @MainActor func windowOpenRequestAdvertisesDelegationInReadyResponse() async throws { + @Test @MainActor func delegationAdvertisesDelegationInReadyResponse() async throws { let ready = #""" {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["window.open"]}} """# - let client = CheckoutProtocol.Client() - .on(CheckoutProtocol.windowOpen) { _ in .success } + let client = CheckoutTransport.Client() + .on(windowOpenDescriptor) { _ in .success } let response = try #require(await client.process(ready)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) @@ -177,18 +217,18 @@ struct ClientTests { {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let client = CheckoutProtocol.Client() + let client = CheckoutTransport.Client() let response = try #require(await client.process(ready)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-bad") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutProtocol.parseErrorCode) - #expect(error["message"] as? String == CheckoutProtocol.parseErrorMessage) + #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) + #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) } @Test @MainActor func readyReturnsResponse() async throws { - let client = CheckoutProtocol.Client() + let client = CheckoutTransport.Client() let response = try await client.process(readyFixture()) @@ -199,7 +239,7 @@ struct ClientTests { #expect(parsed["params"] == nil) let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutProtocol.specVersion) + #expect(ucp["version"] as? String == CheckoutTransport.specVersion) #expect(ucp["status"] as? String == "success") } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift index c8d46cf3..fc5eee43 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift @@ -6,7 +6,7 @@ import Testing struct CodecDecodeTests { @Test func decodesNotification() throws { let json = try fixtureString("notification") - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .notification(method, payload) = message else { Issue.record("Expected .notification, got \(message)") @@ -25,7 +25,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"version":"2026-04-08","status":"error"},"messages":[{"type":"error","code":"unrecoverable","content":"Boom.","severity":"recoverable"}]}}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .notification(method, payload) = message else { Issue.record("Expected .notification, got \(message)") @@ -41,7 +41,7 @@ struct CodecDecodeTests { @Test func decodesRequestCarriesRawParams() throws { let json = try fixtureString("request") - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .request(id, method, params) = message else { Issue.record("Expected .request, got \(message)") @@ -59,9 +59,9 @@ struct CodecDecodeTests { #expect(checkout["currency"] as? String == "CAD") } - @Test func decodesWindowOpenRequest() throws { + @Test func decodesWindowOpenRequestAsRawRequest() throws { let json = try fixtureString("window_open_request") - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .request(id, method, params) = message else { Issue.record("Expected .request, got \(message)") @@ -71,15 +71,15 @@ struct CodecDecodeTests { #expect(id == "req-window-1") #expect(method == "ec.window.open_request") - let payload = try #require(CheckoutProtocol.windowOpen.decode(params)) - #expect(payload.url == URL(string: "https://example.com/terms")) + let parsed = try #require(JSONSerialization.jsonObject(with: params) as? [String: Any]) + #expect(parsed["url"] as? String == "https://example.com/terms") } @Test func windowOpenRequestDropsUnknownParamsBeforeDispatch() throws { let json = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com/terms","unknown":"value"}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .request(_, _, params) = message else { Issue.record("Expected .request, got \(message)") @@ -91,26 +91,11 @@ struct CodecDecodeTests { #expect(parsed["unknown"] == nil) } - @Test func windowOpenDescriptorRejectsEmptyURL() { - let params = Data(#"{"url":""}"#.utf8) - #expect(CheckoutProtocol.windowOpen.decode(params) == nil) - } - - @Test func windowOpenDescriptorRejectsMissingURL() { - let params = Data("{}".utf8) - #expect(CheckoutProtocol.windowOpen.decode(params) == nil) - } - - @Test func windowOpenDescriptorRejectsNullURL() { - let params = Data(#"{"url":null}"#.utf8) - #expect(CheckoutProtocol.windowOpen.decode(params) == nil) - } - @Test func decodesMalformedWindowOpenParamsAsInvalidParamsError() { let json = #""" {"jsonrpc":"2.0","id":"req-window-bad","method":"ec.window.open_request","params":{"url":null}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -126,7 +111,7 @@ struct CodecDecodeTests { let json = """ {"jsonrpc":"2.0","method":"ec.unknown","params":{"something":"else"}} """ - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown, got \(message)") @@ -140,7 +125,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":1,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -155,7 +140,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":null,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -170,7 +155,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"ready-no-params","method":"ec.ready"} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -185,7 +170,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -193,15 +178,15 @@ struct CodecDecodeTests { } #expect(id == "ready-bad") - #expect(code == CheckoutProtocol.parseErrorCode) - #expect(responseMessage == CheckoutProtocol.parseErrorMessage) + #expect(code == CheckoutTransport.parseErrorCode) + #expect(responseMessage == CheckoutTransport.parseErrorMessage) } @Test func decodesNullReadyParamsAsParseError() { let json = #""" {"jsonrpc":"2.0","id":"ready-null","method":"ec.ready","params":null} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -209,15 +194,15 @@ struct CodecDecodeTests { } #expect(id == "ready-null") - #expect(code == CheckoutProtocol.parseErrorCode) - #expect(responseMessage == CheckoutProtocol.parseErrorMessage) + #expect(code == CheckoutTransport.parseErrorCode) + #expect(responseMessage == CheckoutTransport.parseErrorMessage) } @Test func rejectsFractionalJSONRPCID() { let json = #""" {"jsonrpc":"2.0","id":1.5,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown for fractional id, got \(message)") @@ -229,7 +214,7 @@ struct CodecDecodeTests { @Test func handlesMalformedJSON() { let json = "not valid json at all" - let message = CheckoutProtocol.decode(jsonRpc: json) + let message = CheckoutTransport.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown for malformed JSON, got \(message)") diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift index f0c431ca..7a6f421e 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift @@ -14,12 +14,12 @@ struct CodecEncodeTests { paymentHandlers: nil, services: nil, status: .success, - version: CheckoutProtocol.specVersion + version: CheckoutTransport.specVersion ), continueURL: nil, messages: nil ) - let json = CheckoutProtocol.encodeResponse(id: "req-456", result: result) + let json = CheckoutTransport.encodeResponse(id: "req-456", result: result) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["jsonrpc"] as? String == "2.0") @@ -28,7 +28,7 @@ struct CodecEncodeTests { } @Test func encodesReadyResponseWithResultEnvelope() throws { - let json = CheckoutProtocol.encodeReadyResponse(id: "ready-1", acceptedDelegations: []) + let json = CheckoutTransport.encodeReadyResponse(id: "ready-1", acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["jsonrpc"] as? String == "2.0") @@ -38,13 +38,13 @@ struct CodecEncodeTests { let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutProtocol.specVersion) + #expect(ucp["version"] as? String == CheckoutTransport.specVersion) #expect(ucp["status"] as? String == "success") #expect(result["delegate"] == nil, "Empty delegate list must be omitted") } @Test func encodesReadyResponseEchoesAcceptedDelegations() throws { - let json = CheckoutProtocol.encodeReadyResponse(id: "ready-1", acceptedDelegations: ["window.open"]) + let json = CheckoutTransport.encodeReadyResponse(id: "ready-1", acceptedDelegations: ["window.open"]) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -53,14 +53,14 @@ struct CodecEncodeTests { } @Test func encodesReadyResponseWithNumericID() throws { - let json = CheckoutProtocol.encodeReadyResponse(id: 7, acceptedDelegations: []) + let json = CheckoutTransport.encodeReadyResponse(id: 7, acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["id"] as? Int == 7) } @Test func encodesReadyResponseWithNullID() throws { - let json = CheckoutProtocol.encodeReadyResponse(id: .null, acceptedDelegations: []) + let json = CheckoutTransport.encodeReadyResponse(id: .null, acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["id"] is NSNull) @@ -71,13 +71,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential"]}} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message)) + let response = try #require(CheckoutTransport.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-1") let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutProtocol.specVersion) + #expect(ucp["version"] as? String == CheckoutTransport.specVersion) #expect(ucp["status"] as? String == "success") } @@ -86,7 +86,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential","window.open","fulfillment.address_change"]}} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message, supportedDelegations: ["window.open"])) + let response = try #require(CheckoutTransport.acknowledgeReady(message, supportedDelegations: ["window.open"])) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -99,7 +99,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential"]}} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message, supportedDelegations: ["window.open"])) + let response = try #require(CheckoutTransport.acknowledgeReady(message, supportedDelegations: ["window.open"])) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -111,7 +111,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-no-params","method":"ec.ready"} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message)) + let response = try #require(CheckoutTransport.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-no-params") @@ -124,13 +124,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message)) + let response = try #require(CheckoutTransport.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-bad") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutProtocol.parseErrorCode) - #expect(error["message"] as? String == CheckoutProtocol.parseErrorMessage) + #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) + #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) } @Test func acknowledgeReadyReturnsParseErrorForNullParams() throws { @@ -138,13 +138,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-null","method":"ec.ready","params":null} """# - let response = try #require(CheckoutProtocol.acknowledgeReady(message)) + let response = try #require(CheckoutTransport.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-null") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutProtocol.parseErrorCode) - #expect(error["message"] as? String == CheckoutProtocol.parseErrorMessage) + #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) + #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) } @Test func acknowledgeReadyReturnsNilForNonReadyMessage() { @@ -152,54 +152,10 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","method":"ec.start","params":{"checkout":{"id":"c"}}} """# - #expect(CheckoutProtocol.acknowledgeReady(message) == nil) + #expect(CheckoutTransport.acknowledgeReady(message) == nil) } @Test func acknowledgeReadyReturnsNilForMalformedJSON() { - #expect(CheckoutProtocol.acknowledgeReady("not json") == nil) - } - - @Test func windowOpenResultEncodesSuccessBody() throws { - let json = CheckoutProtocol.encodeResponse(id: "req-window-1", result: WindowOpenResult.success) - let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) - - #expect(parsed["jsonrpc"] as? String == "2.0") - #expect(parsed["id"] as? String == "req-window-1") - let result = try #require(parsed["result"] as? [String: Any]) - let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["status"] as? String == "success") - #expect(ucp["version"] as? String == CheckoutProtocol.specVersion) - } - - @Test func windowOpenResultEncodesRejectedBody() throws { - let json = CheckoutProtocol.encodeResponse( - id: "req-window-1", - result: WindowOpenResult.rejected(reason: "canOpenURL returned false") - ) - let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) - - #expect(parsed["id"] as? String == "req-window-1") - let result = try #require(parsed["result"] as? [String: Any]) - let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["status"] as? String == "error") - - let messages = try #require(result["messages"] as? [[String: Any]]) - #expect(messages.count == 1) - #expect(messages[0]["type"] as? String == "error") - #expect(messages[0]["code"] as? String == "window_open_rejected_error") - #expect(messages[0]["severity"] as? String == "unrecoverable") - #expect(messages[0]["content"] as? String == "canOpenURL returned false") - } - - @Test func windowOpenResultEncodesRejectedWithNilReason() throws { - let json = CheckoutProtocol.encodeResponse( - id: "req-window-1", - result: WindowOpenResult.rejected(reason: nil) - ) - let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) - - let result = try #require(parsed["result"] as? [String: Any]) - let messages = try #require(result["messages"] as? [[String: Any]]) - #expect(messages[0]["content"] as? String != "", "Content is required per message_error schema") + #expect(CheckoutTransport.acknowledgeReady("not json") == nil) } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift index dc981217..a6b43938 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift @@ -7,121 +7,35 @@ struct DescriptorTests { @Suite("Spec Version") struct SpecVersion { @Test func matchesOpenRPCInfoVersion() { - #expect(CheckoutProtocol.specVersion == "2026-04-08") + #expect(CheckoutTransport.specVersion == "2026-04-08") } } - @Suite("Notifications") - struct Notifications { - @Test func startMethod() { - #expect(CheckoutProtocol.start.method == "ec.start") + @Suite("Generated Catalog") + struct GeneratedCatalog { + @Test func bindsNotificationMethods() { + #expect(GeneratedProtocolCatalog.ecStart.method == "ec.start") + #expect(GeneratedProtocolCatalog.ecComplete.method == "ec.complete") + #expect(GeneratedProtocolCatalog.ecMessagesChange.method == "ec.messages.change") + #expect(GeneratedProtocolCatalog.ecLineItemsChange.method == "ec.line_items.change") + #expect(GeneratedProtocolCatalog.ecTotalsChange.method == "ec.totals.change") + #expect(GeneratedProtocolCatalog.ecError.method == "ec.error") } - @Test func completeMethod() { - #expect(CheckoutProtocol.complete.method == "ec.complete") + @Test func exposesEveryOpenRPCMethod() { + #expect(GeneratedProtocolCatalog.allMethods.contains("ec.start")) + #expect(GeneratedProtocolCatalog.allMethods.contains("ec.complete")) + #expect(GeneratedProtocolCatalog.allMethods.contains("ec.window.open_request")) } - @Test func messagesChangeMethod() { - #expect(CheckoutProtocol.messagesChange.method == "ec.messages.change") + @Test func includesMethodsBeyondTheCuratedConsumerSubset() { + #expect(GeneratedProtocolCatalog.allMethods.contains("ec.payment.credential_request")) + #expect(GeneratedProtocolCatalog.allMethods.contains("ec.fulfillment.change")) + #expect(GeneratedProtocolCatalog.allMethods.contains("ep.cart.ready")) } - @Test func lineItemsChangeMethod() { - #expect(CheckoutProtocol.lineItemsChange.method == "ec.line_items.change") - } - - @Test func totalsChangeMethod() { - #expect(CheckoutProtocol.totalsChange.method == "ec.totals.change") - } - - @Test func errorMethod() { - #expect(CheckoutProtocol.error.method == "ec.error") - } - } - - @Suite("Supported Protocol Methods") - struct SupportedProtocolMethods { - @Test func includesReadyNotificationsAndDelegations() { - #expect(CheckoutProtocol.supportedProtocolMethods == [ - CheckoutProtocol.readyMethod, - CheckoutProtocol.start.method, - CheckoutProtocol.complete.method, - CheckoutProtocol.error.method, - CheckoutProtocol.lineItemsChange.method, - CheckoutProtocol.messagesChange.method, - CheckoutProtocol.totalsChange.method, - CheckoutProtocol.windowOpen.method - ]) - } - - @Test func excludesInternalOrUnsupportedMethods() { - #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ec.buyer.change")) - #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ec.payment.credential_request")) - #expect(!CheckoutProtocol.supportedProtocolMethods.contains("ep.cart.ready")) - } - - @Test func supportedProtocolMethodParsesValidSupportedMessage() { - let message = #"{"jsonrpc":"2.0","method":"ec.start","params":{"checkout":{}}}"# - - #expect(CheckoutProtocol.supportedProtocolMethod(message) == CheckoutProtocol.start.method) - } - - @Test func supportedProtocolMethodRejectsUnsupportedOrInvalidMessage() { - #expect(CheckoutProtocol.supportedProtocolMethod(#"{"jsonrpc":"2.0","method":"custom"}"#) == nil) - #expect(CheckoutProtocol.supportedProtocolMethod(#"{"jsonrpc":"1.0","method":"ec.start"}"#) == nil) - #expect(CheckoutProtocol.supportedProtocolMethod("not json") == nil) - } - - @Test func methodNotFoundResponseEncodesUnsupportedRequests() throws { - let response = try #require( - CheckoutProtocol.methodNotFoundResponse( - forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":"unsupported","params":{}}"# - ) - ) - let data = try #require(response.data(using: .utf8)) - let object = try #require(try JSONSerialization.jsonObject(with: data) as? [String: Any]) - - #expect(object["jsonrpc"] as? String == "2.0") - #expect(object["id"] as? String == "unsupported") - let error = try #require(object["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutProtocol.methodNotFoundCode) - #expect(error["message"] as? String == CheckoutProtocol.methodNotFoundMessage) - } - - @Test func methodNotFoundResponsePreservesNumericRequestID() throws { - let response = try #require( - CheckoutProtocol.methodNotFoundResponse( - forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":7,"params":{}}"# - ) - ) - let data = try #require(response.data(using: .utf8)) - let object = try #require(try JSONSerialization.jsonObject(with: data) as? [String: Any]) - - #expect(object["id"] as? Int == 7) - } - - @Test func methodNotFoundResponsePreservesNullRequestID() throws { - let response = try #require( - CheckoutProtocol.methodNotFoundResponse( - forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":null,"params":{}}"# - ) - ) - let data = try #require(response.data(using: .utf8)) - let object = try #require(try JSONSerialization.jsonObject(with: data) as? [String: Any]) - - #expect(object["id"] is NSNull) - } - - @Test func methodNotFoundResponseRejectsInvalidRequestIDs() { - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":true,"params":{}}"#) == nil) - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":{},"params":{}}"#) == nil) - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom","id":1.5,"params":{}}"#) == nil) - } - - @Test func methodNotFoundResponseRejectsSupportedNotificationsOrInvalidMessages() { - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"custom"}"#) == nil) - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"2.0","method":"ec.start","id":"supported"}"#) == nil) - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: #"{"jsonrpc":"1.0","method":"custom","id":"unsupported"}"#) == nil) - #expect(CheckoutProtocol.methodNotFoundResponse(forUnsupportedProtocolRequest: "not json") == nil) + @Test func methodsAreUnique() { + #expect(Set(GeneratedProtocolCatalog.allMethods).count == GeneratedProtocolCatalog.allMethods.count) } } } diff --git a/protocol/languages/typescript/src/index.d.ts b/protocol/languages/typescript/src/index.d.ts index 9f217a84..e4d8ca2b 100644 --- a/protocol/languages/typescript/src/index.d.ts +++ b/protocol/languages/typescript/src/index.d.ts @@ -1,2 +1,2 @@ export * from './generated/Models'; -export * from './notifications'; +export * from './generated/ProtocolNotifications'; diff --git a/protocol/languages/typescript/src/index.ts b/protocol/languages/typescript/src/index.ts index 9f217a84..e4d8ca2b 100644 --- a/protocol/languages/typescript/src/index.ts +++ b/protocol/languages/typescript/src/index.ts @@ -1,2 +1,2 @@ export * from './generated/Models'; -export * from './notifications'; +export * from './generated/ProtocolNotifications'; diff --git a/protocol/languages/typescript/src/notifications.d.ts b/protocol/languages/typescript/src/notifications.d.ts deleted file mode 100644 index c4d53311..00000000 --- a/protocol/languages/typescript/src/notifications.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type GeneratedCheckoutProtocolPayloads } from './generated/ProtocolNotifications'; -export declare const CheckoutProtocol: { - readonly complete: "ec.complete"; - readonly error: "ec.error"; - readonly lineItemsChange: "ec.line_items.change"; - readonly messagesChange: "ec.messages.change"; - readonly start: "ec.start"; - readonly totalsChange: "ec.totals.change"; -}; -export type CheckoutProtocolMethod = (typeof CheckoutProtocol)[keyof typeof CheckoutProtocol]; -export type CheckoutProtocolPayloads = Pick; -export type CheckoutProtocolPayloadDecoder = (payload: unknown) => CheckoutProtocolPayloads[K]; -export declare function decodeCheckoutProtocolPayload(method: K, payload: unknown): CheckoutProtocolPayloads[K]; -export declare function decodeCheckoutProtocolPayload(method: string, payload: unknown): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined; diff --git a/protocol/languages/typescript/src/notifications.ts b/protocol/languages/typescript/src/notifications.ts deleted file mode 100644 index 16cc25cb..00000000 --- a/protocol/languages/typescript/src/notifications.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { - generatedCheckoutProtocol, - generatedCheckoutProtocolPayloadDecoders, - type GeneratedCheckoutProtocolPayloads, -} from './generated/ProtocolNotifications'; - -// Public Checkout Kit notification events. The full notification contract is -// generated from protocol/services/shopping/embedded.openrpc.json; this module -// intentionally exposes the subset supported by the public SDKs. -type PublicCheckoutProtocolKey = - | 'complete' - | 'error' - | 'lineItemsChange' - | 'messagesChange' - | 'start' - | 'totalsChange'; - -export const CheckoutProtocol = { - complete: generatedCheckoutProtocol.complete, - error: generatedCheckoutProtocol.error, - lineItemsChange: generatedCheckoutProtocol.lineItemsChange, - messagesChange: generatedCheckoutProtocol.messagesChange, - start: generatedCheckoutProtocol.start, - totalsChange: generatedCheckoutProtocol.totalsChange, -} as const satisfies Pick; - -export type CheckoutProtocolMethod = - (typeof CheckoutProtocol)[keyof typeof CheckoutProtocol]; - -export type CheckoutProtocolPayloads = Pick< - GeneratedCheckoutProtocolPayloads, - CheckoutProtocolMethod ->; - -export type CheckoutProtocolPayloadDecoder< - K extends keyof CheckoutProtocolPayloads, -> = (payload: unknown) => CheckoutProtocolPayloads[K]; - -const checkoutProtocolPayloadDecoders = { - [CheckoutProtocol.complete]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.complete], - [CheckoutProtocol.error]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.error], - [CheckoutProtocol.lineItemsChange]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.lineItemsChange], - [CheckoutProtocol.messagesChange]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.messagesChange], - [CheckoutProtocol.start]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.start], - [CheckoutProtocol.totalsChange]: - generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.totalsChange], -} satisfies { - [K in keyof CheckoutProtocolPayloads]: CheckoutProtocolPayloadDecoder; -}; - -export function decodeCheckoutProtocolPayload< - K extends keyof CheckoutProtocolPayloads, ->(method: K, payload: unknown): CheckoutProtocolPayloads[K]; -export function decodeCheckoutProtocolPayload( - method: string, - payload: unknown, -): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined; -export function decodeCheckoutProtocolPayload( - method: string, - payload: unknown, -): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined { - const decoder = decoderFor(method); - return decoder?.(payload); -} - -function decoderFor( - method: string, -): - | ((payload: unknown) => CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads]) - | undefined { - return checkoutProtocolPayloadDecoders[ - method as keyof typeof checkoutProtocolPayloadDecoders - ] as - | ((payload: unknown) => CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads]) - | undefined; -} diff --git a/protocol/scripts/generate_models.mjs b/protocol/scripts/generate_models.mjs index 6ea0583f..8f6f31a9 100755 --- a/protocol/scripts/generate_models.mjs +++ b/protocol/scripts/generate_models.mjs @@ -363,6 +363,8 @@ async function generateSwift(specDir, output) { return `${source.slice(0, helperStart)}${SWIFT_JSON_HELPER_REPLACEMENT}`; }); + + await run("node", [path.join(PROTOCOL_DIR, "scripts", "generate_swift_catalog.mjs")]); } async function generateTypescript(specDir, output) { diff --git a/protocol/scripts/generate_swift_catalog.mjs b/protocol/scripts/generate_swift_catalog.mjs new file mode 100644 index 00000000..c4463269 --- /dev/null +++ b/protocol/scripts/generate_swift_catalog.mjs @@ -0,0 +1,137 @@ +#!/usr/bin/env node +import fs from 'node:fs'; +import path from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const scriptDir = path.dirname(fileURLToPath(import.meta.url)); +const protocolRoot = path.resolve(scriptDir, '..'); + +const openRpcPath = path.resolve( + protocolRoot, + 'services/shopping/embedded.openrpc.json', +); +const outputPath = path.resolve( + protocolRoot, + 'languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift', +); + +const fallbackPayload = 'JSONAny'; + +const refPayloadMappings = new Map([ + ['checkout.json', 'Checkout'], + ['cart.json', fallbackPayload], + ['types/error_response.json', 'ErrorResponse'], + ['error_response.json', 'ErrorResponse'], +]); + +function normalizeRef(ref) { + return ref + .replace(/^\.\.\/\.\.\/schemas\/shopping\//, '') + .replace(/^\.\.\/\.\.\/schemas\/common\//, '') + .replace(/#.*$/, ''); +} + +function methodNameToIdentifier(methodName) { + const parts = methodName.split(/[._]/g).filter(Boolean); + + return parts + .map((part, index) => + index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1), + ) + .join(''); +} + +function resolveMethod(method, openRpcDir) { + if (typeof method.$ref !== 'string') { + return method; + } + + const [filePart, pointer] = method.$ref.split('#'); + const filePath = path.resolve(openRpcDir, filePart); + const document = JSON.parse(fs.readFileSync(filePath, 'utf8')); + + const segments = (pointer ?? '').split('/').filter(Boolean); + let resolved = document; + for (const segment of segments) { + resolved = resolved?.[segment.replace(/~1/g, '/').replace(/~0/g, '~')]; + } + + if (!resolved || typeof resolved.name !== 'string') { + throw new Error(`Cannot resolve OpenRPC method $ref: ${method.$ref}`); + } + + return resolved; +} + +function payloadType(method) { + const params = method.params ?? []; + if (params.length === 0) { + return fallbackPayload; + } + + const ref = params[0]?.schema?.$ref; + if (typeof ref !== 'string') { + return fallbackPayload; + } + + const normalized = normalizeRef(ref); + return refPayloadMappings.get(normalized) ?? fallbackPayload; +} + +const openRpcDir = path.dirname(openRpcPath); +const openRpc = JSON.parse(fs.readFileSync(openRpcPath, 'utf8')); +const entries = []; + +for (const rawMethod of openRpc.methods ?? []) { + const method = resolveMethod(rawMethod, openRpcDir); + if (typeof method.name !== 'string') { + throw new Error('Encountered OpenRPC method without a name'); + } + + entries.push({ + identifier: methodNameToIdentifier(method.name), + method: method.name, + payload: payloadType(method), + }); +} + +const seen = new Set(); +for (const entry of entries) { + if (seen.has(entry.identifier)) { + throw new Error(`Duplicate catalog identifier: ${entry.identifier}`); + } + seen.add(entry.identifier); +} + +const payloadTypes = Array.from( + new Set(entries.map(entry => entry.payload)), +).sort(); + +const conformances = payloadTypes + .map(type => `extension ${type}: EventPayload {}`) + .join('\n'); + +const generated = `// This file is generated by protocol/scripts/generate_swift_catalog.mjs. +// Do not edit directly. + +import Foundation + +${conformances} + +public enum GeneratedProtocolCatalog { +${entries + .map( + entry => + ` public static let ${entry.identifier} = NotificationDescriptor<${entry.payload}>(method: "${entry.method}")`, + ) + .join('\n')} + + public static let allMethods: [String] = [ +${entries.map(entry => ` ${entry.identifier}.method,`).join('\n')} + ] +} +`; + +fs.mkdirSync(path.dirname(outputPath), {recursive: true}); +fs.writeFileSync(outputPath, generated); +console.log(`Generated ${outputPath}`); From 17c4f771ea1554d8cf2bc3067da33943fd181683 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 10:36:12 +0100 Subject: [PATCH 2/7] Fix formatting + discrepancies for CI --- .../ShopifyCheckoutKit/CheckoutProtocol.swift | 17 + .../ShopifyCheckoutKit/CheckoutWebView.swift | 3 +- .../CheckoutWebViewControllerTests.swift | 4 +- .../CheckoutWebViewTests.swift | 10 +- platforms/swift/api/ShopifyCheckoutKit.json | 1145 ++++++- .../swift/api/ShopifyCheckoutProtocol.json | 2739 ++++++++++------- .../src/generated/ProtocolNotifications.d.ts | 13 +- .../src/generated/ProtocolNotifications.ts | 38 +- .../generate_typescript_notifications.mjs | 22 +- ...generate_typescript_notifications.test.mjs | 12 +- 10 files changed, 2731 insertions(+), 1272 deletions(-) diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift index 19f36a39..94cbea83 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift @@ -75,6 +75,23 @@ private struct RequestEnvelope: Decodable { let jsonrpc: String let method: String let id: RequestID? + + private enum CodingKeys: String, CodingKey { + case jsonrpc + case method + case id + } + + init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + jsonrpc = try container.decode(String.self, forKey: .jsonrpc) + method = try container.decode(String.self, forKey: .method) + if container.contains(.id) { + id = try container.decode(RequestID.self, forKey: .id) + } else { + id = nil + } + } } enum RequestID: Codable, Equatable { diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift index 0f93118c..9f66fe47 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift @@ -459,7 +459,8 @@ extension CheckoutWebView: WKScriptMessageHandler { } if method == CheckoutTransport.readyMethod, - let response = CheckoutTransport.acknowledgeReady(body, supportedDelegations: CheckoutProtocol.defaultDelegations) { + let response = CheckoutTransport.acknowledgeReady(body, supportedDelegations: CheckoutProtocol.defaultDelegations) + { OSLogger.shared.debug("Handling ec.ready: sending UCP ready acknowledgement, isPreload: \(isPreloadRequest)") Task { @MainActor in await checkoutBridge.sendResponse(self, messageBody: response) diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift index e56701c9..facd2f22 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift @@ -75,7 +75,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_presentationControllerDidDismiss_doesNotCleanUpBeforeViewDisappears() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) @@ -93,7 +93,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_viewDidDisappear_cleansUpConsumedPreloadedWebViewWhenDismissed() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift index 48ba4fc7..272aeff9 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift @@ -276,7 +276,7 @@ class CheckoutWebViewTests: XCTestCase { XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertFalse(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -297,8 +297,8 @@ class CheckoutWebViewTests: XCTestCase { func testPresentingMatchingCheckoutReusesCachedWebViewWithoutEvictingIt() { ShopifyCheckoutKit.preload(checkout: url) - let first = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) - let second = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let first = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let second = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(first === second) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) @@ -403,7 +403,7 @@ class CheckoutWebViewTests: XCTestCase { func testInvalidateDetachesCachedPreloadedWebView() { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(cached.isBridgeAttached) ShopifyCheckoutKit.invalidate() @@ -414,7 +414,7 @@ class CheckoutWebViewTests: XCTestCase { func testHTTPErrorInvalidatesPreloadCache() throws { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) let link = try XCTUnwrap(cached.url) let response = try XCTUnwrap(HTTPURLResponse(url: link, statusCode: 403, httpVersion: nil, headerFields: nil)) diff --git a/platforms/swift/api/ShopifyCheckoutKit.json b/platforms/swift/api/ShopifyCheckoutKit.json index 217349a5..25688344 100644 --- a/platforms/swift/api/ShopifyCheckoutKit.json +++ b/platforms/swift/api/ShopifyCheckoutKit.json @@ -1062,6 +1062,625 @@ } ] }, + { + "kind": "TypeDecl", + "name": "CheckoutProtocol", + "printedName": "CheckoutProtocol", + "children": [ + { + "kind": "TypeAlias", + "name": "Client", + "printedName": "Client", + "children": [ + { + "kind": "TypeNominal", + "name": "Client", + "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + } + ], + "declKind": "TypeAlias", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO6Clienta", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO6Clienta", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Function", + "name": "url", + "printedName": "url(for:delegations:)", + "children": [ + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "hasDefaultArg": true, + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "funcSelfKind": "NonMutating" + }, + { + "kind": "Var", + "name": "defaultDelegations", + "printedName": "defaultDelegations", + "children": [ + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sa" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sa" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "complete", + "printedName": "complete", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO8complete0abD022NotificationDescriptorVyAE0B0VGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO8complete0abD022NotificationDescriptorVyAE0B0VGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO8complete0abD022NotificationDescriptorVyAE0B0VGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO8complete0abD022NotificationDescriptorVyAE0B0VGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "error", + "printedName": "error", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO5error0abD022NotificationDescriptorVyAE13ErrorResponseVGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO5error0abD022NotificationDescriptorVyAE13ErrorResponseVGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO5error0abD022NotificationDescriptorVyAE13ErrorResponseVGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO5error0abD022NotificationDescriptorVyAE13ErrorResponseVGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "lineItemsChange", + "printedName": "lineItemsChange", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO15lineItemsChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO15lineItemsChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO15lineItemsChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO15lineItemsChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "messagesChange", + "printedName": "messagesChange", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO14messagesChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO14messagesChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO14messagesChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO14messagesChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "start", + "printedName": "start", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO5start0abD022NotificationDescriptorVyAE0B0VGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO5start0abD022NotificationDescriptorVyAE0B0VGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO5start0abD022NotificationDescriptorVyAE0B0VGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO5start0abD022NotificationDescriptorVyAE0B0VGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "totalsChange", + "printedName": "totalsChange", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO12totalsChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO12totalsChange0abD022NotificationDescriptorVyAE0B0VGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO12totalsChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO12totalsChange0abD022NotificationDescriptorVyAE0B0VGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "windowOpen", + "printedName": "windowOpen", + "children": [ + { + "kind": "TypeNominal", + "name": "DelegationDescriptor", + "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenRequest", + "printedName": "ShopifyCheckoutKit.WindowOpenRequest", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV" + }, + { + "kind": "TypeNominal", + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + } + ], + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO10windowOpen0abD020DelegationDescriptorVyAA06WindowF7RequestVAA0iF6ResultOGvpZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO10windowOpen0abD020DelegationDescriptorVyAA06WindowF7RequestVAA0iF6ResultOGvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isFromExtension": true, + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "DelegationDescriptor", + "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenRequest", + "printedName": "ShopifyCheckoutKit.WindowOpenRequest", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV" + }, + { + "kind": "TypeNominal", + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + } + ], + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO10windowOpen0abD020DelegationDescriptorVyAA06WindowF7RequestVAA0iF6ResultOGvgZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO10windowOpen0abD020DelegationDescriptorVyAA06WindowF7RequestVAA0iF6ResultOGvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "isFromExtension": true, + "accessorKind": "get" + } + ] + } + ], + "declKind": "Enum", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO", + "moduleName": "ShopifyCheckoutKit", + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, { "kind": "TypeDecl", "name": "CheckoutURL", @@ -5984,37 +6603,211 @@ }, { "kind": "TypeDecl", - "name": "SwiftVersion", - "printedName": "SwiftVersion", + "name": "SwiftVersion", + "printedName": "SwiftVersion", + "children": [ + { + "kind": "Var", + "name": "current", + "printedName": "current", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvpZ", + "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvpZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvgZ", + "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvgZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + } + ], + "declKind": "Enum", + "usr": "s:18ShopifyCheckoutKit12SwiftVersionO", + "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO", + "moduleName": "ShopifyCheckoutKit", + "isInternal": true, + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "UserAgent", + "printedName": "UserAgent", + "children": [ + { + "kind": "Function", + "name": "string", + "printedName": "string(platform:entryPoint:)", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "ShopifyCheckoutKit.Platform?", + "children": [ + { + "kind": "TypeNominal", + "name": "Platform", + "printedName": "ShopifyCheckoutKit.Platform", + "usr": "s:18ShopifyCheckoutKit8PlatformV" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "ShopifyCheckoutKit.MetaData.EntryPoint?", + "children": [ + { + "kind": "TypeNominal", + "name": "EntryPoint", + "printedName": "ShopifyCheckoutKit.MetaData.EntryPoint", + "usr": "s:18ShopifyCheckoutKit8MetaDataO10EntryPointO" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit9UserAgentO6string8platform10entryPointSSAA8PlatformVSg_AA8MetaDataO05EntryI0OSgtFZ", + "mangledName": "$s18ShopifyCheckoutKit9UserAgentO6string8platform10entryPointSSAA8PlatformVSg_AA8MetaDataO05EntryI0OSgtFZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "isInternal": true, + "funcSelfKind": "NonMutating" + } + ], + "declKind": "Enum", + "usr": "s:18ShopifyCheckoutKit9UserAgentO", + "mangledName": "$s18ShopifyCheckoutKit9UserAgentO", + "moduleName": "ShopifyCheckoutKit", + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "WindowOpenRequest", + "printedName": "WindowOpenRequest", "children": [ { "kind": "Var", - "name": "current", - "printedName": "current", + "name": "url", + "printedName": "url", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvpZ", - "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvpZ", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV3url10Foundation3URLVvp", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV3url10Foundation3URLVvp", "moduleName": "ShopifyCheckoutKit", - "static": true, - "isInternal": true, "declAttributes": [ - "HasInitialValue", "HasStorage" ], "isLet": true, @@ -6027,38 +6820,116 @@ "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvgZ", - "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO7currentSSSgvgZ", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV3url10Foundation3URLVvg", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV3url10Foundation3URLVvg", "moduleName": "ShopifyCheckoutKit", - "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(url:)", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenRequest", + "printedName": "ShopifyCheckoutKit.WindowOpenRequest", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV" + }, + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + } + ], + "declKind": "Constructor", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV3urlAC10Foundation3URLV_tcfc", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV3urlAC10Foundation3URLV_tcfc", + "moduleName": "ShopifyCheckoutKit", + "init_kind": "Designated" + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(from:)", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenRequest", + "printedName": "ShopifyCheckoutKit.WindowOpenRequest", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV" + }, + { + "kind": "TypeNominal", + "name": "Decoder", + "printedName": "any Swift.Decoder", + "usr": "s:s7DecoderP" + } + ], + "declKind": "Constructor", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV4fromACs7Decoder_p_tKcfc", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV4fromACs7Decoder_p_tKcfc", + "moduleName": "ShopifyCheckoutKit", + "throwing": true, + "init_kind": "Designated" + }, + { + "kind": "Function", + "name": "encode", + "printedName": "encode(to:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "Encoder", + "printedName": "any Swift.Encoder", + "usr": "s:s7EncoderP" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV6encode2toys7Encoder_p_tKF", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV6encode2toys7Encoder_p_tKF", + "moduleName": "ShopifyCheckoutKit", + "throwing": true, + "funcSelfKind": "NonMutating" } ], - "declKind": "Enum", - "usr": "s:18ShopifyCheckoutKit12SwiftVersionO", - "mangledName": "$s18ShopifyCheckoutKit12SwiftVersionO", + "declKind": "Struct", + "usr": "s:18ShopifyCheckoutKit17WindowOpenRequestV", + "mangledName": "$s18ShopifyCheckoutKit17WindowOpenRequestV", "moduleName": "ShopifyCheckoutKit", - "isInternal": true, - "isEnumExhaustive": true, "conformances": [ + { + "kind": "Conformance", + "name": "EventPayload", + "printedName": "EventPayload", + "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP" + }, + { + "kind": "Conformance", + "name": "Decodable", + "printedName": "Decodable", + "usr": "s:Se", + "mangledName": "$sSe" + }, { "kind": "Conformance", "name": "Sendable", @@ -6066,6 +6937,13 @@ "usr": "s:s8SendableP", "mangledName": "$ss8SendableP" }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, { "kind": "Conformance", "name": "Copyable", @@ -6079,78 +6957,175 @@ "printedName": "Escapable", "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" } ] }, { "kind": "TypeDecl", - "name": "UserAgent", - "printedName": "UserAgent", + "name": "WindowOpenResult", + "printedName": "WindowOpenResult", "children": [ { - "kind": "Function", - "name": "string", - "printedName": "string(platform:entryPoint:)", + "kind": "Var", + "name": "success", + "printedName": "success", "children": [ { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.Platform?", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.WindowOpenResult.Type) -> ShopifyCheckoutKit.WindowOpenResult", "children": [ { "kind": "TypeNominal", - "name": "Platform", - "printedName": "ShopifyCheckoutKit.Platform", - "usr": "s:18ShopifyCheckoutKit8PlatformV" + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.WindowOpenResult.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + } + ] } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO7successyA2CmF", + "mangledName": "$s18ShopifyCheckoutKit16WindowOpenResultO7successyA2CmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Var", + "name": "rejected", + "printedName": "rejected", + "children": [ { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.MetaData.EntryPoint?", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.WindowOpenResult.Type) -> (Swift.String?) -> ShopifyCheckoutKit.WindowOpenResult", "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.String?) -> ShopifyCheckoutKit.WindowOpenResult", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + }, + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(reason: Swift.String?)", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + } + ] + } + ] + }, { "kind": "TypeNominal", - "name": "EntryPoint", - "printedName": "ShopifyCheckoutKit.MetaData.EntryPoint", - "usr": "s:18ShopifyCheckoutKit8MetaDataO10EntryPointO" + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.WindowOpenResult.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "WindowOpenResult", + "printedName": "ShopifyCheckoutKit.WindowOpenResult", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO" + } + ] } - ], - "hasDefaultArg": true, - "usr": "s:Sq" + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO8rejectedyACSSSg_tcACmF", + "mangledName": "$s18ShopifyCheckoutKit16WindowOpenResultO8rejectedyACSSSg_tcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Function", + "name": "encode", + "printedName": "encode(to:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "Encoder", + "printedName": "any Swift.Encoder", + "usr": "s:s7EncoderP" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit9UserAgentO6string8platform10entryPointSSAA8PlatformVSg_AA8MetaDataO05EntryI0OSgtFZ", - "mangledName": "$s18ShopifyCheckoutKit9UserAgentO6string8platform10entryPointSSAA8PlatformVSg_AA8MetaDataO05EntryI0OSgtFZ", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO6encode2toys7Encoder_p_tKF", + "mangledName": "$s18ShopifyCheckoutKit16WindowOpenResultO6encode2toys7Encoder_p_tKF", "moduleName": "ShopifyCheckoutKit", - "static": true, - "isInternal": true, + "throwing": true, "funcSelfKind": "NonMutating" } ], "declKind": "Enum", - "usr": "s:18ShopifyCheckoutKit9UserAgentO", - "mangledName": "$s18ShopifyCheckoutKit9UserAgentO", + "usr": "s:18ShopifyCheckoutKit16WindowOpenResultO", + "mangledName": "$s18ShopifyCheckoutKit16WindowOpenResultO", "moduleName": "ShopifyCheckoutKit", "isEnumExhaustive": true, "conformances": [ + { + "kind": "Conformance", + "name": "ResponsePayload", + "printedName": "ResponsePayload", + "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP" + }, + { + "kind": "Conformance", + "name": "Encodable", + "printedName": "Encodable", + "usr": "s:SE", + "mangledName": "$sSE" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, { "kind": "Conformance", "name": "Copyable", @@ -6172,8 +7147,8 @@ "name": "Client", "printedName": "Client", "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientV", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV", "moduleName": "ShopifyCheckoutProtocol", "isFromExtension": true, "isExternal": true, diff --git a/platforms/swift/api/ShopifyCheckoutProtocol.json b/platforms/swift/api/ShopifyCheckoutProtocol.json index 15d3f7bd..fce1b01f 100644 --- a/platforms/swift/api/ShopifyCheckoutProtocol.json +++ b/platforms/swift/api/ShopifyCheckoutProtocol.json @@ -41,8 +41,8 @@ }, { "kind": "TypeDecl", - "name": "CheckoutProtocol", - "printedName": "CheckoutProtocol", + "name": "CheckoutTransport", + "printedName": "CheckoutTransport", "children": [ { "kind": "Var", @@ -57,8 +57,8 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O11specVersionSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O11specVersionSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -81,8 +81,8 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O11specVersionSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O11specVersionSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -95,9 +95,422 @@ }, { "kind": "Var", - "name": "defaultDelegations", - "printedName": "defaultDelegations", + "name": "readyMethod", + "printedName": "readyMethod", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "parseErrorCode", + "printedName": "parseErrorCode", + "children": [ + { + "kind": "TypeNominal", + "name": "Int", + "printedName": "Swift.Int", + "usr": "s:Si" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivpZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Int", + "printedName": "Swift.Int", + "usr": "s:Si" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivgZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "parseErrorMessage", + "printedName": "parseErrorMessage", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Function", + "name": "url", + "printedName": "url(for:delegations:)", + "children": [ + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "hasDefaultArg": true, + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isFromExtension": true, + "funcSelfKind": "NonMutating" + }, + { + "kind": "TypeDecl", + "name": "Client", + "printedName": "Client", + "children": [ + { + "kind": "Constructor", + "name": "init", + "printedName": "init()", + "children": [ + { + "kind": "TypeNominal", + "name": "Client", + "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + } + ], + "declKind": "Constructor", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientVAEycfc", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientVAEycfc", + "moduleName": "ShopifyCheckoutProtocol", + "init_kind": "Designated" + }, + { + "kind": "Function", + "name": "on", + "printedName": "on(_:perform:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Client", + "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + }, + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor

", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "P" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(P) -> Swift.Void", + "children": [ + { + "kind": "TypeNameAlias", + "name": "Void", + "printedName": "Swift.Void", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "P" + } + ] + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "

", + "declAttributes": [ + "DiscardableResult" + ], + "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "on", + "printedName": "on(_:perform:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Client", + "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + }, + { + "kind": "TypeNominal", + "name": "DelegationDescriptor", + "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "P" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "R" + } + ], + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(P) async -> R", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "R" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "P" + } + ] + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "declAttributes": [ + "DiscardableResult" + ], + "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "process", + "printedName": "process(_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV7processySSSgSSYaF", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV7processySSSgSSYaF", + "moduleName": "ShopifyCheckoutProtocol", + "funcSelfKind": "NonMutating" + } + ], + "declKind": "Struct", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV", + "moduleName": "ShopifyCheckoutProtocol", + "isFromExtension": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "Function", + "name": "acknowledgeReady", + "printedName": "acknowledgeReady(_:supportedDelegations:)", "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, { "kind": "TypeNominal", "name": "Array", @@ -110,12 +523,652 @@ "usr": "s:SS" } ], - "usr": "s:Sa" + "hasDefaultArg": true, + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isFromExtension": true, + "funcSelfKind": "NonMutating" + } + ], + "declKind": "Enum", + "usr": "s:23ShopifyCheckoutProtocol0B9TransportO", + "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO", + "moduleName": "ShopifyCheckoutProtocol", + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "EventPayload", + "printedName": "EventPayload", + "declKind": "Protocol", + "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Decodable", + "printedName": "Decodable", + "usr": "s:Se", + "mangledName": "$sSe" + } + ] + }, + { + "kind": "TypeDecl", + "name": "ResponsePayload", + "printedName": "ResponsePayload", + "declKind": "Protocol", + "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Encodable", + "printedName": "Encodable", + "usr": "s:SE", + "mangledName": "$sSE" + } + ] + }, + { + "kind": "TypeDecl", + "name": "NotificationDescriptor", + "printedName": "NotificationDescriptor", + "children": [ + { + "kind": "Var", + "name": "method", + "printedName": "method", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", + "moduleName": "ShopifyCheckoutProtocol", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + } + ], + "declKind": "Struct", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "DelegationDescriptor", + "printedName": "DelegationDescriptor", + "children": [ + { + "kind": "Var", + "name": "method", + "printedName": "method", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", + "moduleName": "ShopifyCheckoutProtocol", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "delegation", + "printedName": "delegation", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", + "moduleName": "ShopifyCheckoutProtocol", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(method:delegation:decode:)", + "children": [ + { + "kind": "TypeNominal", + "name": "DelegationDescriptor", + "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Payload" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Result" + } + ], + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Foundation.Data) -> Payload?", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Payload?", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Payload" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "Data", + "printedName": "Foundation.Data", + "usr": "s:10Foundation4DataV" + } + ] + } + ], + "declKind": "Constructor", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "init_kind": "Designated" + } + ], + "declKind": "Struct", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "GeneratedProtocolCatalog", + "printedName": "GeneratedProtocolCatalog", + "children": [ + { + "kind": "Var", + "name": "ecReady", + "printedName": "ecReady", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "ecAuth", + "printedName": "ecAuth", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "ecError", + "printedName": "ecError", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "ecStart", + "printedName": "ecStart", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O18defaultDelegationsSaySSGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O18defaultDelegationsSaySSGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -132,22 +1185,22 @@ "children": [ { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], - "usr": "s:Sa" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O18defaultDelegationsSaySSGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O18defaultDelegationsSaySSGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -160,22 +1213,29 @@ }, { "kind": "Var", - "name": "readyMethod", - "printedName": "readyMethod", + "name": "ecComplete", + "printedName": "ecComplete", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O11readyMethodSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O11readyMethodSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -190,40 +1250,57 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O11readyMethodSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O11readyMethodSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { "kind": "Var", - "name": "parseErrorCode", - "printedName": "parseErrorCode", + "name": "ecMessagesChange", + "printedName": "ecMessagesChange", "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O14parseErrorCodeSivpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O14parseErrorCodeSivpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -238,40 +1315,57 @@ "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O14parseErrorCodeSivgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O14parseErrorCodeSivgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { "kind": "Var", - "name": "parseErrorMessage", - "printedName": "parseErrorMessage", + "name": "ecLineItemsChange", + "printedName": "ecLineItemsChange", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O17parseErrorMessageSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O17parseErrorMessageSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -286,40 +1380,57 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O17parseErrorMessageSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O17parseErrorMessageSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { "kind": "Var", - "name": "methodNotFoundCode", - "printedName": "methodNotFoundCode", + "name": "ecBuyerChange", + "printedName": "ecBuyerChange", "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O18methodNotFoundCodeSivpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O18methodNotFoundCodeSivpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -334,40 +1445,57 @@ "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O18methodNotFoundCodeSivgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O18methodNotFoundCodeSivgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { "kind": "Var", - "name": "methodNotFoundMessage", - "printedName": "methodNotFoundMessage", + "name": "ecTotalsChange", + "printedName": "ecTotalsChange", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O21methodNotFoundMessageSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O21methodNotFoundMessageSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -382,26 +1510,36 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O21methodNotFoundMessageSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O21methodNotFoundMessageSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { "kind": "Var", - "name": "complete", - "printedName": "complete", + "name": "ecPaymentChange", + "printedName": "ecPaymentChange", "children": [ { "kind": "TypeNominal", @@ -419,8 +1557,8 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O8completeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O8completeAA22NotificationDescriptorVyAA0B0VGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -451,8 +1589,8 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O8completeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O8completeAA22NotificationDescriptorVyAA0B0VGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -465,27 +1603,27 @@ }, { "kind": "Var", - "name": "error", - "printedName": "error", + "name": "ecPaymentInstrumentsChangeRequest", + "printedName": "ecPaymentInstrumentsChangeRequest", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -503,21 +1641,21 @@ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -530,8 +1668,8 @@ }, { "kind": "Var", - "name": "lineItemsChange", - "printedName": "lineItemsChange", + "name": "ecPaymentCredentialRequest", + "printedName": "ecPaymentCredentialRequest", "children": [ { "kind": "TypeNominal", @@ -549,8 +1687,8 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -581,8 +1719,8 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -595,27 +1733,27 @@ }, { "kind": "Var", - "name": "messagesChange", - "printedName": "messagesChange", + "name": "ecWindowOpenRequest", + "printedName": "ecWindowOpenRequest", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O14messagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O14messagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -633,21 +1771,21 @@ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O14messagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O14messagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -660,8 +1798,8 @@ }, { "kind": "Var", - "name": "start", - "printedName": "start", + "name": "ecFulfillmentChange", + "printedName": "ecFulfillmentChange", "children": [ { "kind": "TypeNominal", @@ -679,8 +1817,8 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O5startAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O5startAA22NotificationDescriptorVyAA0B0VGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -711,8 +1849,8 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O5startAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O5startAA22NotificationDescriptorVyAA0B0VGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -725,8 +1863,8 @@ }, { "kind": "Var", - "name": "totalsChange", - "printedName": "totalsChange", + "name": "ecFulfillmentAddressChangeRequest", + "printedName": "ecFulfillmentAddressChangeRequest", "children": [ { "kind": "TypeNominal", @@ -744,8 +1882,8 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O12totalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O12totalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ @@ -776,8 +1914,8 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O12totalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O12totalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, @@ -790,30 +1928,29 @@ }, { "kind": "Var", - "name": "supportedProtocolMethods", - "printedName": "supportedProtocolMethods", + "name": "epCartReady", + "printedName": "epCartReady", "children": [ { "kind": "TypeNominal", - "name": "Set", - "printedName": "Swift.Set", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "usr": "s:Sh" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O09supportedC7MethodsShySSGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O09supportedC7MethodsShySSGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, "declAttributes": [ "HasInitialValue", "HasStorage" @@ -828,432 +1965,256 @@ "children": [ { "kind": "TypeNominal", - "name": "Set", - "printedName": "Swift.Set", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "usr": "s:Sh" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O09supportedC7MethodsShySSGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O09supportedC7MethodsShySSGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { - "kind": "Function", - "name": "supportedProtocolMethod", - "printedName": "supportedProtocolMethod(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O09supportedC6MethodySSSgSSFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O09supportedC6MethodySSSgSSFZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isInternal": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "methodNotFoundResponse", - "printedName": "methodNotFoundResponse(forUnsupportedProtocolRequest:)", + "kind": "Var", + "name": "epCartAuth", + "printedName": "epCartAuth", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O22methodNotFoundResponse014forUnsupportedC7RequestSSSgSS_tFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O22methodNotFoundResponse014forUnsupportedC7RequestSSSgSS_tFZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isInternal": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "url", - "printedName": "url(for:delegations:)", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - }, - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - }, - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sa" - } + "declAttributes": [ + "HasInitialValue", + "HasStorage" ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "TypeDecl", - "name": "Client", - "printedName": "Client", - "children": [ - { - "kind": "Constructor", - "name": "init", - "printedName": "init()", - "children": [ - { - "kind": "TypeNominal", - "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutProtocol.Client", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV" - } - ], - "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientVAEycfc", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientVAEycfc", - "moduleName": "ShopifyCheckoutProtocol", - "init_kind": "Designated" - }, + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "Function", - "name": "on", - "printedName": "on(_:perform:)", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ - { - "kind": "TypeNominal", - "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutProtocol.Client", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV" - }, { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor

", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "P" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - }, - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(P) -> Swift.Void", - "children": [ - { - "kind": "TypeNameAlias", - "name": "Void", - "printedName": "Swift.Void", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ] - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "P" - } - ] - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "

", - "declAttributes": [ - "DiscardableResult" - ], - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "on", - "printedName": "on(_:perform:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutProtocol.Client", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV" - }, - { - "kind": "TypeNominal", - "name": "DelegationDescriptor", - "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "P" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "R" - } - ], - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" - }, - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(P) async -> R", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "R" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "P" - } - ] - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseJ0R_r0_lF", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseJ0R_r0_lF", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "declAttributes": [ - "DiscardableResult" - ], - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "process", - "printedName": "process(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" } ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV7processySSSgSSYaF", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientV7processySSSgSSYaF", + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol0bC0O6ClientV", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O6ClientV", - "moduleName": "ShopifyCheckoutProtocol", - "isFromExtension": true, - "conformances": [ - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } ] }, { - "kind": "Function", - "name": "acknowledgeReady", - "printedName": "acknowledgeReady(_:supportedDelegations:)", + "kind": "Var", + "name": "epCartError", + "printedName": "epCartError", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" } ], - "usr": "s:Sq" - }, + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "epCartStart", + "printedName": "epCartStart", + "children": [ { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "hasDefaultArg": true, - "usr": "s:Sa" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0bC0O16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] }, { "kind": "Var", - "name": "windowOpen", - "printedName": "windowOpen", + "name": "epCartComplete", + "printedName": "epCartComplete", "children": [ { "kind": "TypeNominal", - "name": "DelegationDescriptor", - "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "WindowOpenRequest", - "printedName": "ShopifyCheckoutProtocol.WindowOpenRequest", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV" - }, - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0bC0O10windowOpenAA20DelegationDescriptorVyAA06WindowE7RequestVAA0hE6ResultOGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O10windowOpenAA20DelegationDescriptorVyAA06WindowE7RequestVAA0hE6ResultOGvpZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "declAttributes": [ "HasInitialValue", "HasStorage" ], - "isFromExtension": true, "isLet": true, "hasStorage": true, "accessors": [ @@ -1264,178 +2225,59 @@ "children": [ { "kind": "TypeNominal", - "name": "DelegationDescriptor", - "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "WindowOpenRequest", - "printedName": "ShopifyCheckoutProtocol.WindowOpenRequest", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV" - }, - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0bC0O10windowOpenAA20DelegationDescriptorVyAA06WindowE7RequestVAA0hE6ResultOGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O10windowOpenAA20DelegationDescriptorVyAA06WindowE7RequestVAA0hE6ResultOGvgZ", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "implicit": true, "declAttributes": [ "Transparent" ], - "isFromExtension": true, "accessorKind": "get" } ] - } - ], - "declKind": "Enum", - "usr": "s:23ShopifyCheckoutProtocol0bC0O", - "mangledName": "$s23ShopifyCheckoutProtocol0bC0O", - "moduleName": "ShopifyCheckoutProtocol", - "isEnumExhaustive": true, - "conformances": [ - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "EventPayload", - "printedName": "EventPayload", - "declKind": "Protocol", - "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Decodable", - "printedName": "Decodable", - "usr": "s:Se", - "mangledName": "$sSe" - } - ] - }, - { - "kind": "TypeDecl", - "name": "ResponsePayload", - "printedName": "ResponsePayload", - "declKind": "Protocol", - "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Encodable", - "printedName": "Encodable", - "usr": "s:SE", - "mangledName": "$sSE" - } - ] - }, - { - "kind": "TypeDecl", - "name": "NotificationDescriptor", - "printedName": "NotificationDescriptor", - "children": [ { "kind": "Var", - "name": "method", - "printedName": "method", + "name": "epCartLineItemsChange", + "printedName": "epCartLineItemsChange", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", + "static": true, "declAttributes": [ + "HasInitialValue", "HasStorage" ], "isLet": true, @@ -1448,16 +2290,24 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", + "static": true, "implicit": true, "declAttributes": [ "Transparent" @@ -1465,66 +2315,34 @@ "accessorKind": "get" } ] - } - ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "DelegationDescriptor", - "printedName": "DelegationDescriptor", - "children": [ { "kind": "Var", - "name": "method", - "printedName": "method", + "name": "epCartBuyerChange", + "printedName": "epCartBuyerChange", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", + "static": true, "declAttributes": [ + "HasInitialValue", "HasStorage" ], "isLet": true, @@ -1537,16 +2355,24 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", + "static": true, "implicit": true, "declAttributes": [ "Transparent" @@ -1557,21 +2383,31 @@ }, { "kind": "Var", - "name": "delegation", - "printedName": "delegation", + "name": "epCartMessagesChange", + "printedName": "epCartMessagesChange", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", + "static": true, "declAttributes": [ + "HasInitialValue", "HasStorage" ], "isLet": true, @@ -1584,16 +2420,24 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", + "static": true, "implicit": true, "declAttributes": [ "Transparent" @@ -1603,95 +2447,77 @@ ] }, { - "kind": "Constructor", - "name": "init", - "printedName": "init(method:delegation:decode:)", + "kind": "Var", + "name": "allMethods", + "printedName": "allMethods", "children": [ { "kind": "TypeNominal", - "name": "DelegationDescriptor", - "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Payload" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Result" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, + "usr": "s:Sa" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Foundation.Data) -> Payload?", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "Payload?", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Payload" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "Data", - "printedName": "Foundation.Data", - "usr": "s:10Foundation4DataV" + "usr": "s:Sa" } - ] + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "init_kind": "Designated" + ] } ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV", + "declKind": "Enum", + "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO", + "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO", "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", + "isEnumExhaustive": true, "conformances": [ - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, { "kind": "Conformance", "name": "Copyable", @@ -58842,13 +59668,6 @@ "printedName": "Escapable", "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "ResponsePayload", - "printedName": "ResponsePayload", - "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP" } ] }, @@ -66729,13 +67548,6 @@ "printedName": "Escapable", "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "ResponsePayload", - "printedName": "ResponsePayload", - "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP" } ] }, @@ -67523,362 +68335,13 @@ "printedName": "Escapable", "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "WindowOpenRequest", - "printedName": "WindowOpenRequest", - "children": [ - { - "kind": "Var", - "name": "url", - "printedName": "url", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV3url10Foundation3URLVvp", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV3url10Foundation3URLVvp", - "moduleName": "ShopifyCheckoutProtocol", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV3url10Foundation3URLVvg", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV3url10Foundation3URLVvg", - "moduleName": "ShopifyCheckoutProtocol", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(url:)", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenRequest", - "printedName": "ShopifyCheckoutProtocol.WindowOpenRequest", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV" - }, - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - } - ], - "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV3urlAC10Foundation3URLV_tcfc", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV3urlAC10Foundation3URLV_tcfc", - "moduleName": "ShopifyCheckoutProtocol", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(from:)", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenRequest", - "printedName": "ShopifyCheckoutProtocol.WindowOpenRequest", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV" - }, - { - "kind": "TypeNominal", - "name": "Decoder", - "printedName": "any Swift.Decoder", - "usr": "s:s7DecoderP" - } - ], - "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV4fromACs7Decoder_p_tKcfc", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV4fromACs7Decoder_p_tKcfc", - "moduleName": "ShopifyCheckoutProtocol", - "throwing": true, - "init_kind": "Designated" }, - { - "kind": "Function", - "name": "encode", - "printedName": "encode(to:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Encoder", - "printedName": "any Swift.Encoder", - "usr": "s:s7EncoderP" - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV6encode2toys7Encoder_p_tKF", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV6encode2toys7Encoder_p_tKF", - "moduleName": "ShopifyCheckoutProtocol", - "throwing": true, - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol17WindowOpenRequestV", - "mangledName": "$s23ShopifyCheckoutProtocol17WindowOpenRequestV", - "moduleName": "ShopifyCheckoutProtocol", - "conformances": [ { "kind": "Conformance", "name": "EventPayload", "printedName": "EventPayload", "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP" - }, - { - "kind": "Conformance", - "name": "Decodable", - "printedName": "Decodable", - "usr": "s:Se", - "mangledName": "$sSe" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "WindowOpenResult", - "printedName": "WindowOpenResult", - "children": [ - { - "kind": "Var", - "name": "success", - "printedName": "success", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutProtocol.WindowOpenResult.Type) -> ShopifyCheckoutProtocol.WindowOpenResult", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO7successyA2CmF", - "mangledName": "$s23ShopifyCheckoutProtocol16WindowOpenResultO7successyA2CmF", - "moduleName": "ShopifyCheckoutProtocol" - }, - { - "kind": "Var", - "name": "rejected", - "printedName": "rejected", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutProtocol.WindowOpenResult.Type) -> (Swift.String?) -> ShopifyCheckoutProtocol.WindowOpenResult", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.String?) -> ShopifyCheckoutProtocol.WindowOpenResult", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" - }, - { - "kind": "TypeNominal", - "name": "Tuple", - "printedName": "(reason: Swift.String?)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - } - ] - } - ] - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "WindowOpenResult", - "printedName": "ShopifyCheckoutProtocol.WindowOpenResult", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO8rejectedyACSSSg_tcACmF", - "mangledName": "$s23ShopifyCheckoutProtocol16WindowOpenResultO8rejectedyACSSSg_tcACmF", - "moduleName": "ShopifyCheckoutProtocol" - }, - { - "kind": "Function", - "name": "encode", - "printedName": "encode(to:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Encoder", - "printedName": "any Swift.Encoder", - "usr": "s:s7EncoderP" - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO6encode2toys7Encoder_p_tKF", - "mangledName": "$s23ShopifyCheckoutProtocol16WindowOpenResultO6encode2toys7Encoder_p_tKF", - "moduleName": "ShopifyCheckoutProtocol", - "throwing": true, - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Enum", - "usr": "s:23ShopifyCheckoutProtocol16WindowOpenResultO", - "mangledName": "$s23ShopifyCheckoutProtocol16WindowOpenResultO", - "moduleName": "ShopifyCheckoutProtocol", - "isEnumExhaustive": true, - "conformances": [ - { - "kind": "Conformance", - "name": "ResponsePayload", - "printedName": "ResponsePayload", - "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP" - }, - { - "kind": "Conformance", - "name": "Encodable", - "printedName": "Encodable", - "usr": "s:SE", - "mangledName": "$sSE" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" } ] } diff --git a/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts b/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts index 06b18d43..631f9b2e 100644 --- a/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts +++ b/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts @@ -1,5 +1,5 @@ import { type Checkout, type ErrorResponse } from './Models'; -export declare const generatedCheckoutProtocol: { +export declare const checkoutProtocolCatalog: { readonly error: "ec.error"; readonly start: "ec.start"; readonly complete: "ec.complete"; @@ -8,9 +8,10 @@ export declare const generatedCheckoutProtocol: { readonly buyerChange: "ec.buyer.change"; readonly totalsChange: "ec.totals.change"; readonly paymentChange: "ec.payment.change"; + readonly fulfillmentChange: "ec.fulfillment.change"; }; -export type GeneratedCheckoutProtocolMethod = (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; -export interface GeneratedCheckoutProtocolPayloads { +export type CheckoutProtocolCatalogMethod = (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; +export interface CheckoutProtocolCatalogPayloads { 'ec.error': ErrorResponse; 'ec.start': Checkout; 'ec.complete': Checkout; @@ -19,9 +20,10 @@ export interface GeneratedCheckoutProtocolPayloads { 'ec.buyer.change': Checkout; 'ec.totals.change': Checkout; 'ec.payment.change': Checkout; + 'ec.fulfillment.change': Checkout; } -export type GeneratedCheckoutProtocolPayloadDecoder = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; -export declare const generatedCheckoutProtocolPayloadDecoders: { +export type CheckoutProtocolCatalogPayloadDecoder = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; +export declare const checkoutProtocolCatalogPayloadDecoders: { "ec.error": (payload: unknown) => ErrorResponse; "ec.start": (payload: unknown) => Checkout; "ec.complete": (payload: unknown) => Checkout; @@ -30,4 +32,5 @@ export declare const generatedCheckoutProtocolPayloadDecoders: { "ec.buyer.change": (payload: unknown) => Checkout; "ec.totals.change": (payload: unknown) => Checkout; "ec.payment.change": (payload: unknown) => Checkout; + "ec.fulfillment.change": (payload: unknown) => Checkout; }; diff --git a/protocol/languages/typescript/src/generated/ProtocolNotifications.ts b/protocol/languages/typescript/src/generated/ProtocolNotifications.ts index b88eb473..2f91eda6 100644 --- a/protocol/languages/typescript/src/generated/ProtocolNotifications.ts +++ b/protocol/languages/typescript/src/generated/ProtocolNotifications.ts @@ -3,7 +3,7 @@ import {Convert, type Checkout, type ErrorResponse} from './Models'; -export const generatedCheckoutProtocol = { +export const checkoutProtocolCatalog = { error: 'ec.error', start: 'ec.start', complete: 'ec.complete', @@ -15,10 +15,10 @@ export const generatedCheckoutProtocol = { fulfillmentChange: 'ec.fulfillment.change', } as const; -export type GeneratedCheckoutProtocolMethod = - (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; +export type CheckoutProtocolCatalogMethod = + (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; -export interface GeneratedCheckoutProtocolPayloads { +export interface CheckoutProtocolCatalogPayloads { 'ec.error': ErrorResponse; 'ec.start': Checkout; 'ec.complete': Checkout; @@ -30,23 +30,23 @@ export interface GeneratedCheckoutProtocolPayloads { 'ec.fulfillment.change': Checkout; } -export type GeneratedCheckoutProtocolPayloadDecoder< - K extends keyof GeneratedCheckoutProtocolPayloads, -> = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; +export type CheckoutProtocolCatalogPayloadDecoder< + K extends keyof CheckoutProtocolCatalogPayloads, +> = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; -export const generatedCheckoutProtocolPayloadDecoders = { - [generatedCheckoutProtocol.error]: decodeWith(Convert.toErrorResponse), - [generatedCheckoutProtocol.start]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.complete]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.messagesChange]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.lineItemsChange]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.buyerChange]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.totalsChange]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.paymentChange]: decodeWith(Convert.toCheckout), - [generatedCheckoutProtocol.fulfillmentChange]: decodeWith(Convert.toCheckout), +export const checkoutProtocolCatalogPayloadDecoders = { + [checkoutProtocolCatalog.error]: decodeWith(Convert.toErrorResponse), + [checkoutProtocolCatalog.start]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.complete]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.messagesChange]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.lineItemsChange]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.buyerChange]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.totalsChange]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.paymentChange]: decodeWith(Convert.toCheckout), + [checkoutProtocolCatalog.fulfillmentChange]: decodeWith(Convert.toCheckout), } satisfies { - [K in keyof GeneratedCheckoutProtocolPayloads]: - GeneratedCheckoutProtocolPayloadDecoder; + [K in keyof CheckoutProtocolCatalogPayloads]: + CheckoutProtocolCatalogPayloadDecoder; }; function decodeWith(converter: (json: string) => T): (payload: unknown) => T { diff --git a/protocol/scripts/generate_typescript_notifications.mjs b/protocol/scripts/generate_typescript_notifications.mjs index cd648cbf..9fcbc77d 100644 --- a/protocol/scripts/generate_typescript_notifications.mjs +++ b/protocol/scripts/generate_typescript_notifications.mjs @@ -133,7 +133,7 @@ function renderModule(notifications) { import {Convert, type ${typeNames.join(', type ')}} from './Models'; -export const generatedCheckoutProtocol = { +export const checkoutProtocolCatalog = { ${notifications .map( notification => ` ${notification.identifier}: '${notification.method}',`, @@ -141,10 +141,10 @@ ${notifications .join('\n')} } as const; -export type GeneratedCheckoutProtocolMethod = - (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; +export type CheckoutProtocolCatalogMethod = + (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; -export interface GeneratedCheckoutProtocolPayloads { +export interface CheckoutProtocolCatalogPayloads { ${notifications .map( notification => ` '${notification.method}': ${notification.typeName};`, @@ -152,20 +152,20 @@ ${notifications .join('\n')} } -export type GeneratedCheckoutProtocolPayloadDecoder< - K extends keyof GeneratedCheckoutProtocolPayloads, -> = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; +export type CheckoutProtocolCatalogPayloadDecoder< + K extends keyof CheckoutProtocolCatalogPayloads, +> = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; -export const generatedCheckoutProtocolPayloadDecoders = { +export const checkoutProtocolCatalogPayloadDecoders = { ${notifications .map( notification => - ` [generatedCheckoutProtocol.${notification.identifier}]: decodeWith(${notification.converter}),`, + ` [checkoutProtocolCatalog.${notification.identifier}]: decodeWith(${notification.converter}),`, ) .join('\n')} } satisfies { - [K in keyof GeneratedCheckoutProtocolPayloads]: - GeneratedCheckoutProtocolPayloadDecoder; + [K in keyof CheckoutProtocolCatalogPayloads]: + CheckoutProtocolCatalogPayloadDecoder; }; function decodeWith(converter: (json: string) => T): (payload: unknown) => T { diff --git a/protocol/scripts/generate_typescript_notifications.test.mjs b/protocol/scripts/generate_typescript_notifications.test.mjs index 94e1bd2d..4a244e7a 100644 --- a/protocol/scripts/generate_typescript_notifications.test.mjs +++ b/protocol/scripts/generate_typescript_notifications.test.mjs @@ -1,8 +1,8 @@ import {test, expect} from 'vitest'; import { - generatedCheckoutProtocol, - generatedCheckoutProtocolPayloadDecoders, + checkoutProtocolCatalog, + checkoutProtocolCatalogPayloadDecoders, } from '../languages/typescript/src/generated/ProtocolNotifications'; const EXPECTED_PROTOCOL = { @@ -27,21 +27,21 @@ const EXPECTED_REQUEST_METHODS = [ ]; test('exposes exactly the ec.* notification protocol map', () => { - expect({...generatedCheckoutProtocol}).toEqual(EXPECTED_PROTOCOL); + expect({...checkoutProtocolCatalog}).toEqual(EXPECTED_PROTOCOL); }); test('wires a payload decoder for every notification method', () => { - expect(Object.keys(generatedCheckoutProtocolPayloadDecoders).sort()).toEqual( + expect(Object.keys(checkoutProtocolCatalogPayloadDecoders).sort()).toEqual( Object.values(EXPECTED_PROTOCOL).sort(), ); - for (const decode of Object.values(generatedCheckoutProtocolPayloadDecoders)) { + for (const decode of Object.values(checkoutProtocolCatalogPayloadDecoders)) { expect(typeof decode).toBe('function'); } }); test('excludes ec.* request methods that define a result', () => { - const methods = Object.values(generatedCheckoutProtocol); + const methods = Object.values(checkoutProtocolCatalog); for (const requestMethod of EXPECTED_REQUEST_METHODS) { expect( From 4c14955ec97a1c780b2310a4203d1ec5f4635f77 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 12:10:34 +0100 Subject: [PATCH 3/7] Make defaultDelegations internal, abstract delegations from url method --- .../swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift | 6 +++--- .../Sources/ShopifyCheckoutKit/CheckoutViewController.swift | 2 +- .../Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift index 94cbea83..e48047c7 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift @@ -6,11 +6,11 @@ import Foundation public enum CheckoutProtocol { public typealias Client = CheckoutTransport.Client - public static func url(for url: URL, delegations: [String] = []) -> URL { - CheckoutTransport.url(for: url, delegations: delegations) + public static func url(for url: URL) -> URL { + CheckoutTransport.url(for: url, delegations: defaultDelegations) } - public static let defaultDelegations: [String] = ["window.open"] + static let defaultDelegations: [String] = ["window.open"] static let methodNotFoundCode = -32601 static let methodNotFoundMessage = "Method not found" diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift index d9641a8b..0f59fc30 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift @@ -33,7 +33,7 @@ public struct ShopifyCheckout: UIViewControllerRepresentable, CheckoutConfigurab var onFailAction: ((CheckoutError) -> Void)? public init(checkout url: URL) { - checkoutURL = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) + checkoutURL = CheckoutProtocol.url(for: url) } public func makeUIViewController(context _: Self.Context) -> CheckoutViewController { diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift b/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift index 0ec705c8..32f56790 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift @@ -48,7 +48,7 @@ public func preload(checkout url: URL) { return } - let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) + let decorated = CheckoutProtocol.url(for: url) CheckoutWebView.preload(checkout: decorated) } @@ -61,7 +61,7 @@ public func invalidate() { @MainActor @discardableResult public func present(checkout url: URL, from: UIViewController, delegate: (any CheckoutDelegate)? = nil, client: (any CheckoutCommunicationProtocol)? = nil) -> CheckoutViewController { - let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) + let decorated = CheckoutProtocol.url(for: url) let viewController = CheckoutViewController(checkout: decorated, delegate: delegate, client: client) from.present(viewController, animated: true) return viewController @@ -70,7 +70,7 @@ public func present(checkout url: URL, from: UIViewController, delegate: (any Ch @MainActor @discardableResult package func present(checkout url: URL, from: UIViewController, entryPoint: MetaData.EntryPoint, delegate: (any CheckoutDelegate)? = nil, client: (any CheckoutCommunicationProtocol)? = nil) -> CheckoutViewController { - let decorated = CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations) + let decorated = CheckoutProtocol.url(for: url) let viewController = CheckoutViewController(checkout: decorated, delegate: delegate, client: client, entryPoint: entryPoint) from.present(viewController, animated: true) return viewController From c8cf90ed05a3fdb4bf428ba678a0b93c1dc308e3 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 12:36:32 +0100 Subject: [PATCH 4/7] Swift: dump API --- platforms/swift/api/ShopifyCheckoutKit.json | 86 +-------------------- 1 file changed, 3 insertions(+), 83 deletions(-) diff --git a/platforms/swift/api/ShopifyCheckoutKit.json b/platforms/swift/api/ShopifyCheckoutKit.json index 25688344..a637e6cd 100644 --- a/platforms/swift/api/ShopifyCheckoutKit.json +++ b/platforms/swift/api/ShopifyCheckoutKit.json @@ -1087,7 +1087,7 @@ { "kind": "Function", "name": "url", - "printedName": "url(for:delegations:)", + "printedName": "url(for:)", "children": [ { "kind": "TypeNominal", @@ -1100,95 +1100,15 @@ "name": "URL", "printedName": "Foundation.URL", "usr": "s:10Foundation3URLV" - }, - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sa" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B8ProtocolO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "usr": "s:18ShopifyCheckoutKit0B8ProtocolO3url3for10Foundation3URLVAH_tFZ", + "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO3url3for10Foundation3URLVAH_tFZ", "moduleName": "ShopifyCheckoutKit", "static": true, "funcSelfKind": "NonMutating" }, - { - "kind": "Var", - "name": "defaultDelegations", - "printedName": "defaultDelegations", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvpZ", - "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvpZ", - "moduleName": "ShopifyCheckoutKit", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvgZ", - "mangledName": "$s18ShopifyCheckoutKit0B8ProtocolO18defaultDelegationsSaySSGvgZ", - "moduleName": "ShopifyCheckoutKit", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, { "kind": "Var", "name": "complete", From ff95baecf349ff8c708c57c62f410c9707a13ce4 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 14:26:48 +0100 Subject: [PATCH 5/7] Drop TS changes --- .../src/generated/ProtocolNotifications.d.ts | 13 ++- .../src/generated/ProtocolNotifications.ts | 38 ++++----- protocol/languages/typescript/src/index.d.ts | 2 +- protocol/languages/typescript/src/index.ts | 2 +- .../typescript/src/notifications.d.ts | 14 ++++ .../languages/typescript/src/notifications.ts | 81 +++++++++++++++++++ .../generate_typescript_notifications.mjs | 22 ++--- ...generate_typescript_notifications.test.mjs | 12 +-- 8 files changed, 138 insertions(+), 46 deletions(-) create mode 100644 protocol/languages/typescript/src/notifications.d.ts create mode 100644 protocol/languages/typescript/src/notifications.ts diff --git a/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts b/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts index 631f9b2e..06b18d43 100644 --- a/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts +++ b/protocol/languages/typescript/src/generated/ProtocolNotifications.d.ts @@ -1,5 +1,5 @@ import { type Checkout, type ErrorResponse } from './Models'; -export declare const checkoutProtocolCatalog: { +export declare const generatedCheckoutProtocol: { readonly error: "ec.error"; readonly start: "ec.start"; readonly complete: "ec.complete"; @@ -8,10 +8,9 @@ export declare const checkoutProtocolCatalog: { readonly buyerChange: "ec.buyer.change"; readonly totalsChange: "ec.totals.change"; readonly paymentChange: "ec.payment.change"; - readonly fulfillmentChange: "ec.fulfillment.change"; }; -export type CheckoutProtocolCatalogMethod = (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; -export interface CheckoutProtocolCatalogPayloads { +export type GeneratedCheckoutProtocolMethod = (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; +export interface GeneratedCheckoutProtocolPayloads { 'ec.error': ErrorResponse; 'ec.start': Checkout; 'ec.complete': Checkout; @@ -20,10 +19,9 @@ export interface CheckoutProtocolCatalogPayloads { 'ec.buyer.change': Checkout; 'ec.totals.change': Checkout; 'ec.payment.change': Checkout; - 'ec.fulfillment.change': Checkout; } -export type CheckoutProtocolCatalogPayloadDecoder = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; -export declare const checkoutProtocolCatalogPayloadDecoders: { +export type GeneratedCheckoutProtocolPayloadDecoder = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; +export declare const generatedCheckoutProtocolPayloadDecoders: { "ec.error": (payload: unknown) => ErrorResponse; "ec.start": (payload: unknown) => Checkout; "ec.complete": (payload: unknown) => Checkout; @@ -32,5 +30,4 @@ export declare const checkoutProtocolCatalogPayloadDecoders: { "ec.buyer.change": (payload: unknown) => Checkout; "ec.totals.change": (payload: unknown) => Checkout; "ec.payment.change": (payload: unknown) => Checkout; - "ec.fulfillment.change": (payload: unknown) => Checkout; }; diff --git a/protocol/languages/typescript/src/generated/ProtocolNotifications.ts b/protocol/languages/typescript/src/generated/ProtocolNotifications.ts index 2f91eda6..b88eb473 100644 --- a/protocol/languages/typescript/src/generated/ProtocolNotifications.ts +++ b/protocol/languages/typescript/src/generated/ProtocolNotifications.ts @@ -3,7 +3,7 @@ import {Convert, type Checkout, type ErrorResponse} from './Models'; -export const checkoutProtocolCatalog = { +export const generatedCheckoutProtocol = { error: 'ec.error', start: 'ec.start', complete: 'ec.complete', @@ -15,10 +15,10 @@ export const checkoutProtocolCatalog = { fulfillmentChange: 'ec.fulfillment.change', } as const; -export type CheckoutProtocolCatalogMethod = - (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; +export type GeneratedCheckoutProtocolMethod = + (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; -export interface CheckoutProtocolCatalogPayloads { +export interface GeneratedCheckoutProtocolPayloads { 'ec.error': ErrorResponse; 'ec.start': Checkout; 'ec.complete': Checkout; @@ -30,23 +30,23 @@ export interface CheckoutProtocolCatalogPayloads { 'ec.fulfillment.change': Checkout; } -export type CheckoutProtocolCatalogPayloadDecoder< - K extends keyof CheckoutProtocolCatalogPayloads, -> = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; +export type GeneratedCheckoutProtocolPayloadDecoder< + K extends keyof GeneratedCheckoutProtocolPayloads, +> = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; -export const checkoutProtocolCatalogPayloadDecoders = { - [checkoutProtocolCatalog.error]: decodeWith(Convert.toErrorResponse), - [checkoutProtocolCatalog.start]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.complete]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.messagesChange]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.lineItemsChange]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.buyerChange]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.totalsChange]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.paymentChange]: decodeWith(Convert.toCheckout), - [checkoutProtocolCatalog.fulfillmentChange]: decodeWith(Convert.toCheckout), +export const generatedCheckoutProtocolPayloadDecoders = { + [generatedCheckoutProtocol.error]: decodeWith(Convert.toErrorResponse), + [generatedCheckoutProtocol.start]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.complete]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.messagesChange]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.lineItemsChange]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.buyerChange]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.totalsChange]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.paymentChange]: decodeWith(Convert.toCheckout), + [generatedCheckoutProtocol.fulfillmentChange]: decodeWith(Convert.toCheckout), } satisfies { - [K in keyof CheckoutProtocolCatalogPayloads]: - CheckoutProtocolCatalogPayloadDecoder; + [K in keyof GeneratedCheckoutProtocolPayloads]: + GeneratedCheckoutProtocolPayloadDecoder; }; function decodeWith(converter: (json: string) => T): (payload: unknown) => T { diff --git a/protocol/languages/typescript/src/index.d.ts b/protocol/languages/typescript/src/index.d.ts index e4d8ca2b..9f217a84 100644 --- a/protocol/languages/typescript/src/index.d.ts +++ b/protocol/languages/typescript/src/index.d.ts @@ -1,2 +1,2 @@ export * from './generated/Models'; -export * from './generated/ProtocolNotifications'; +export * from './notifications'; diff --git a/protocol/languages/typescript/src/index.ts b/protocol/languages/typescript/src/index.ts index e4d8ca2b..9f217a84 100644 --- a/protocol/languages/typescript/src/index.ts +++ b/protocol/languages/typescript/src/index.ts @@ -1,2 +1,2 @@ export * from './generated/Models'; -export * from './generated/ProtocolNotifications'; +export * from './notifications'; diff --git a/protocol/languages/typescript/src/notifications.d.ts b/protocol/languages/typescript/src/notifications.d.ts new file mode 100644 index 00000000..c4d53311 --- /dev/null +++ b/protocol/languages/typescript/src/notifications.d.ts @@ -0,0 +1,14 @@ +import { type GeneratedCheckoutProtocolPayloads } from './generated/ProtocolNotifications'; +export declare const CheckoutProtocol: { + readonly complete: "ec.complete"; + readonly error: "ec.error"; + readonly lineItemsChange: "ec.line_items.change"; + readonly messagesChange: "ec.messages.change"; + readonly start: "ec.start"; + readonly totalsChange: "ec.totals.change"; +}; +export type CheckoutProtocolMethod = (typeof CheckoutProtocol)[keyof typeof CheckoutProtocol]; +export type CheckoutProtocolPayloads = Pick; +export type CheckoutProtocolPayloadDecoder = (payload: unknown) => CheckoutProtocolPayloads[K]; +export declare function decodeCheckoutProtocolPayload(method: K, payload: unknown): CheckoutProtocolPayloads[K]; +export declare function decodeCheckoutProtocolPayload(method: string, payload: unknown): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined; diff --git a/protocol/languages/typescript/src/notifications.ts b/protocol/languages/typescript/src/notifications.ts new file mode 100644 index 00000000..16cc25cb --- /dev/null +++ b/protocol/languages/typescript/src/notifications.ts @@ -0,0 +1,81 @@ +import { + generatedCheckoutProtocol, + generatedCheckoutProtocolPayloadDecoders, + type GeneratedCheckoutProtocolPayloads, +} from './generated/ProtocolNotifications'; + +// Public Checkout Kit notification events. The full notification contract is +// generated from protocol/services/shopping/embedded.openrpc.json; this module +// intentionally exposes the subset supported by the public SDKs. +type PublicCheckoutProtocolKey = + | 'complete' + | 'error' + | 'lineItemsChange' + | 'messagesChange' + | 'start' + | 'totalsChange'; + +export const CheckoutProtocol = { + complete: generatedCheckoutProtocol.complete, + error: generatedCheckoutProtocol.error, + lineItemsChange: generatedCheckoutProtocol.lineItemsChange, + messagesChange: generatedCheckoutProtocol.messagesChange, + start: generatedCheckoutProtocol.start, + totalsChange: generatedCheckoutProtocol.totalsChange, +} as const satisfies Pick; + +export type CheckoutProtocolMethod = + (typeof CheckoutProtocol)[keyof typeof CheckoutProtocol]; + +export type CheckoutProtocolPayloads = Pick< + GeneratedCheckoutProtocolPayloads, + CheckoutProtocolMethod +>; + +export type CheckoutProtocolPayloadDecoder< + K extends keyof CheckoutProtocolPayloads, +> = (payload: unknown) => CheckoutProtocolPayloads[K]; + +const checkoutProtocolPayloadDecoders = { + [CheckoutProtocol.complete]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.complete], + [CheckoutProtocol.error]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.error], + [CheckoutProtocol.lineItemsChange]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.lineItemsChange], + [CheckoutProtocol.messagesChange]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.messagesChange], + [CheckoutProtocol.start]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.start], + [CheckoutProtocol.totalsChange]: + generatedCheckoutProtocolPayloadDecoders[CheckoutProtocol.totalsChange], +} satisfies { + [K in keyof CheckoutProtocolPayloads]: CheckoutProtocolPayloadDecoder; +}; + +export function decodeCheckoutProtocolPayload< + K extends keyof CheckoutProtocolPayloads, +>(method: K, payload: unknown): CheckoutProtocolPayloads[K]; +export function decodeCheckoutProtocolPayload( + method: string, + payload: unknown, +): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined; +export function decodeCheckoutProtocolPayload( + method: string, + payload: unknown, +): CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads] | undefined { + const decoder = decoderFor(method); + return decoder?.(payload); +} + +function decoderFor( + method: string, +): + | ((payload: unknown) => CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads]) + | undefined { + return checkoutProtocolPayloadDecoders[ + method as keyof typeof checkoutProtocolPayloadDecoders + ] as + | ((payload: unknown) => CheckoutProtocolPayloads[keyof CheckoutProtocolPayloads]) + | undefined; +} diff --git a/protocol/scripts/generate_typescript_notifications.mjs b/protocol/scripts/generate_typescript_notifications.mjs index 9fcbc77d..cd648cbf 100644 --- a/protocol/scripts/generate_typescript_notifications.mjs +++ b/protocol/scripts/generate_typescript_notifications.mjs @@ -133,7 +133,7 @@ function renderModule(notifications) { import {Convert, type ${typeNames.join(', type ')}} from './Models'; -export const checkoutProtocolCatalog = { +export const generatedCheckoutProtocol = { ${notifications .map( notification => ` ${notification.identifier}: '${notification.method}',`, @@ -141,10 +141,10 @@ ${notifications .join('\n')} } as const; -export type CheckoutProtocolCatalogMethod = - (typeof checkoutProtocolCatalog)[keyof typeof checkoutProtocolCatalog]; +export type GeneratedCheckoutProtocolMethod = + (typeof generatedCheckoutProtocol)[keyof typeof generatedCheckoutProtocol]; -export interface CheckoutProtocolCatalogPayloads { +export interface GeneratedCheckoutProtocolPayloads { ${notifications .map( notification => ` '${notification.method}': ${notification.typeName};`, @@ -152,20 +152,20 @@ ${notifications .join('\n')} } -export type CheckoutProtocolCatalogPayloadDecoder< - K extends keyof CheckoutProtocolCatalogPayloads, -> = (payload: unknown) => CheckoutProtocolCatalogPayloads[K]; +export type GeneratedCheckoutProtocolPayloadDecoder< + K extends keyof GeneratedCheckoutProtocolPayloads, +> = (payload: unknown) => GeneratedCheckoutProtocolPayloads[K]; -export const checkoutProtocolCatalogPayloadDecoders = { +export const generatedCheckoutProtocolPayloadDecoders = { ${notifications .map( notification => - ` [checkoutProtocolCatalog.${notification.identifier}]: decodeWith(${notification.converter}),`, + ` [generatedCheckoutProtocol.${notification.identifier}]: decodeWith(${notification.converter}),`, ) .join('\n')} } satisfies { - [K in keyof CheckoutProtocolCatalogPayloads]: - CheckoutProtocolCatalogPayloadDecoder; + [K in keyof GeneratedCheckoutProtocolPayloads]: + GeneratedCheckoutProtocolPayloadDecoder; }; function decodeWith(converter: (json: string) => T): (payload: unknown) => T { diff --git a/protocol/scripts/generate_typescript_notifications.test.mjs b/protocol/scripts/generate_typescript_notifications.test.mjs index 4a244e7a..94e1bd2d 100644 --- a/protocol/scripts/generate_typescript_notifications.test.mjs +++ b/protocol/scripts/generate_typescript_notifications.test.mjs @@ -1,8 +1,8 @@ import {test, expect} from 'vitest'; import { - checkoutProtocolCatalog, - checkoutProtocolCatalogPayloadDecoders, + generatedCheckoutProtocol, + generatedCheckoutProtocolPayloadDecoders, } from '../languages/typescript/src/generated/ProtocolNotifications'; const EXPECTED_PROTOCOL = { @@ -27,21 +27,21 @@ const EXPECTED_REQUEST_METHODS = [ ]; test('exposes exactly the ec.* notification protocol map', () => { - expect({...checkoutProtocolCatalog}).toEqual(EXPECTED_PROTOCOL); + expect({...generatedCheckoutProtocol}).toEqual(EXPECTED_PROTOCOL); }); test('wires a payload decoder for every notification method', () => { - expect(Object.keys(checkoutProtocolCatalogPayloadDecoders).sort()).toEqual( + expect(Object.keys(generatedCheckoutProtocolPayloadDecoders).sort()).toEqual( Object.values(EXPECTED_PROTOCOL).sort(), ); - for (const decode of Object.values(checkoutProtocolCatalogPayloadDecoders)) { + for (const decode of Object.values(generatedCheckoutProtocolPayloadDecoders)) { expect(typeof decode).toBe('function'); } }); test('excludes ec.* request methods that define a result', () => { - const methods = Object.values(checkoutProtocolCatalog); + const methods = Object.values(generatedCheckoutProtocol); for (const requestMethod of EXPECTED_REQUEST_METHODS) { expect( From 33c14d2e14d10776b08b0fda3b0aa1340a1b4877 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 15:50:03 +0100 Subject: [PATCH 6/7] CheckoutTransport -> EmbeddedCheckoutProtocol --- .../CheckoutCommunicationProtocol.swift | 2 +- .../ShopifyCheckoutKit/CheckoutProtocol.swift | 18 +- .../ShopifyCheckoutKit/CheckoutWebView.swift | 6 +- .../ShopifyCheckoutKit/WindowOpen.swift | 6 +- .../CheckoutProtocolTests.swift | 4 +- .../CheckoutWebViewControllerTests.swift | 4 +- .../CheckoutWebViewTests.swift | 34 +- platforms/swift/api/ShopifyCheckoutKit.json | 8 +- .../swift/api/ShopifyCheckoutProtocol.json | 2969 +++++++---------- .../ShopifyCheckoutProtocol/Client.swift | 10 +- .../ShopifyCheckoutProtocol/Codec.swift | 4 +- ...ift => EmbeddedCheckoutProtocol+URL.swift} | 2 +- ...t.swift => EmbeddedCheckoutProtocol.swift} | 2 +- .../Generated/Catalog.swift | 60 - .../EmbeddedCheckoutProtocol+Event.swift | 46 + .../ClientTests.swift | 46 +- .../CodecDecodeTests.swift | 36 +- .../CodecEncodeTests.swift | 40 +- .../DescriptorTests.swift | 32 +- ...=> EmbeddedCheckoutProtocolURLTests.swift} | 30 +- protocol/scripts/generate_swift_catalog.mjs | 25 +- 21 files changed, 1431 insertions(+), 1953 deletions(-) rename protocol/languages/swift/Sources/ShopifyCheckoutProtocol/{CheckoutTransport+URL.swift => EmbeddedCheckoutProtocol+URL.swift} (95%) rename protocol/languages/swift/Sources/ShopifyCheckoutProtocol/{CheckoutTransport.swift => EmbeddedCheckoutProtocol.swift} (85%) delete mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift create mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/EmbeddedCheckoutProtocol+Event.swift rename protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/{CheckoutTransportURLTests.swift => EmbeddedCheckoutProtocolURLTests.swift} (68%) diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift index 5ab4fe46..6db88436 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutCommunicationProtocol.swift @@ -7,4 +7,4 @@ public protocol CheckoutCommunicationProtocol: Sendable { func process(_ message: String) async -> String? } -extension CheckoutTransport.Client: CheckoutCommunicationProtocol {} +extension EmbeddedCheckoutProtocol.Client: CheckoutCommunicationProtocol {} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift index e48047c7..3ac07ce4 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutProtocol.swift @@ -4,10 +4,10 @@ import Foundation public enum CheckoutProtocol { - public typealias Client = CheckoutTransport.Client + public typealias Client = EmbeddedCheckoutProtocol.Client public static func url(for url: URL) -> URL { - CheckoutTransport.url(for: url, delegations: defaultDelegations) + EmbeddedCheckoutProtocol.url(for: url, delegations: defaultDelegations) } static let defaultDelegations: [String] = ["window.open"] @@ -15,15 +15,15 @@ public enum CheckoutProtocol { static let methodNotFoundCode = -32601 static let methodNotFoundMessage = "Method not found" - public static let complete = GeneratedProtocolCatalog.ecComplete - public static let error = GeneratedProtocolCatalog.ecError - public static let lineItemsChange = GeneratedProtocolCatalog.ecLineItemsChange - public static let messagesChange = GeneratedProtocolCatalog.ecMessagesChange - public static let start = GeneratedProtocolCatalog.ecStart - public static let totalsChange = GeneratedProtocolCatalog.ecTotalsChange + public static let complete = EmbeddedCheckoutProtocol.Event.complete + public static let error = EmbeddedCheckoutProtocol.Event.error + public static let lineItemsChange = EmbeddedCheckoutProtocol.Event.lineItemsChange + public static let messagesChange = EmbeddedCheckoutProtocol.Event.messagesChange + public static let start = EmbeddedCheckoutProtocol.Event.start + public static let totalsChange = EmbeddedCheckoutProtocol.Event.totalsChange static let supportedProtocolMethods: Set = [ - CheckoutTransport.readyMethod, + EmbeddedCheckoutProtocol.readyMethod, start.method, complete.method, error.method, diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift index 9f66fe47..06635530 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift @@ -230,7 +230,7 @@ class CheckoutWebView: WKWebView { /// the kit via `viewDelegate`. Per UCP spec, `unrecoverable` means no valid /// resource exists to act on, so consumers don't have to wire dismissal in /// every error handler. - lazy var defaultsClient: CheckoutTransport.Client = .init() + lazy var defaultsClient: EmbeddedCheckoutProtocol.Client = .init() .on(CheckoutProtocol.complete) { _ in CheckoutWebView.invalidate(disconnect: false) } @@ -458,8 +458,8 @@ extension CheckoutWebView: WKScriptMessageHandler { return } - if method == CheckoutTransport.readyMethod, - let response = CheckoutTransport.acknowledgeReady(body, supportedDelegations: CheckoutProtocol.defaultDelegations) + if method == EmbeddedCheckoutProtocol.readyMethod, + let response = EmbeddedCheckoutProtocol.acknowledgeReady(body, supportedDelegations: CheckoutProtocol.defaultDelegations) { OSLogger.shared.debug("Handling ec.ready: sending UCP ready acknowledgement, isPreload: \(isPreloadRequest)") Task { @MainActor in diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift b/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift index 31c098e6..a0838cb5 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/WindowOpen.swift @@ -41,11 +41,11 @@ public enum WindowOpenResult: ResponsePayload { switch self { case .success: try WindowOpenSuccessBody( - ucp: WindowOpenUCP(version: CheckoutTransport.specVersion, status: "success") + ucp: WindowOpenUCP(version: EmbeddedCheckoutProtocol.specVersion, status: "success") ).encode(to: encoder) case let .rejected(reason): try WindowOpenRejectedBody( - ucp: WindowOpenUCP(version: CheckoutTransport.specVersion, status: "error"), + ucp: WindowOpenUCP(version: EmbeddedCheckoutProtocol.specVersion, status: "error"), messages: [ WindowOpenRejectedMessage(content: reason ?? "Window open rejected") ] @@ -56,7 +56,7 @@ public enum WindowOpenResult: ResponsePayload { extension CheckoutProtocol { public static let windowOpen = DelegationDescriptor( - method: GeneratedProtocolCatalog.ecWindowOpenRequest.method, + method: EmbeddedCheckoutProtocol.Event.windowOpenRequest.method, delegation: "window.open", decode: { params in try? JSONDecoder().decode(WindowOpenRequest.self, from: params) diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift index a3af43bf..85e15b31 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutProtocolTests.swift @@ -13,7 +13,7 @@ struct CheckoutProtocolTests { @Test func supportedProtocolMethodsCoverReadyCuratedNotificationsAndWindowOpen() { #expect(CheckoutProtocol.supportedProtocolMethods == [ - CheckoutTransport.readyMethod, + EmbeddedCheckoutProtocol.readyMethod, "ec.start", "ec.complete", "ec.error", @@ -133,7 +133,7 @@ struct WindowOpenDelegationTests { let body = try encode(.success) let ucp = try #require(body["ucp"] as? [String: Any]) #expect(ucp["status"] as? String == "success") - #expect(ucp["version"] as? String == CheckoutTransport.specVersion) + #expect(ucp["version"] as? String == EmbeddedCheckoutProtocol.specVersion) } @Test func resultEncodesRejectedBody() throws { diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift index facd2f22..67fcbc2e 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewControllerTests.swift @@ -75,7 +75,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_presentationControllerDidDismiss_doesNotCleanUpBeforeViewDisappears() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) @@ -93,7 +93,7 @@ class CheckoutWebViewControllerTests: XCTestCase { func test_viewDidDisappear_cleansUpConsumedPreloadedWebViewWhenDismissed() throws { ShopifyCheckoutKit.configuration.preloading.enabled = true ShopifyCheckoutKit.preload(checkout: url) - let viewController = TestableCheckoutWebViewController(checkoutURL: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) + let viewController = TestableCheckoutWebViewController(checkoutURL: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations), entryPoint: nil) viewController.loadViewIfNeeded() let checkoutView = try XCTUnwrap(viewController.checkoutView) diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift index 272aeff9..45c9cb3b 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutWebViewTests.swift @@ -276,7 +276,7 @@ class CheckoutWebViewTests: XCTestCase { XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let cached = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertFalse(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -286,7 +286,7 @@ class CheckoutWebViewTests: XCTestCase { func testRepeatedPreloadForMatchingCheckoutDoesNotReloadCachedWebView() { let webView = LoadedRequestObservableWebView() - let checkoutURL = CheckoutTransport.url(for: url) + let checkoutURL = EmbeddedCheckoutProtocol.url(for: url) _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: checkoutURL, entryPoint: nil)) CheckoutWebView.preload(checkout: checkoutURL) @@ -297,8 +297,8 @@ class CheckoutWebViewTests: XCTestCase { func testPresentingMatchingCheckoutReusesCachedWebViewWithoutEvictingIt() { ShopifyCheckoutKit.preload(checkout: url) - let first = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) - let second = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let first = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let second = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(first === second) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) @@ -308,7 +308,7 @@ class CheckoutWebViewTests: XCTestCase { ShopifyCheckoutKit.preload(checkout: url) let otherURL = try XCTUnwrap(URL(string: "http://shopify1.shopify.com/checkouts/cn/456")) - let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: otherURL)) + let fresh = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: otherURL)) XCTAssertNil(fresh.url) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) @@ -316,9 +316,9 @@ class CheckoutWebViewTests: XCTestCase { } func testPresentWithDifferentEntryPointDoesNotReusePreloadedWebView() { - CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), entryPoint: .acceleratedCheckouts) + CheckoutWebView.preload(checkout: EmbeddedCheckoutProtocol.url(for: url), entryPoint: .acceleratedCheckouts) - let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url), entryPoint: nil) + let fresh = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url), entryPoint: nil) XCTAssertNil(fresh.url) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) @@ -338,12 +338,12 @@ class CheckoutWebViewTests: XCTestCase { func testStalePreloadCacheIsRejectedImmediately() { let staleCreatedAt = Date(timeIntervalSinceNow: -6 * 60) - CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), createdAt: staleCreatedAt) + CheckoutWebView.preload(checkout: EmbeddedCheckoutProtocol.url(for: url), createdAt: staleCreatedAt) XCTAssertFalse(CheckoutWebView.preloadCache.hasEntry()) XCTAssertFalse(CheckoutWebView.preloadCache.hasActiveKeepAlive()) - let fresh = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url)) + let fresh = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url)) XCTAssertNil(fresh.url) XCTAssertTrue(fresh.isBridgeAttached) @@ -353,7 +353,7 @@ class CheckoutWebViewTests: XCTestCase { func testPreloadCacheExpiresAndStopsKeepAlive() { let nearlyStaleCreatedAt = Date(timeIntervalSinceNow: -(5 * 60 - 0.1)) - CheckoutWebView.preload(checkout: CheckoutTransport.url(for: url), createdAt: nearlyStaleCreatedAt) + CheckoutWebView.preload(checkout: EmbeddedCheckoutProtocol.url(for: url), createdAt: nearlyStaleCreatedAt) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -378,7 +378,7 @@ class CheckoutWebViewTests: XCTestCase { func testPreloadKeepAliveFailureInvalidatesCache() { let webView = ThrowingEvaluateJavaScriptWebView() - _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: CheckoutTransport.url(for: url), entryPoint: nil)) + _ = CheckoutWebView.preloadCache.store(webView, for: PreloadKey(url: EmbeddedCheckoutProtocol.url(for: url), entryPoint: nil)) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) XCTAssertTrue(CheckoutWebView.preloadCache.hasActiveKeepAlive()) @@ -403,7 +403,7 @@ class CheckoutWebViewTests: XCTestCase { func testInvalidateDetachesCachedPreloadedWebView() { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let cached = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) XCTAssertTrue(cached.isBridgeAttached) ShopifyCheckoutKit.invalidate() @@ -414,7 +414,7 @@ class CheckoutWebViewTests: XCTestCase { func testHTTPErrorInvalidatesPreloadCache() throws { ShopifyCheckoutKit.preload(checkout: url) - let cached = CheckoutWebView.for(checkout: CheckoutTransport.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) + let cached = CheckoutWebView.for(checkout: EmbeddedCheckoutProtocol.url(for: url, delegations: CheckoutProtocol.defaultDelegations)) let link = try XCTUnwrap(cached.url) let response = try XCTUnwrap(HTTPURLResponse(url: link, statusCode: 403, httpVersion: nil, headerFields: nil)) @@ -536,7 +536,7 @@ class CheckoutWebViewTests: XCTestCase { let result = try XCTUnwrap(parsed["result"] as? [String: Any]) let ucp = try XCTUnwrap(result["ucp"] as? [String: Any]) XCTAssertEqual(ucp["status"] as? String, "success") - XCTAssertEqual(ucp["version"] as? String, CheckoutTransport.specVersion) + XCTAssertEqual(ucp["version"] as? String, EmbeddedCheckoutProtocol.specVersion) } @MainActor @@ -707,7 +707,7 @@ class CheckoutWebViewTests: XCTestCase { let body = #"{"jsonrpc":"2.0","method":"ec.window.open_request","id":"\#(id)","params":{"url":"https://example.com/terms"}}"# let responseSent = expectation(description: "response sent") MockCheckoutBridge.sendResponseExpectation = responseSent - view.client = CheckoutTransport.Client() + view.client = EmbeddedCheckoutProtocol.Client() .on(CheckoutProtocol.windowOpen) { _ in .rejected(reason: "consumer override") } @@ -772,7 +772,7 @@ class CheckoutWebViewTests: XCTestCase { /// and bypass the handler entirely. private func ecErrorBody(severity: String) -> String { return """ - {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"status":"error","version":"\(CheckoutTransport.specVersion)"},"messages":[{"type":"error","code":"session_failed","content":"Session failed","severity":"\(severity)"}]}}} + {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"status":"error","version":"\(EmbeddedCheckoutProtocol.specVersion)"},"messages":[{"type":"error","code":"session_failed","content":"Session failed","severity":"\(severity)"}]}}} """ } @@ -840,7 +840,7 @@ class CheckoutWebViewTests: XCTestCase { let consumerHandlerFired = expectation(description: "consumer handler fired") let dismissed = expectation(description: "viewDelegate received failure") mockDelegate.didFailWithErrorExpectation = dismissed - view.client = CheckoutTransport.Client() + view.client = EmbeddedCheckoutProtocol.Client() .on(CheckoutProtocol.error) { _ in consumerHandlerFired.fulfill() } diff --git a/platforms/swift/api/ShopifyCheckoutKit.json b/platforms/swift/api/ShopifyCheckoutKit.json index a637e6cd..046119f4 100644 --- a/platforms/swift/api/ShopifyCheckoutKit.json +++ b/platforms/swift/api/ShopifyCheckoutKit.json @@ -1075,8 +1075,8 @@ { "kind": "TypeNominal", "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + "printedName": "ShopifyCheckoutProtocol.EmbeddedCheckoutProtocol.Client", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV" } ], "declKind": "TypeAlias", @@ -7067,8 +7067,8 @@ "name": "Client", "printedName": "Client", "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV", "moduleName": "ShopifyCheckoutProtocol", "isFromExtension": true, "isExternal": true, diff --git a/platforms/swift/api/ShopifyCheckoutProtocol.json b/platforms/swift/api/ShopifyCheckoutProtocol.json index fce1b01f..0b3bcc8e 100644 --- a/platforms/swift/api/ShopifyCheckoutProtocol.json +++ b/platforms/swift/api/ShopifyCheckoutProtocol.json @@ -41,13 +41,107 @@ }, { "kind": "TypeDecl", - "name": "CheckoutTransport", - "printedName": "CheckoutTransport", + "name": "EventPayload", + "printedName": "EventPayload", + "declKind": "Protocol", + "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Decodable", + "printedName": "Decodable", + "usr": "s:Se", + "mangledName": "$sSe" + } + ] + }, + { + "kind": "TypeDecl", + "name": "ResponsePayload", + "printedName": "ResponsePayload", + "declKind": "Protocol", + "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", + "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Encodable", + "printedName": "Encodable", + "usr": "s:SE", + "mangledName": "$sSE" + } + ] + }, + { + "kind": "TypeDecl", + "name": "NotificationDescriptor", + "printedName": "NotificationDescriptor", "children": [ { "kind": "Var", - "name": "specVersion", - "printedName": "specVersion", + "name": "method", + "printedName": "method", "children": [ { "kind": "TypeNominal", @@ -57,12 +151,10 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", "moduleName": "ShopifyCheckoutProtocol", - "static": true, "declAttributes": [ - "HasInitialValue", "HasStorage" ], "isLet": true, @@ -81,10 +173,10 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11specVersionSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", "moduleName": "ShopifyCheckoutProtocol", - "static": true, + "genericSig": "", "implicit": true, "declAttributes": [ "Transparent" @@ -92,11 +184,53 @@ "accessorKind": "get" } ] + } + ], + "declKind": "Struct", + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV", + "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "DelegationDescriptor", + "printedName": "DelegationDescriptor", + "children": [ { "kind": "Var", - "name": "readyMethod", - "printedName": "readyMethod", + "name": "method", + "printedName": "method", "children": [ { "kind": "TypeNominal", @@ -106,13 +240,10 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isInternal": true, "declAttributes": [ - "HasInitialValue", "HasStorage" ], "isLet": true, @@ -131,68 +262,22 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO11readyMethodSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", "moduleName": "ShopifyCheckoutProtocol", - "static": true, + "genericSig": "", "implicit": true, - "isInternal": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "parseErrorCode", - "printedName": "parseErrorCode", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isInternal": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } + "declAttributes": [ + "Transparent" ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO14parseErrorCodeSivgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "isInternal": true, "accessorKind": "get" } ] }, { "kind": "Var", - "name": "parseErrorMessage", - "printedName": "parseErrorMessage", + "name": "delegation", + "printedName": "delegation", "children": [ { "kind": "TypeNominal", @@ -202,13 +287,10 @@ } ], "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvpZ", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isInternal": true, "declAttributes": [ - "HasInitialValue", "HasStorage" ], "isLet": true, @@ -227,37 +309,157 @@ } ], "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO17parseErrorMessageSSvgZ", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", "moduleName": "ShopifyCheckoutProtocol", - "static": true, + "genericSig": "", "implicit": true, - "isInternal": true, + "declAttributes": [ + "Transparent" + ], "accessorKind": "get" } ] }, { - "kind": "Function", - "name": "url", - "printedName": "url(for:delegations:)", + "kind": "Constructor", + "name": "init", + "printedName": "init(method:delegation:decode:)", "children": [ { "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" + "name": "DelegationDescriptor", + "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Payload" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Result" + } + ], + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" }, { "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" }, { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Foundation.Data) -> Payload?", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Payload?", + "children": [ + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "Payload" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "Data", + "printedName": "Foundation.Data", + "usr": "s:10Foundation4DataV" + } + ] + } + ], + "declKind": "Constructor", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "init_kind": "Designated" + } + ], + "declKind": "Struct", + "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV", + "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV", + "moduleName": "ShopifyCheckoutProtocol", + "genericSig": "", + "conformances": [ + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "EmbeddedCheckoutProtocol", + "printedName": "EmbeddedCheckoutProtocol", + "children": [ + { + "kind": "Var", + "name": "specVersion", + "printedName": "specVersion", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O11specVersionSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O11specVersionSSvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", @@ -266,17 +468,162 @@ "usr": "s:SS" } ], - "hasDefaultArg": true, - "usr": "s:Sa" + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O11specVersionSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O11specVersionSSvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "readyMethod", + "printedName": "readyMethod", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O11readyMethodSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O11readyMethodSSvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O11readyMethodSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O11readyMethodSSvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "parseErrorCode", + "printedName": "parseErrorCode", + "children": [ + { + "kind": "TypeNominal", + "name": "Int", + "printedName": "Swift.Int", + "usr": "s:Si" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O14parseErrorCodeSivpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O14parseErrorCodeSivpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Int", + "printedName": "Swift.Int", + "usr": "s:Si" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O14parseErrorCodeSivgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O14parseErrorCodeSivgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "parseErrorMessage", + "printedName": "parseErrorMessage", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O17parseErrorMessageSSvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O17parseErrorMessageSSvpZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "isInternal": true, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O17parseErrorMessageSSvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O17parseErrorMessageSSvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "isInternal": true, + "accessorKind": "get" + } + ] }, { "kind": "TypeDecl", @@ -291,13 +638,13 @@ { "kind": "TypeNominal", "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + "printedName": "ShopifyCheckoutProtocol.EmbeddedCheckoutProtocol.Client", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV" } ], "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientVAEycfc", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientVAEycfc", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientVAEycfc", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientVAEycfc", "moduleName": "ShopifyCheckoutProtocol", "init_kind": "Designated" }, @@ -309,8 +656,8 @@ { "kind": "TypeNominal", "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + "printedName": "ShopifyCheckoutProtocol.EmbeddedCheckoutProtocol.Client", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV" }, { "kind": "TypeNominal", @@ -351,8 +698,8 @@ } ], "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV2on_7performAeA22NotificationDescriptorVyxG_yxYbScMYcctAA12EventPayloadRzlF", "moduleName": "ShopifyCheckoutProtocol", "genericSig": "

", "declAttributes": [ @@ -368,8 +715,8 @@ { "kind": "TypeNominal", "name": "Client", - "printedName": "ShopifyCheckoutProtocol.CheckoutTransport.Client", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV" + "printedName": "ShopifyCheckoutProtocol.EmbeddedCheckoutProtocol.Client", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV" }, { "kind": "TypeNominal", @@ -408,8 +755,8 @@ } ], "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV2on_7performAeA20DelegationDescriptorVyxq_G_q_xYaYbScMYcctAA12EventPayloadRzAA08ResponseK0R_r0_lF", "moduleName": "ShopifyCheckoutProtocol", "genericSig": "", "declAttributes": [ @@ -444,15 +791,15 @@ } ], "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV7processySSSgSSYaF", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV7processySSSgSSYaF", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV7processySSSgSSYaF", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV7processySSSgSSYaF", "moduleName": "ShopifyCheckoutProtocol", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO6ClientV", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO6ClientV", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O6ClientV", "moduleName": "ShopifyCheckoutProtocol", "isFromExtension": true, "conformances": [ @@ -528,250 +875,34 @@ } ], "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O16acknowledgeReady_20supportedDelegationsSSSgSS_SaySSGtFZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, "isFromExtension": true, "funcSelfKind": "NonMutating" - } - ], - "declKind": "Enum", - "usr": "s:23ShopifyCheckoutProtocol0B9TransportO", - "mangledName": "$s23ShopifyCheckoutProtocol0B9TransportO", - "moduleName": "ShopifyCheckoutProtocol", - "isEnumExhaustive": true, - "conformances": [ + }, { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "EventPayload", - "printedName": "EventPayload", - "declKind": "Protocol", - "usr": "s:23ShopifyCheckoutProtocol12EventPayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol12EventPayloadP", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Decodable", - "printedName": "Decodable", - "usr": "s:Se", - "mangledName": "$sSe" - } - ] - }, - { - "kind": "TypeDecl", - "name": "ResponsePayload", - "printedName": "ResponsePayload", - "declKind": "Protocol", - "usr": "s:23ShopifyCheckoutProtocol15ResponsePayloadP", - "mangledName": "$s23ShopifyCheckoutProtocol15ResponsePayloadP", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Encodable", - "printedName": "Encodable", - "usr": "s:SE", - "mangledName": "$sSE" - } - ] - }, - { - "kind": "TypeDecl", - "name": "NotificationDescriptor", - "printedName": "NotificationDescriptor", - "children": [ - { - "kind": "Var", - "name": "method", - "printedName": "method", + "kind": "Function", + "name": "url", + "printedName": "url(for:delegations:)", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvp", - "moduleName": "ShopifyCheckoutProtocol", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV6methodSSvg", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV", - "mangledName": "$s23ShopifyCheckoutProtocol22NotificationDescriptorV", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "DelegationDescriptor", - "printedName": "DelegationDescriptor", - "children": [ - { - "kind": "Var", - "name": "method", - "printedName": "method", - "children": [ + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvp", - "moduleName": "ShopifyCheckoutProtocol", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", @@ -780,863 +911,222 @@ "usr": "s:SS" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6methodSSvg", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "delegation", - "printedName": "delegation", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvp", - "moduleName": "ShopifyCheckoutProtocol", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV10delegationSSvg", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(method:delegation:decode:)", - "children": [ - { - "kind": "TypeNominal", - "name": "DelegationDescriptor", - "printedName": "ShopifyCheckoutProtocol.DelegationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Payload" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Result" - } - ], - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - }, - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Foundation.Data) -> Payload?", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Payload?", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Payload" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "Data", - "printedName": "Foundation.Data", - "usr": "s:10Foundation4DataV" - } - ] - } - ], - "declKind": "Constructor", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV6method10delegation6decodeACyxq_GSS_SSxSg10Foundation4DataVYbctcfc", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "init_kind": "Designated" - } - ], - "declKind": "Struct", - "usr": "s:23ShopifyCheckoutProtocol20DelegationDescriptorV", - "mangledName": "$s23ShopifyCheckoutProtocol20DelegationDescriptorV", - "moduleName": "ShopifyCheckoutProtocol", - "genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "GeneratedProtocolCatalog", - "printedName": "GeneratedProtocolCatalog", - "children": [ - { - "kind": "Var", - "name": "ecReady", - "printedName": "ecReady", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecAuth", - "printedName": "ecAuth", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO6ecAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecError", - "printedName": "ecError", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecErrorAA22NotificationDescriptorVyAA0G8ResponseVGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecStart", - "printedName": "ecStart", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO7ecStartAA22NotificationDescriptorVyAA0B0VGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecComplete", - "printedName": "ecComplete", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10ecCompleteAA22NotificationDescriptorVyAA0B0VGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecMessagesChange", - "printedName": "ecMessagesChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO16ecMessagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecLineItemsChange", - "printedName": "ecLineItemsChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17ecLineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecBuyerChange", - "printedName": "ecBuyerChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + "hasDefaultArg": true, + "usr": "s:Sa" } ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + "isFromExtension": true, + "funcSelfKind": "NonMutating" + }, + { + "kind": "TypeDecl", + "name": "Event", + "printedName": "Event", + "children": [ { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "ready", + "printedName": "ready", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO13ecBuyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5readyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5readyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecTotalsChange", - "printedName": "ecTotalsChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5readyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5readyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "auth", + "printedName": "auth", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14ecTotalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO4authAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO4authAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecPaymentChange", - "printedName": "ecPaymentChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO4authAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO4authAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "error", + "printedName": "error", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO15ecPaymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecPaymentInstrumentsChangeRequest", - "printedName": "ecPaymentInstrumentsChangeRequest", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "ErrorResponse", + "printedName": "ShopifyCheckoutProtocol.ErrorResponse", + "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5errorAA22NotificationDescriptorVyAA13ErrorResponseVGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "start", + "printedName": "start", "children": [ { "kind": "TypeNominal", @@ -1653,55 +1143,55 @@ "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecPaymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5startAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5startAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecPaymentCredentialRequest", - "printedName": "ecPaymentCredentialRequest", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5startAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO5startAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "complete", + "printedName": "complete", "children": [ { "kind": "TypeNominal", @@ -1718,120 +1208,55 @@ "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO26ecPaymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO8completeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO8completeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecWindowOpenRequest", - "printedName": "ecWindowOpenRequest", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } + "HasInitialValue", + "HasStorage" ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecWindowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecFulfillmentChange", - "printedName": "ecFulfillmentChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ - { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO8completeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO8completeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "messagesChange", + "printedName": "messagesChange", "children": [ { "kind": "TypeNominal", @@ -1848,55 +1273,55 @@ "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO19ecFulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO14messagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO14messagesChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "ecFulfillmentAddressChangeRequest", - "printedName": "ecFulfillmentAddressChangeRequest", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "Checkout", - "printedName": "ShopifyCheckoutProtocol.Checkout", - "usr": "s:23ShopifyCheckoutProtocol0B0V" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO14messagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO14messagesChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "lineItemsChange", + "printedName": "lineItemsChange", "children": [ { "kind": "TypeNominal", @@ -1913,380 +1338,380 @@ "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO33ecFulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartReady", - "printedName": "epCartReady", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO15lineItemsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "buyerChange", + "printedName": "buyerChange", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartReadyAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO11buyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO11buyerChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartAuth", - "printedName": "epCartAuth", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO11buyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO11buyerChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "totalsChange", + "printedName": "totalsChange", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10epCartAuthAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO12totalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO12totalsChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartError", - "printedName": "epCartError", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO12totalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO12totalsChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "paymentChange", + "printedName": "paymentChange", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "ErrorResponse", - "printedName": "ShopifyCheckoutProtocol.ErrorResponse", - "usr": "s:23ShopifyCheckoutProtocol13ErrorResponseV" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartErrorAA22NotificationDescriptorVyAA0H8ResponseVGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO13paymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO13paymentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartStart", - "printedName": "epCartStart", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO13paymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO13paymentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "paymentInstrumentsChangeRequest", + "printedName": "paymentInstrumentsChangeRequest", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO11epCartStartAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31paymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31paymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartComplete", - "printedName": "epCartComplete", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31paymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31paymentInstrumentsChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "paymentCredentialRequest", + "printedName": "paymentCredentialRequest", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO14epCartCompleteAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO24paymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO24paymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartLineItemsChange", - "printedName": "epCartLineItemsChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" - } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO24paymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO24paymentCredentialRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "windowOpenRequest", + "printedName": "windowOpenRequest", "children": [ { "kind": "TypeNominal", @@ -2303,185 +1728,185 @@ "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO21epCartLineItemsChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17windowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17windowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartBuyerChange", - "printedName": "epCartBuyerChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "JSONAny", + "printedName": "ShopifyCheckoutProtocol.JSONAny", + "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17windowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17windowOpenRequestAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "fulfillmentChange", + "printedName": "fulfillmentChange", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO17epCartBuyerChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17fulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17fulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "epCartMessagesChange", - "printedName": "epCartMessagesChange", - "children": [ - { - "kind": "TypeNominal", - "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17fulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO17fulfillmentChangeAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "fulfillmentAddressChangeRequest", + "printedName": "fulfillmentAddressChangeRequest", "children": [ { "kind": "TypeNominal", "name": "NotificationDescriptor", - "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", "children": [ { "kind": "TypeNominal", - "name": "JSONAny", - "printedName": "ShopifyCheckoutProtocol.JSONAny", - "usr": "s:23ShopifyCheckoutProtocol7JSONAnyC" + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" } ], "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO20epCartMessagesChangeAA22NotificationDescriptorVyAA7JSONAnyCGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31fulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31fulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "allMethods", - "printedName": "allMethods", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ + "isLet": true, + "hasStorage": true, + "accessors": [ { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "NotificationDescriptor", + "printedName": "ShopifyCheckoutProtocol.NotificationDescriptor", + "children": [ + { + "kind": "TypeNominal", + "name": "Checkout", + "printedName": "ShopifyCheckoutProtocol.Checkout", + "usr": "s:23ShopifyCheckoutProtocol0B0V" + } + ], + "usr": "s:23ShopifyCheckoutProtocol22NotificationDescriptorV" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31fulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO31fulfillmentAddressChangeRequestAA22NotificationDescriptorVyAA0B0VGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" } - ], - "usr": "s:Sa" - } - ], - "declKind": "Var", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvpZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvpZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ + ] + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "all", + "printedName": "all", "children": [ { "kind": "TypeNominal", @@ -2498,23 +1923,79 @@ "usr": "s:Sa" } ], - "declKind": "Accessor", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvgZ", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO10allMethodsSaySSGvgZ", + "declKind": "Var", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO3allSaySSGvpZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO3allSaySSGvpZ", "moduleName": "ShopifyCheckoutProtocol", "static": true, - "implicit": true, "declAttributes": [ - "Transparent" + "HasInitialValue", + "HasStorage" ], - "accessorKind": "get" + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sa" + } + ], + "declKind": "Accessor", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO3allSaySSGvgZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO3allSaySSGvgZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + } + ] + } + ], + "declKind": "Enum", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O5EventO", + "moduleName": "ShopifyCheckoutProtocol", + "isFromExtension": true, + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" } ] } ], "declKind": "Enum", - "usr": "s:23ShopifyCheckoutProtocol09GeneratedC7CatalogO", - "mangledName": "$s23ShopifyCheckoutProtocol09GeneratedC7CatalogO", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O", "moduleName": "ShopifyCheckoutProtocol", "isEnumExhaustive": true, "conformances": [ diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift index 8f1f2e26..96da8135 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift @@ -1,6 +1,6 @@ import Foundation -extension CheckoutTransport { +extension EmbeddedCheckoutProtocol { public struct Client: Sendable, MutableCopyable { private var notificationHandlers: [String: @MainActor @Sendable (any EventPayload) -> Void] private var delegationEntries: [String: DelegationEntry] @@ -38,22 +38,22 @@ extension CheckoutTransport { handler: { id, params in guard let payload = descriptor.decode(params) else { return nil } let result = await perform(payload) - return CheckoutTransport.encodeResponse(id: id, result: result) + return EmbeddedCheckoutProtocol.encodeResponse(id: id, result: result) } ) } } public func process(_ message: String) async -> String? { - let decoded = CheckoutTransport.decode(jsonRpc: message) + let decoded = EmbeddedCheckoutProtocol.decode(jsonRpc: message) switch decoded { case let .ready(id, requested): let accepted = requested.filter(Set(delegations).contains) - return CheckoutTransport.encodeReadyResponse(id: id, acceptedDelegations: accepted) + return EmbeddedCheckoutProtocol.encodeReadyResponse(id: id, acceptedDelegations: accepted) case let .error(id, code, message): - return CheckoutTransport.encodeErrorResponse(id: id, code: code, message: message) + return EmbeddedCheckoutProtocol.encodeErrorResponse(id: id, code: code, message: message) case let .notification(method, payload): await notificationHandlers[method]?(payload) diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift index fa361af1..f3f65399 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift @@ -1,6 +1,6 @@ import Foundation -extension CheckoutTransport { +extension EmbeddedCheckoutProtocol { /// Returns an `ec.ready` response if the given message is an `ec.ready` request, /// otherwise `nil`. The response echoes the intersection of the merchant's /// requested delegations with `supportedDelegations` under a `delegate` array. @@ -22,7 +22,7 @@ extension CheckoutTransport { } } -extension CheckoutTransport { +extension EmbeddedCheckoutProtocol { static func decode(jsonRpc: String) -> UCPMessage { guard let data = jsonRpc.data(using: .utf8) else { return .unknown(method: "", rawParams: jsonRpc) diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift similarity index 95% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift rename to protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift index 01da875e..76c31686 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport+URL.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift @@ -1,6 +1,6 @@ import Foundation -extension CheckoutTransport { +extension EmbeddedCheckoutProtocol { /// Returns the given checkout URL with the query parameters required to /// initiate the Embedded Checkout Protocol handshake (`ec_version`, /// `ec_delegate`). diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift similarity index 85% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift rename to protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift index 2e3bb47e..8dea46bf 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/CheckoutTransport.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift @@ -1,6 +1,6 @@ import Foundation -public enum CheckoutTransport { +public enum EmbeddedCheckoutProtocol { public static let specVersion = "2026-04-08" package static let readyMethod = "ec.ready" diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift deleted file mode 100644 index 2c101129..00000000 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file is generated by protocol/scripts/generate_swift_catalog.mjs. -// Do not edit directly. - -import Foundation - -extension Checkout: EventPayload {} -extension ErrorResponse: EventPayload {} -extension JSONAny: EventPayload {} - -public enum GeneratedProtocolCatalog { - public static let ecReady = NotificationDescriptor(method: "ec.ready") - public static let ecAuth = NotificationDescriptor(method: "ec.auth") - public static let ecError = NotificationDescriptor(method: "ec.error") - public static let ecStart = NotificationDescriptor(method: "ec.start") - public static let ecComplete = NotificationDescriptor(method: "ec.complete") - public static let ecMessagesChange = NotificationDescriptor(method: "ec.messages.change") - public static let ecLineItemsChange = NotificationDescriptor(method: "ec.line_items.change") - public static let ecBuyerChange = NotificationDescriptor(method: "ec.buyer.change") - public static let ecTotalsChange = NotificationDescriptor(method: "ec.totals.change") - public static let ecPaymentChange = NotificationDescriptor(method: "ec.payment.change") - public static let ecPaymentInstrumentsChangeRequest = NotificationDescriptor(method: "ec.payment.instruments_change_request") - public static let ecPaymentCredentialRequest = NotificationDescriptor(method: "ec.payment.credential_request") - public static let ecWindowOpenRequest = NotificationDescriptor(method: "ec.window.open_request") - public static let ecFulfillmentChange = NotificationDescriptor(method: "ec.fulfillment.change") - public static let ecFulfillmentAddressChangeRequest = NotificationDescriptor(method: "ec.fulfillment.address_change_request") - public static let epCartReady = NotificationDescriptor(method: "ep.cart.ready") - public static let epCartAuth = NotificationDescriptor(method: "ep.cart.auth") - public static let epCartError = NotificationDescriptor(method: "ep.cart.error") - public static let epCartStart = NotificationDescriptor(method: "ep.cart.start") - public static let epCartComplete = NotificationDescriptor(method: "ep.cart.complete") - public static let epCartLineItemsChange = NotificationDescriptor(method: "ep.cart.line_items.change") - public static let epCartBuyerChange = NotificationDescriptor(method: "ep.cart.buyer.change") - public static let epCartMessagesChange = NotificationDescriptor(method: "ep.cart.messages.change") - - public static let allMethods: [String] = [ - ecReady.method, - ecAuth.method, - ecError.method, - ecStart.method, - ecComplete.method, - ecMessagesChange.method, - ecLineItemsChange.method, - ecBuyerChange.method, - ecTotalsChange.method, - ecPaymentChange.method, - ecPaymentInstrumentsChangeRequest.method, - ecPaymentCredentialRequest.method, - ecWindowOpenRequest.method, - ecFulfillmentChange.method, - ecFulfillmentAddressChangeRequest.method, - epCartReady.method, - epCartAuth.method, - epCartError.method, - epCartStart.method, - epCartComplete.method, - epCartLineItemsChange.method, - epCartBuyerChange.method, - epCartMessagesChange.method, - ] -} diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/EmbeddedCheckoutProtocol+Event.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/EmbeddedCheckoutProtocol+Event.swift new file mode 100644 index 00000000..8f62528a --- /dev/null +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Generated/EmbeddedCheckoutProtocol+Event.swift @@ -0,0 +1,46 @@ +// This file is generated by protocol/scripts/generate_swift_catalog.mjs. +// Do not edit directly. + +import Foundation + +extension Checkout: EventPayload {} +extension ErrorResponse: EventPayload {} +extension JSONAny: EventPayload {} + +extension EmbeddedCheckoutProtocol { + public enum Event { + public static let ready = NotificationDescriptor(method: "ec.ready") + public static let auth = NotificationDescriptor(method: "ec.auth") + public static let error = NotificationDescriptor(method: "ec.error") + public static let start = NotificationDescriptor(method: "ec.start") + public static let complete = NotificationDescriptor(method: "ec.complete") + public static let messagesChange = NotificationDescriptor(method: "ec.messages.change") + public static let lineItemsChange = NotificationDescriptor(method: "ec.line_items.change") + public static let buyerChange = NotificationDescriptor(method: "ec.buyer.change") + public static let totalsChange = NotificationDescriptor(method: "ec.totals.change") + public static let paymentChange = NotificationDescriptor(method: "ec.payment.change") + public static let paymentInstrumentsChangeRequest = NotificationDescriptor(method: "ec.payment.instruments_change_request") + public static let paymentCredentialRequest = NotificationDescriptor(method: "ec.payment.credential_request") + public static let windowOpenRequest = NotificationDescriptor(method: "ec.window.open_request") + public static let fulfillmentChange = NotificationDescriptor(method: "ec.fulfillment.change") + public static let fulfillmentAddressChangeRequest = NotificationDescriptor(method: "ec.fulfillment.address_change_request") + + public static let all: [String] = [ + ready.method, + auth.method, + error.method, + start.method, + complete.method, + messagesChange.method, + lineItemsChange.method, + buyerChange.method, + totalsChange.method, + paymentChange.method, + paymentInstrumentsChangeRequest.method, + paymentCredentialRequest.method, + windowOpenRequest.method, + fulfillmentChange.method, + fulfillmentAddressChangeRequest.method, + ] + } +} diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift index 697a7316..d3add317 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/ClientTests.swift @@ -38,7 +38,7 @@ private enum TestDelegationResult: ResponsePayload { } private let windowOpenDescriptor = DelegationDescriptor( - method: GeneratedProtocolCatalog.ecWindowOpenRequest.method, + method: EmbeddedCheckoutProtocol.Event.windowOpenRequest.method, delegation: "window.open", decode: { params in try? JSONDecoder().decode(TestURLPayload.self, from: params) @@ -59,8 +59,8 @@ struct ClientTests { @Test @MainActor func notificationDispatchesToRegisteredHandler() async throws { var receivedCheckout: Checkout? - let client = CheckoutTransport.Client() - .on(GeneratedProtocolCatalog.ecStart) { checkout in + let client = EmbeddedCheckoutProtocol.Client() + .on(EmbeddedCheckoutProtocol.Event.start) { checkout in receivedCheckout = checkout } @@ -73,8 +73,8 @@ struct ClientTests { @Test @MainActor func notificationDoesNotFireUnregisteredHandler() async throws { var completeFired = false - let client = CheckoutTransport.Client() - .on(GeneratedProtocolCatalog.ecComplete) { (_: Checkout) in + let client = EmbeddedCheckoutProtocol.Client() + .on(EmbeddedCheckoutProtocol.Event.complete) { (_: Checkout) in completeFired = true } @@ -85,8 +85,8 @@ struct ClientTests { } @Test @MainActor func notificationReturnsNil() async throws { - let client = CheckoutTransport.Client() - .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in } + let client = EmbeddedCheckoutProtocol.Client() + .on(EmbeddedCheckoutProtocol.Event.start) { (_: Checkout) in } let response = try await client.process(notificationFixture()) @@ -96,9 +96,9 @@ struct ClientTests { @Test @MainActor func multipleNotificationHandlersOnDifferentEvents() async throws { var startFired = false var completeFired = false - let client = CheckoutTransport.Client() - .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in startFired = true } - .on(GeneratedProtocolCatalog.ecComplete) { (_: Checkout) in completeFired = true } + let client = EmbeddedCheckoutProtocol.Client() + .on(EmbeddedCheckoutProtocol.Event.start) { (_: Checkout) in startFired = true } + .on(EmbeddedCheckoutProtocol.Event.complete) { (_: Checkout) in completeFired = true } _ = try await client.process(notificationFixture()) @@ -107,8 +107,8 @@ struct ClientTests { } @Test @MainActor func unknownMessageReturnsNil() async { - let client = CheckoutTransport.Client() - .on(GeneratedProtocolCatalog.ecStart) { (_: Checkout) in } + let client = EmbeddedCheckoutProtocol.Client() + .on(EmbeddedCheckoutProtocol.Event.start) { (_: Checkout) in } let response = await client.process("not valid json") @@ -120,7 +120,7 @@ struct ClientTests { {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com/terms"}} """# - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() .on(windowOpenDescriptor) { payload in payload.url == URL(string: "https://example.com/terms") ? .success : .rejected(reason: "unexpected url") } @@ -139,7 +139,7 @@ struct ClientTests { {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() .on(windowOpenDescriptor) { _ in .rejected(reason: "no presenter available") } @@ -156,7 +156,7 @@ struct ClientTests { } @Test @MainActor func delegationRequestReturnsNilWhenHandlerNotRegistered() async { - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# @@ -166,7 +166,7 @@ struct ClientTests { } @Test @MainActor func delegationRequestWithNullURLReturnsInvalidParamsError() async throws { - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() .on(windowOpenDescriptor) { _ in .success } let request = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":null}} @@ -186,7 +186,7 @@ struct ClientTests { {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com"}} """# - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() .on(windowOpenDescriptor) { _ in .rejected(reason: "first") } .on(windowOpenDescriptor) { _ in .success } @@ -202,7 +202,7 @@ struct ClientTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["window.open"]}} """# - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() .on(windowOpenDescriptor) { _ in .success } let response = try #require(await client.process(ready)) @@ -217,18 +217,18 @@ struct ClientTests { {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() let response = try #require(await client.process(ready)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-bad") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) - #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) + #expect(error["code"] as? Int == EmbeddedCheckoutProtocol.parseErrorCode) + #expect(error["message"] as? String == EmbeddedCheckoutProtocol.parseErrorMessage) } @Test @MainActor func readyReturnsResponse() async throws { - let client = CheckoutTransport.Client() + let client = EmbeddedCheckoutProtocol.Client() let response = try await client.process(readyFixture()) @@ -239,7 +239,7 @@ struct ClientTests { #expect(parsed["params"] == nil) let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutTransport.specVersion) + #expect(ucp["version"] as? String == EmbeddedCheckoutProtocol.specVersion) #expect(ucp["status"] as? String == "success") } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift index fc5eee43..a2dfefe9 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecDecodeTests.swift @@ -6,7 +6,7 @@ import Testing struct CodecDecodeTests { @Test func decodesNotification() throws { let json = try fixtureString("notification") - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .notification(method, payload) = message else { Issue.record("Expected .notification, got \(message)") @@ -25,7 +25,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","method":"ec.error","params":{"error":{"ucp":{"version":"2026-04-08","status":"error"},"messages":[{"type":"error","code":"unrecoverable","content":"Boom.","severity":"recoverable"}]}}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .notification(method, payload) = message else { Issue.record("Expected .notification, got \(message)") @@ -41,7 +41,7 @@ struct CodecDecodeTests { @Test func decodesRequestCarriesRawParams() throws { let json = try fixtureString("request") - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .request(id, method, params) = message else { Issue.record("Expected .request, got \(message)") @@ -61,7 +61,7 @@ struct CodecDecodeTests { @Test func decodesWindowOpenRequestAsRawRequest() throws { let json = try fixtureString("window_open_request") - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .request(id, method, params) = message else { Issue.record("Expected .request, got \(message)") @@ -79,7 +79,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"req-window-1","method":"ec.window.open_request","params":{"url":"https://example.com/terms","unknown":"value"}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .request(_, _, params) = message else { Issue.record("Expected .request, got \(message)") @@ -95,7 +95,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"req-window-bad","method":"ec.window.open_request","params":{"url":null}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -111,7 +111,7 @@ struct CodecDecodeTests { let json = """ {"jsonrpc":"2.0","method":"ec.unknown","params":{"something":"else"}} """ - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown, got \(message)") @@ -125,7 +125,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":1,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -140,7 +140,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":null,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -155,7 +155,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"ready-no-params","method":"ec.ready"} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .ready(id, delegations) = message else { Issue.record("Expected .ready, got \(message)") @@ -170,7 +170,7 @@ struct CodecDecodeTests { let json = #""" {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -178,15 +178,15 @@ struct CodecDecodeTests { } #expect(id == "ready-bad") - #expect(code == CheckoutTransport.parseErrorCode) - #expect(responseMessage == CheckoutTransport.parseErrorMessage) + #expect(code == EmbeddedCheckoutProtocol.parseErrorCode) + #expect(responseMessage == EmbeddedCheckoutProtocol.parseErrorMessage) } @Test func decodesNullReadyParamsAsParseError() { let json = #""" {"jsonrpc":"2.0","id":"ready-null","method":"ec.ready","params":null} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .error(id, code, responseMessage) = message else { Issue.record("Expected .error, got \(message)") @@ -194,15 +194,15 @@ struct CodecDecodeTests { } #expect(id == "ready-null") - #expect(code == CheckoutTransport.parseErrorCode) - #expect(responseMessage == CheckoutTransport.parseErrorMessage) + #expect(code == EmbeddedCheckoutProtocol.parseErrorCode) + #expect(responseMessage == EmbeddedCheckoutProtocol.parseErrorMessage) } @Test func rejectsFractionalJSONRPCID() { let json = #""" {"jsonrpc":"2.0","id":1.5,"method":"ec.ready","params":{"delegate":[]}} """# - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown for fractional id, got \(message)") @@ -214,7 +214,7 @@ struct CodecDecodeTests { @Test func handlesMalformedJSON() { let json = "not valid json at all" - let message = CheckoutTransport.decode(jsonRpc: json) + let message = EmbeddedCheckoutProtocol.decode(jsonRpc: json) guard case let .unknown(method, _) = message else { Issue.record("Expected .unknown for malformed JSON, got \(message)") diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift index 7a6f421e..df780a4d 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CodecEncodeTests.swift @@ -14,12 +14,12 @@ struct CodecEncodeTests { paymentHandlers: nil, services: nil, status: .success, - version: CheckoutTransport.specVersion + version: EmbeddedCheckoutProtocol.specVersion ), continueURL: nil, messages: nil ) - let json = CheckoutTransport.encodeResponse(id: "req-456", result: result) + let json = EmbeddedCheckoutProtocol.encodeResponse(id: "req-456", result: result) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["jsonrpc"] as? String == "2.0") @@ -28,7 +28,7 @@ struct CodecEncodeTests { } @Test func encodesReadyResponseWithResultEnvelope() throws { - let json = CheckoutTransport.encodeReadyResponse(id: "ready-1", acceptedDelegations: []) + let json = EmbeddedCheckoutProtocol.encodeReadyResponse(id: "ready-1", acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["jsonrpc"] as? String == "2.0") @@ -38,13 +38,13 @@ struct CodecEncodeTests { let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutTransport.specVersion) + #expect(ucp["version"] as? String == EmbeddedCheckoutProtocol.specVersion) #expect(ucp["status"] as? String == "success") #expect(result["delegate"] == nil, "Empty delegate list must be omitted") } @Test func encodesReadyResponseEchoesAcceptedDelegations() throws { - let json = CheckoutTransport.encodeReadyResponse(id: "ready-1", acceptedDelegations: ["window.open"]) + let json = EmbeddedCheckoutProtocol.encodeReadyResponse(id: "ready-1", acceptedDelegations: ["window.open"]) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -53,14 +53,14 @@ struct CodecEncodeTests { } @Test func encodesReadyResponseWithNumericID() throws { - let json = CheckoutTransport.encodeReadyResponse(id: 7, acceptedDelegations: []) + let json = EmbeddedCheckoutProtocol.encodeReadyResponse(id: 7, acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["id"] as? Int == 7) } @Test func encodesReadyResponseWithNullID() throws { - let json = CheckoutTransport.encodeReadyResponse(id: .null, acceptedDelegations: []) + let json = EmbeddedCheckoutProtocol.encodeReadyResponse(id: .null, acceptedDelegations: []) let parsed = try #require(JSONSerialization.jsonObject(with: Data(json.utf8)) as? [String: Any]) #expect(parsed["id"] is NSNull) @@ -71,13 +71,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential"]}} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message)) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-1") let result = try #require(parsed["result"] as? [String: Any]) let ucp = try #require(result["ucp"] as? [String: Any]) - #expect(ucp["version"] as? String == CheckoutTransport.specVersion) + #expect(ucp["version"] as? String == EmbeddedCheckoutProtocol.specVersion) #expect(ucp["status"] as? String == "success") } @@ -86,7 +86,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential","window.open","fulfillment.address_change"]}} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message, supportedDelegations: ["window.open"])) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message, supportedDelegations: ["window.open"])) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -99,7 +99,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-1","method":"ec.ready","params":{"delegate":["payment.credential"]}} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message, supportedDelegations: ["window.open"])) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message, supportedDelegations: ["window.open"])) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) let result = try #require(parsed["result"] as? [String: Any]) @@ -111,7 +111,7 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-no-params","method":"ec.ready"} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message)) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-no-params") @@ -124,13 +124,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-bad","method":"ec.ready","params":{"delegate":[null]}} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message)) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-bad") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) - #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) + #expect(error["code"] as? Int == EmbeddedCheckoutProtocol.parseErrorCode) + #expect(error["message"] as? String == EmbeddedCheckoutProtocol.parseErrorMessage) } @Test func acknowledgeReadyReturnsParseErrorForNullParams() throws { @@ -138,13 +138,13 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","id":"ready-null","method":"ec.ready","params":null} """# - let response = try #require(CheckoutTransport.acknowledgeReady(message)) + let response = try #require(EmbeddedCheckoutProtocol.acknowledgeReady(message)) let parsed = try #require(JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) #expect(parsed["id"] as? String == "ready-null") let error = try #require(parsed["error"] as? [String: Any]) - #expect(error["code"] as? Int == CheckoutTransport.parseErrorCode) - #expect(error["message"] as? String == CheckoutTransport.parseErrorMessage) + #expect(error["code"] as? Int == EmbeddedCheckoutProtocol.parseErrorCode) + #expect(error["message"] as? String == EmbeddedCheckoutProtocol.parseErrorMessage) } @Test func acknowledgeReadyReturnsNilForNonReadyMessage() { @@ -152,10 +152,10 @@ struct CodecEncodeTests { {"jsonrpc":"2.0","method":"ec.start","params":{"checkout":{"id":"c"}}} """# - #expect(CheckoutTransport.acknowledgeReady(message) == nil) + #expect(EmbeddedCheckoutProtocol.acknowledgeReady(message) == nil) } @Test func acknowledgeReadyReturnsNilForMalformedJSON() { - #expect(CheckoutTransport.acknowledgeReady("not json") == nil) + #expect(EmbeddedCheckoutProtocol.acknowledgeReady("not json") == nil) } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift index a6b43938..c5390e55 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/DescriptorTests.swift @@ -7,35 +7,35 @@ struct DescriptorTests { @Suite("Spec Version") struct SpecVersion { @Test func matchesOpenRPCInfoVersion() { - #expect(CheckoutTransport.specVersion == "2026-04-08") + #expect(EmbeddedCheckoutProtocol.specVersion == "2026-04-08") } } - @Suite("Generated Catalog") - struct GeneratedCatalog { + @Suite("Event Catalog") + struct EventCatalog { @Test func bindsNotificationMethods() { - #expect(GeneratedProtocolCatalog.ecStart.method == "ec.start") - #expect(GeneratedProtocolCatalog.ecComplete.method == "ec.complete") - #expect(GeneratedProtocolCatalog.ecMessagesChange.method == "ec.messages.change") - #expect(GeneratedProtocolCatalog.ecLineItemsChange.method == "ec.line_items.change") - #expect(GeneratedProtocolCatalog.ecTotalsChange.method == "ec.totals.change") - #expect(GeneratedProtocolCatalog.ecError.method == "ec.error") + #expect(EmbeddedCheckoutProtocol.Event.start.method == "ec.start") + #expect(EmbeddedCheckoutProtocol.Event.complete.method == "ec.complete") + #expect(EmbeddedCheckoutProtocol.Event.messagesChange.method == "ec.messages.change") + #expect(EmbeddedCheckoutProtocol.Event.lineItemsChange.method == "ec.line_items.change") + #expect(EmbeddedCheckoutProtocol.Event.totalsChange.method == "ec.totals.change") + #expect(EmbeddedCheckoutProtocol.Event.error.method == "ec.error") } @Test func exposesEveryOpenRPCMethod() { - #expect(GeneratedProtocolCatalog.allMethods.contains("ec.start")) - #expect(GeneratedProtocolCatalog.allMethods.contains("ec.complete")) - #expect(GeneratedProtocolCatalog.allMethods.contains("ec.window.open_request")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.start")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.complete")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.window.open_request")) } @Test func includesMethodsBeyondTheCuratedConsumerSubset() { - #expect(GeneratedProtocolCatalog.allMethods.contains("ec.payment.credential_request")) - #expect(GeneratedProtocolCatalog.allMethods.contains("ec.fulfillment.change")) - #expect(GeneratedProtocolCatalog.allMethods.contains("ep.cart.ready")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.payment.credential_request")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.fulfillment.change")) + #expect(EmbeddedCheckoutProtocol.Event.all.contains("ec.buyer.change")) } @Test func methodsAreUnique() { - #expect(Set(GeneratedProtocolCatalog.allMethods).count == GeneratedProtocolCatalog.allMethods.count) + #expect(Set(EmbeddedCheckoutProtocol.Event.all).count == EmbeddedCheckoutProtocol.Event.all.count) } } } diff --git a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/EmbeddedCheckoutProtocolURLTests.swift similarity index 68% rename from protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift rename to protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/EmbeddedCheckoutProtocolURLTests.swift index 877d57af..c0cb9976 100644 --- a/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/CheckoutTransportURLTests.swift +++ b/protocol/languages/swift/Tests/ShopifyCheckoutProtocolTests/EmbeddedCheckoutProtocolURLTests.swift @@ -2,7 +2,7 @@ import Foundation @testable import ShopifyCheckoutProtocol import Testing -@Suite("CheckoutTransport URL Tests") +@Suite("EmbeddedCheckoutProtocol URL Tests") struct CheckoutProtocolURLTests { private let baseURL = URL(string: "https://shop.com/cart/c/abc")! @@ -11,22 +11,22 @@ struct CheckoutProtocolURLTests { } @Test func appendsEcVersion() { - let items = queryItems(CheckoutTransport.url(for: baseURL)) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: baseURL)) + #expect(items.contains(URLQueryItem(name: "ec_version", value: EmbeddedCheckoutProtocol.specVersion))) } @Test func omitsDelegateByDefault() { - let items = queryItems(CheckoutTransport.url(for: baseURL)) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: baseURL)) #expect(!items.contains(where: { $0.name == "ec_delegate" })) } @Test func appendsSuppliedDelegate() { - let items = queryItems(CheckoutTransport.url(for: baseURL, delegations: ["window.open"])) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: baseURL, delegations: ["window.open"])) #expect(items.contains(URLQueryItem(name: "ec_delegate", value: "window.open"))) } @Test func joinsMultipleDelegationsWithComma() { - let result = CheckoutTransport.url( + let result = EmbeddedCheckoutProtocol.url( for: baseURL, delegations: ["window.open", "payment.credential"] ) @@ -35,29 +35,29 @@ struct CheckoutProtocolURLTests { } @Test func omitsDelegateWhenEmpty() { - let items = queryItems(CheckoutTransport.url(for: baseURL, delegations: [])) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: baseURL, delegations: [])) #expect(!items.contains(where: { $0.name == "ec_delegate" })) } @Test func preservesExistingQueryItems() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?key=cart_token&utm_source=email")) - let items = queryItems(CheckoutTransport.url(for: url)) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: url)) #expect(items.contains(URLQueryItem(name: "key", value: "cart_token"))) #expect(items.contains(URLQueryItem(name: "utm_source", value: "email"))) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) + #expect(items.contains(URLQueryItem(name: "ec_version", value: EmbeddedCheckoutProtocol.specVersion))) } @Test func replacesCallerSuppliedProtocolQueryItems() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_version=stale&ec_delegate=custom")) - let items = queryItems(CheckoutTransport.url(for: url, delegations: ["window.open"])) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: url, delegations: ["window.open"])) - #expect(items.filter { $0.name == "ec_version" }.map(\.value) == [CheckoutTransport.specVersion]) + #expect(items.filter { $0.name == "ec_version" }.map(\.value) == [EmbeddedCheckoutProtocol.specVersion]) #expect(items.filter { $0.name == "ec_delegate" }.map(\.value) == ["window.open"]) } @Test func isIdempotentOnRecall() { - let once = CheckoutTransport.url(for: baseURL, delegations: ["window.open"]) - let twice = CheckoutTransport.url(for: once, delegations: ["window.open"]) + let once = EmbeddedCheckoutProtocol.url(for: baseURL, delegations: ["window.open"]) + let twice = EmbeddedCheckoutProtocol.url(for: once, delegations: ["window.open"]) let items = queryItems(twice) #expect(items.filter { $0.name == "ec_version" }.count == 1) @@ -66,9 +66,9 @@ struct CheckoutProtocolURLTests { @Test func removesExistingDelegationWhenDelegationsAreEmpty() throws { let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_delegate=custom")) - let items = queryItems(CheckoutTransport.url(for: url, delegations: [])) + let items = queryItems(EmbeddedCheckoutProtocol.url(for: url, delegations: [])) - #expect(items.contains(URLQueryItem(name: "ec_version", value: CheckoutTransport.specVersion))) + #expect(items.contains(URLQueryItem(name: "ec_version", value: EmbeddedCheckoutProtocol.specVersion))) #expect(!items.contains { $0.name == "ec_delegate" }) } } diff --git a/protocol/scripts/generate_swift_catalog.mjs b/protocol/scripts/generate_swift_catalog.mjs index c4463269..2019797c 100644 --- a/protocol/scripts/generate_swift_catalog.mjs +++ b/protocol/scripts/generate_swift_catalog.mjs @@ -12,7 +12,7 @@ const openRpcPath = path.resolve( ); const outputPath = path.resolve( protocolRoot, - 'languages/swift/Sources/ShopifyCheckoutProtocol/Generated/Catalog.swift', + 'languages/swift/Sources/ShopifyCheckoutProtocol/Generated/EmbeddedCheckoutProtocol+Event.swift', ); const fallbackPayload = 'JSONAny'; @@ -32,7 +32,9 @@ function normalizeRef(ref) { } function methodNameToIdentifier(methodName) { - const parts = methodName.split(/[._]/g).filter(Boolean); + // Drop the leading `ec` capability segment; the enclosing + // EmbeddedCheckoutProtocol.Event namespace already conveys it. + const [, ...parts] = methodName.split(/[._]/g).filter(Boolean); return parts .map((part, index) => @@ -88,6 +90,13 @@ for (const rawMethod of openRpc.methods ?? []) { throw new Error('Encountered OpenRPC method without a name'); } + // Scope the Swift catalog to the Embedded Checkout (`ec.*`) capability. + // Sibling capabilities (e.g. `ep.cart.*`) are excluded until they have a + // typed payload and a consumer. + if (!method.name.startsWith('ec.')) { + continue; + } + entries.push({ identifier: methodNameToIdentifier(method.name), method: method.name, @@ -118,17 +127,19 @@ import Foundation ${conformances} -public enum GeneratedProtocolCatalog { +extension EmbeddedCheckoutProtocol { + public enum Event { ${entries .map( entry => - ` public static let ${entry.identifier} = NotificationDescriptor<${entry.payload}>(method: "${entry.method}")`, + ` public static let ${entry.identifier} = NotificationDescriptor<${entry.payload}>(method: "${entry.method}")`, ) .join('\n')} - public static let allMethods: [String] = [ -${entries.map(entry => ` ${entry.identifier}.method,`).join('\n')} - ] + public static let all: [String] = [ +${entries.map(entry => ` ${entry.identifier}.method,`).join('\n')} + ] + } } `; From 541cb4ac290fa26d1d1dbfbd149e8fd46a2c55f0 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Mon, 22 Jun 2026 15:56:53 +0100 Subject: [PATCH 7/7] Merge url method, use extension name formatting for client and codex --- .../swift/api/ShopifyCheckoutProtocol.json | 81 +++++++++---------- ... => EmbeddedCheckoutProtocol+Client.swift} | 0 ...t => EmbeddedCheckoutProtocol+Codec.swift} | 0 .../EmbeddedCheckoutProtocol+URL.swift | 25 ------ .../EmbeddedCheckoutProtocol.swift | 22 +++++ 5 files changed, 62 insertions(+), 66 deletions(-) rename protocol/languages/swift/Sources/ShopifyCheckoutProtocol/{Client.swift => EmbeddedCheckoutProtocol+Client.swift} (100%) rename protocol/languages/swift/Sources/ShopifyCheckoutProtocol/{Codec.swift => EmbeddedCheckoutProtocol+Codec.swift} (100%) delete mode 100644 protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift diff --git a/platforms/swift/api/ShopifyCheckoutProtocol.json b/platforms/swift/api/ShopifyCheckoutProtocol.json index 0b3bcc8e..84a25a1d 100644 --- a/platforms/swift/api/ShopifyCheckoutProtocol.json +++ b/platforms/swift/api/ShopifyCheckoutProtocol.json @@ -625,6 +625,46 @@ } ] }, + { + "kind": "Function", + "name": "url", + "printedName": "url(for:delegations:)", + "children": [ + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "URL", + "printedName": "Foundation.URL", + "usr": "s:10Foundation3URLV" + }, + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "hasDefaultArg": true, + "usr": "s:Sa" + } + ], + "declKind": "Func", + "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", + "moduleName": "ShopifyCheckoutProtocol", + "static": true, + "funcSelfKind": "NonMutating" + }, { "kind": "TypeDecl", "name": "Client", @@ -882,47 +922,6 @@ "isFromExtension": true, "funcSelfKind": "NonMutating" }, - { - "kind": "Function", - "name": "url", - "printedName": "url(for:delegations:)", - "children": [ - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - }, - { - "kind": "TypeNominal", - "name": "URL", - "printedName": "Foundation.URL", - "usr": "s:10Foundation3URLV" - }, - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "hasDefaultArg": true, - "usr": "s:Sa" - } - ], - "declKind": "Func", - "usr": "s:23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "mangledName": "$s23ShopifyCheckoutProtocol08EmbeddedbC0O3url3for11delegations10Foundation3URLVAI_SaySSGtFZ", - "moduleName": "ShopifyCheckoutProtocol", - "static": true, - "isFromExtension": true, - "funcSelfKind": "NonMutating" - }, { "kind": "TypeDecl", "name": "Event", diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+Client.swift similarity index 100% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Client.swift rename to protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+Client.swift diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+Codec.swift similarity index 100% rename from protocol/languages/swift/Sources/ShopifyCheckoutProtocol/Codec.swift rename to protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+Codec.swift diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift deleted file mode 100644 index 76c31686..00000000 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol+URL.swift +++ /dev/null @@ -1,25 +0,0 @@ -import Foundation - -extension EmbeddedCheckoutProtocol { - /// Returns the given checkout URL with the query parameters required to - /// initiate the Embedded Checkout Protocol handshake (`ec_version`, - /// `ec_delegate`). - public static func url( - for url: URL, - delegations: [String] = [] - ) -> URL { - guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false) else { - return url - } - var queryItems = components.queryItems ?? [] - queryItems.removeAll { $0.name == "ec_version" || $0.name == "ec_delegate" } - - queryItems.append(URLQueryItem(name: "ec_version", value: specVersion)) - if !delegations.isEmpty { - queryItems.append(URLQueryItem(name: "ec_delegate", value: delegations.joined(separator: ","))) - } - - components.queryItems = queryItems - return components.url ?? url - } -} diff --git a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift index 8dea46bf..8104a9d9 100644 --- a/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift +++ b/protocol/languages/swift/Sources/ShopifyCheckoutProtocol/EmbeddedCheckoutProtocol.swift @@ -6,4 +6,26 @@ public enum EmbeddedCheckoutProtocol { package static let readyMethod = "ec.ready" package static let parseErrorCode = -32700 package static let parseErrorMessage = "Parse error" + + /// Returns the given checkout URL with the query parameters required to + /// initiate the Embedded Checkout Protocol handshake (`ec_version`, + /// `ec_delegate`). + public static func url( + for url: URL, + delegations: [String] = [] + ) -> URL { + guard var components = URLComponents(url: url, resolvingAgainstBaseURL: false) else { + return url + } + var queryItems = components.queryItems ?? [] + queryItems.removeAll { $0.name == "ec_version" || $0.name == "ec_delegate" } + + queryItems.append(URLQueryItem(name: "ec_version", value: specVersion)) + if !delegations.isEmpty { + queryItems.append(URLQueryItem(name: "ec_delegate", value: delegations.joined(separator: ","))) + } + + components.queryItems = queryItems + return components.url ?? url + } }