diff --git a/.swift-version b/.swift-version index a3ec5a4b..5186d070 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.2 +4.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bf5aab1c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: objective-c -osx_image: xcode8.3 - -before_install: - - gem install xcpretty - -script: - - set -o pipefail - - "./Scripts/test_buy" - - "./Scripts/test_pay" - - "./Scripts/test_sample" - -notifications: - slack: - rooms: - secure: pbP4oFT5PMX6AFZyBJHDzfNEXLkwBzg87RWFAr2J4wZpN64zBuZiGHb4mzWteC7ZqCUn4ovA7NgYI18vq6gkNtfeAGGpFi8ZrS9GzIIhmJqwhHLl5BI9NwFLxVcq2jjjELtnm6msvhevA4nQxkfwbCcvZpB8rY55EXTpgKtwVske+hhJxFOkjHb9tlvMg5GK14cyVKNYim1o1bMOFa18Puy+1wFRW05GBQ6DWgBMmdhm7hfoPlKMPK8mkzDjR987uWJ/21Ggrr2jMuKsQLM9C4QLZA7xdUpqC7OkAGQqeEOrx0gcJ/b1BTsz5j2iAXIRzlUdcskWUChtNVPrZlAZ972XevGxiWB+YB6lfmzDT9FPFoLJkzLUSyW7Iog2ORJoM2CSEq80mfPkl4eQGFZWUGSqbxQxSbdGBbLcJm/7Zp58+UzS5rEocmhbikHip1QqT2ISMuBC2r5PcUe103eSzrjoGsyzVjZzNU2Pr2KfvlRIhQE77naiC3GDDyemDCkRmQ7HiwalOOlZ4xgr4wECZds/L0HUDkGL/xhc62+OXnDkpSJj8b6/eGezfNv3RLn390kuODrN+u50VmGtyJ+kCv6TO/D5xK39rzrYuV5FR5gSlYFMf5exygvFHuB88sTakJyAtg0F9MkzDb9wZwwsFnOLm3JDVODsQB+fWaXE5ps= - on_pull_requests: false - on_success: change - on_failure: always - template: - - "Build <%{build_url}|#%{build_number}> - %{result} - (<%{compare_url}|%{commit}>)\n%{branch} - %{repository}\nTook: %{duration}" diff --git a/Buy.xcodeproj/project.pbxproj b/Buy.xcodeproj/project.pbxproj index 57673d32..75308cd2 100644 --- a/Buy.xcodeproj/project.pbxproj +++ b/Buy.xcodeproj/project.pbxproj @@ -188,6 +188,144 @@ 9AAFAB771E6080A500864A17 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; 9AB421B11E93CA45005098C4 /* PayAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AB421B01E93CA45005098C4 /* PayAuthorization.swift */; }; 9ABC3E221F02DDC0004CF078 /* MD5Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A664D7F1EF159F8001BFB01 /* MD5Tests.swift */; }; + 9AC2EF391F6818180037E0D7 /* Attribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */; }; + 9AC2EF3A1F6818180037E0D7 /* OrderLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803E1EAA51C50020F187 /* OrderLineItem.swift */; }; + 9AC2EF3B1F6818180037E0D7 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C51EC9EE1D00921247 /* Log.swift */; }; + 9AC2EF3C1F6818180037E0D7 /* OrderCancelReason.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80391EAA51C50020F187 /* OrderCancelReason.swift */; }; + 9AC2EF3D1F6818180037E0D7 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; + 9AC2EF3E1F6818180037E0D7 /* ProductOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80471EAA51C50020F187 /* ProductOption.swift */; }; + 9AC2EF3F1F6818180037E0D7 /* QueryRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */; }; + 9AC2EF401F6818180037E0D7 /* ShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */; }; + 9AC2EF411F6818180037E0D7 /* CheckoutCustomerAssociatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80051EAA51C50020F187 /* CheckoutCustomerAssociatePayload.swift */; }; + 9AC2EF421F6818180037E0D7 /* Blog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CC1EE095B20060029B /* Blog.swift */; }; + 9AC2EF431F6818180037E0D7 /* AvailableShippingRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */; }; + 9AC2EF441F6818180037E0D7 /* CollectionConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */; }; + 9AC2EF451F6818180037E0D7 /* CheckoutGiftCardApplyPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80081EAA51C50020F187 /* CheckoutGiftCardApplyPayload.swift */; }; + 9AC2EF461F6818180037E0D7 /* OrderDisplayFulfillmentStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803C1EAA51C50020F187 /* OrderDisplayFulfillmentStatus.swift */; }; + 9AC2EF471F6818180037E0D7 /* ProductEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80461EAA51C50020F187 /* ProductEdge.swift */; }; + 9AC2EF481F6818180037E0D7 /* CheckoutAttributesUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFF1EAA51C50020F187 /* CheckoutAttributesUpdatePayload.swift */; }; + 9AC2EF491F6818180037E0D7 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; + 9AC2EF4A1F6818180037E0D7 /* CustomerUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802D1EAA51C50020F187 /* CustomerUpdatePayload.swift */; }; + 9AC2EF4B1F6818180037E0D7 /* Graph.Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CE1E8ED98A000254CD /* Graph.Task.swift */; }; + 9AC2EF4C1F6818180037E0D7 /* Customer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801C1EAA51C50020F187 /* Customer.swift */; }; + 9AC2EF4D1F6818180037E0D7 /* CustomerAccessTokenCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801E1EAA51C50020F187 /* CustomerAccessTokenCreateInput.swift */; }; + 9AC2EF4E1F6818180037E0D7 /* CustomerUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802C1EAA51C50020F187 /* CustomerUpdateInput.swift */; }; + 9AC2EF4F1F6818180037E0D7 /* OrderConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803A1EAA51C50020F187 /* OrderConnection.swift */; }; + 9AC2EF501F6818180037E0D7 /* MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A664D711EF05F97001BFB01 /* MD5.m */; }; + 9AC2EF511F6818180037E0D7 /* Graph.RetryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */; }; + 9AC2EF521F6818180037E0D7 /* CurrencyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */; }; + 9AC2EF531F6818180037E0D7 /* ShopPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */; }; + 9AC2EF541F6818180037E0D7 /* CheckoutShippingLineUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */; }; + 9AC2EF551F6818180037E0D7 /* CheckoutGiftCardRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80091EAA51C50020F187 /* CheckoutGiftCardRemovePayload.swift */; }; + 9AC2EF561F6818180037E0D7 /* CheckoutCompleteFreePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */; }; + 9AC2EF571F6818180037E0D7 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; + 9AC2EF581F6818180037E0D7 /* MailingAddressInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80351EAA51C50020F187 /* MailingAddressInput.swift */; }; + 9AC2EF591F6818180037E0D7 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; + 9AC2EF5A1F6818180037E0D7 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; + 9AC2EF5B1F6818180037E0D7 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; + 9AC2EF5C1F6818180037E0D7 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; + 9AC2EF5D1F6818180037E0D7 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80521EAA51C50020F187 /* Transaction.swift */; }; + 9AC2EF5E1F6818180037E0D7 /* CheckoutCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */; }; + 9AC2EF5F1F6818180037E0D7 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; + 9AC2EF601F6818180037E0D7 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; + 9AC2EF611F6818180037E0D7 /* CheckoutShippingAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80121EAA51C50020F187 /* CheckoutShippingAddressUpdatePayload.swift */; }; + 9AC2EF621F6818180037E0D7 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; + 9AC2EF631F6818180037E0D7 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; + 9AC2EF641F6818180037E0D7 /* CheckoutLineItemUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */; }; + 9AC2EF651F6818180037E0D7 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; + 9AC2EF661F6818180037E0D7 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; + 9AC2EF671F6818180037E0D7 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; + 9AC2EF681F6818180037E0D7 /* ProductImageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */; }; + 9AC2EF691F6818180037E0D7 /* CollectionEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80161EAA51C50020F187 /* CollectionEdge.swift */; }; + 9AC2EF6A1F6818180037E0D7 /* SelectedOptionInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80FB1EBA27970020F187 /* SelectedOptionInput.swift */; }; + 9AC2EF6B1F6818180037E0D7 /* Mutation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80361EAA51C50020F187 /* Mutation.swift */; }; + 9AC2EF6C1F6818180037E0D7 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A49DC821EC4AD580053710B /* Header.swift */; }; + 9AC2EF6D1F6818180037E0D7 /* CommentAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D51EE095BB0060029B /* CommentAuthor.swift */; }; + 9AC2EF6E1F6818180037E0D7 /* ProductVariantConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804A1EAA51C50020F187 /* ProductVariantConnection.swift */; }; + 9AC2EF6F1F6818180037E0D7 /* Comment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D41EE095BB0060029B /* Comment.swift */; }; + 9AC2EF701F6818180037E0D7 /* CustomerResetInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802A1EAA51C50020F187 /* CustomerResetInput.swift */; }; + 9AC2EF711F6818180037E0D7 /* CustomerAccessTokenDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80201EAA51C50020F187 /* CustomerAccessTokenDeletePayload.swift */; }; + 9AC2EF721F6818180037E0D7 /* CheckoutCompleteWithTokenizedPaymentPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80021EAA51C50020F187 /* CheckoutCompleteWithTokenizedPaymentPayload.swift */; }; + 9AC2EF731F6818180037E0D7 /* BlogConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CD1EE095B20060029B /* BlogConnection.swift */; }; + 9AC2EF741F6818180037E0D7 /* CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80181EAA51C50020F187 /* CreditCard.swift */; }; + 9AC2EF751F6818180037E0D7 /* GraphQL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFA3B6C1E6D9A5E0056C5AA /* GraphQL.swift */; }; + 9AC2EF761F6818180037E0D7 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802F1EAA51C50020F187 /* Image.swift */; }; + 9AC2EF771F6818180037E0D7 /* CustomerAddressCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80241EAA51C50020F187 /* CustomerAddressCreatePayload.swift */; }; + 9AC2EF781F6818180037E0D7 /* PageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80421EAA51C50020F187 /* PageInfo.swift */; }; + 9AC2EF791F6818180037E0D7 /* CustomerAccessTokenRenewPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80211EAA51C50020F187 /* CustomerAccessTokenRenewPayload.swift */; }; + 9AC2EF7A1F6818180037E0D7 /* CustomerAddressDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80251EAA51C50020F187 /* CustomerAddressDeletePayload.swift */; }; + 9AC2EF7B1F6818180037E0D7 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80441EAA51C50020F187 /* Product.swift */; }; + 9AC2EF7C1F6818180037E0D7 /* CustomerAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80261EAA51C50020F187 /* CustomerAddressUpdatePayload.swift */; }; + 9AC2EF7D1F6818180037E0D7 /* Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80431EAA51C50020F187 /* Payment.swift */; }; + 9AC2EF7E1F6818180037E0D7 /* ProductCollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */; }; + 9AC2EF7F1F6818180037E0D7 /* CheckoutLineItemsUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */; }; + 9AC2EF801F6818180037E0D7 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB711E60766E00864A17 /* Global.swift */; }; + 9AC2EF811F6818180037E0D7 /* ImageConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80301EAA51C50020F187 /* ImageConnection.swift */; }; + 9AC2EF821F6818180037E0D7 /* Graph.CachePolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */; }; + 9AC2EF831F6818180037E0D7 /* ProductVariant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80491EAA51C50020F187 /* ProductVariant.swift */; }; + 9AC2EF841F6818180037E0D7 /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */; }; + 9AC2EF851F6818180037E0D7 /* CollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */; }; + 9AC2EF861F6818180037E0D7 /* CustomerCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80281EAA51C50020F187 /* CustomerCreatePayload.swift */; }; + 9AC2EF871F6818180037E0D7 /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C21EE095AA0060029B /* Article.swift */; }; + 9AC2EF881F6818180037E0D7 /* MailingAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80321EAA51C50020F187 /* MailingAddress.swift */; }; + 9AC2EF891F6818180037E0D7 /* ArticleConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C41EE095AA0060029B /* ArticleConnection.swift */; }; + 9AC2EF8A1F6818180037E0D7 /* CropRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801A1EAA51C50020F187 /* CropRegion.swift */; }; + 9AC2EF8B1F6818180037E0D7 /* CheckoutLineItemsRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */; }; + 9AC2EF8C1F6818180037E0D7 /* StringConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFE1F16A0D7008DCF38 /* StringConnection.swift */; }; + 9AC2EF8D1F6818180037E0D7 /* Graph.CacheItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7AC751EBB77660014D95D /* Graph.CacheItem.swift */; }; + 9AC2EF8E1F6818180037E0D7 /* BlogSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CF1EE095B20060029B /* BlogSortKeys.swift */; }; + 9AC2EF8F1F6818180037E0D7 /* Checkout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */; }; + 9AC2EF901F6818180037E0D7 /* CheckoutLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */; }; + 9AC2EF911F6818180037E0D7 /* MailingAddressEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80341EAA51C50020F187 /* MailingAddressEdge.swift */; }; + 9AC2EF921F6818180037E0D7 /* CommentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D61EE095BB0060029B /* CommentConnection.swift */; }; + 9AC2EF931F6818180037E0D7 /* TransactionKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80531EAA51C50020F187 /* TransactionKind.swift */; }; + 9AC2EF941F6818180037E0D7 /* CustomerCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80271EAA51C50020F187 /* CustomerCreateInput.swift */; }; + 9AC2EF951F6818180037E0D7 /* ArticleEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C51EE095AA0060029B /* ArticleEdge.swift */; }; + 9AC2EF961F6818180037E0D7 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; + 9AC2EF971F6818180037E0D7 /* CustomerActivateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80221EAA51C50020F187 /* CustomerActivateInput.swift */; }; + 9AC2EF981F6818180037E0D7 /* CustomerActivatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80231EAA51C50020F187 /* CustomerActivatePayload.swift */; }; + 9AC2EF991F6818180037E0D7 /* AttributeInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */; }; + 9AC2EF9A1F6818180037E0D7 /* Storefront.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80571EAA51C50020F187 /* Storefront.swift */; }; + 9AC2EF9B1F6818180037E0D7 /* CountryCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1861F13ACCF0064AEA0 /* CountryCode.swift */; }; + 9AC2EF9C1F6818180037E0D7 /* MailingAddressConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80331EAA51C50020F187 /* MailingAddressConnection.swift */; }; + 9AC2EF9D1F6818180037E0D7 /* ImageEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80311EAA51C50020F187 /* ImageEdge.swift */; }; + 9AC2EF9E1F6818180037E0D7 /* ArticleAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */; }; + 9AC2EF9F1F6818180037E0D7 /* SelectedOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */; }; + 9AC2EFA01F6818180037E0D7 /* OrderLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803F1EAA51C50020F187 /* OrderLineItemConnection.swift */; }; + 9AC2EFA11F6818180037E0D7 /* CheckoutAttributesUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFE1EAA51C50020F187 /* CheckoutAttributesUpdateInput.swift */; }; + 9AC2EFA21F6818180037E0D7 /* CheckoutLineItemsAddPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */; }; + 9AC2EFA31F6818180037E0D7 /* CreditCardPaymentInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80191EAA51C50020F187 /* CreditCardPaymentInput.swift */; }; + 9AC2EFA41F6818180037E0D7 /* StringEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFD1F16A0D7008DCF38 /* StringEdge.swift */; }; + 9AC2EFA51F6818180037E0D7 /* Graph.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61B81E5F64230067FA90 /* Graph.Client.swift */; }; + 9AC2EFA61F6818180037E0D7 /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CB1E8EA710000254CD /* Graph.swift */; }; + 9AC2EFA71F6818180037E0D7 /* ProductSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80481EAA51C50020F187 /* ProductSortKeys.swift */; }; + 9AC2EFA81F6818180037E0D7 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; + 9AC2EFA91F6818180037E0D7 /* OrderEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803D1EAA51C50020F187 /* OrderEdge.swift */; }; + 9AC2EFAA1F6818180037E0D7 /* CheckoutEmailUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80071EAA51C50020F187 /* CheckoutEmailUpdatePayload.swift */; }; + 9AC2EFAB1F6818180037E0D7 /* Card.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F31EB785310020F187 /* Card.Client.swift */; }; + 9AC2EFAC1F6818180037E0D7 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80141EAA51C50020F187 /* Collection.swift */; }; + 9AC2EFAD1F6818180037E0D7 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; + 9AC2EFAE1F6818180037E0D7 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; + 9AC2EFAF1F6818180037E0D7 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; + 9AC2EFB01F6818180037E0D7 /* CheckoutCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */; }; + 9AC2EFB11F6818180037E0D7 /* OrderSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */; }; + 9AC2EFB21F6818180037E0D7 /* CheckoutCompleteWithCreditCardPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80011EAA51C50020F187 /* CheckoutCompleteWithCreditCardPayload.swift */; }; + 9AC2EFB31F6818180037E0D7 /* CheckoutLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */; }; + 9AC2EFB41F6818180037E0D7 /* ProductConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80451EAA51C50020F187 /* ProductConnection.swift */; }; + 9AC2EFB51F6818180037E0D7 /* CustomerAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801D1EAA51C50020F187 /* CustomerAccessToken.swift */; }; + 9AC2EFB61F6818180037E0D7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80381EAA51C50020F187 /* Order.swift */; }; + 9AC2EFB71F6818180037E0D7 /* CheckoutLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */; }; + 9AC2EFB81F6818180037E0D7 /* TokenizedPaymentInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80511EAA51C50020F187 /* TokenizedPaymentInput.swift */; }; + 9AC2EFB91F6818180037E0D7 /* CheckoutLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */; }; + 9AC2EFBA1F6818180037E0D7 /* OrderDisplayFinancialStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803B1EAA51C50020F187 /* OrderDisplayFinancialStatus.swift */; }; + 9AC2EFBB1F6818180037E0D7 /* ProductVariantEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */; }; + 9AC2EFBC1F6818180037E0D7 /* AppliedGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */; }; + 9AC2EFBD1F6818180037E0D7 /* CheckoutCustomerDisassociatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80061EAA51C50020F187 /* CheckoutCustomerDisassociatePayload.swift */; }; + 9AC2EFBE1F6818180037E0D7 /* CommentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D71EE095BB0060029B /* CommentEdge.swift */; }; + 9AC2EFBF1F6818180037E0D7 /* GraphQL+ScalarSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61A01E5F5A190067FA90 /* GraphQL+ScalarSupport.swift */; }; + 9AC2EFC21F6818180037E0D7 /* Buy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AEF60F61E5F42D90067FA90 /* Buy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9AC2EFC31F6818180037E0D7 /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A664D701EF05F97001BFB01 /* MD5.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9AC2EFD71F686DB90037E0D7 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; 9AE1F8161F605F8F00147E77 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; 9AE2A1C21EC6373B00921247 /* Graph.CachePolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C11EC6373B00921247 /* Graph.CachePolicyTests.swift */; }; 9AE2A1C61EC9EE1D00921247 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C51EC9EE1D00921247 /* Log.swift */; }; @@ -200,8 +338,148 @@ 9AF1C1871F13B4530064AEA0 /* CountryCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1861F13ACCF0064AEA0 /* CountryCode.swift */; }; 9AF1C1881F13B45C0064AEA0 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; 9AF1C1891F13B45E0064AEA0 /* ProductCollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */; }; + 9AF255B31F6FEE50005BB0C9 /* Attribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */; }; + 9AF255B41F6FEE50005BB0C9 /* OrderLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803E1EAA51C50020F187 /* OrderLineItem.swift */; }; + 9AF255B51F6FEE50005BB0C9 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C51EC9EE1D00921247 /* Log.swift */; }; + 9AF255B61F6FEE50005BB0C9 /* OrderCancelReason.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80391EAA51C50020F187 /* OrderCancelReason.swift */; }; + 9AF255B71F6FEE50005BB0C9 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; + 9AF255B81F6FEE50005BB0C9 /* ProductOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80471EAA51C50020F187 /* ProductOption.swift */; }; + 9AF255B91F6FEE50005BB0C9 /* QueryRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */; }; + 9AF255BA1F6FEE50005BB0C9 /* ShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */; }; + 9AF255BB1F6FEE50005BB0C9 /* CheckoutCustomerAssociatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80051EAA51C50020F187 /* CheckoutCustomerAssociatePayload.swift */; }; + 9AF255BC1F6FEE50005BB0C9 /* Blog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CC1EE095B20060029B /* Blog.swift */; }; + 9AF255BD1F6FEE50005BB0C9 /* AvailableShippingRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */; }; + 9AF255BE1F6FEE50005BB0C9 /* CollectionConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */; }; + 9AF255BF1F6FEE50005BB0C9 /* CheckoutGiftCardApplyPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80081EAA51C50020F187 /* CheckoutGiftCardApplyPayload.swift */; }; + 9AF255C01F6FEE50005BB0C9 /* OrderDisplayFulfillmentStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803C1EAA51C50020F187 /* OrderDisplayFulfillmentStatus.swift */; }; + 9AF255C11F6FEE50005BB0C9 /* ProductEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80461EAA51C50020F187 /* ProductEdge.swift */; }; + 9AF255C21F6FEE50005BB0C9 /* CheckoutAttributesUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFF1EAA51C50020F187 /* CheckoutAttributesUpdatePayload.swift */; }; + 9AF255C31F6FEE50005BB0C9 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; + 9AF255C41F6FEE50005BB0C9 /* CustomerUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802D1EAA51C50020F187 /* CustomerUpdatePayload.swift */; }; + 9AF255C51F6FEE50005BB0C9 /* Graph.Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CE1E8ED98A000254CD /* Graph.Task.swift */; }; + 9AF255C61F6FEE50005BB0C9 /* Customer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801C1EAA51C50020F187 /* Customer.swift */; }; + 9AF255C71F6FEE50005BB0C9 /* CustomerAccessTokenCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801E1EAA51C50020F187 /* CustomerAccessTokenCreateInput.swift */; }; + 9AF255C81F6FEE50005BB0C9 /* CustomerUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802C1EAA51C50020F187 /* CustomerUpdateInput.swift */; }; + 9AF255C91F6FEE50005BB0C9 /* OrderConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803A1EAA51C50020F187 /* OrderConnection.swift */; }; + 9AF255CA1F6FEE50005BB0C9 /* MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A664D711EF05F97001BFB01 /* MD5.m */; }; + 9AF255CB1F6FEE50005BB0C9 /* Graph.RetryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */; }; + 9AF255CC1F6FEE50005BB0C9 /* CurrencyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */; }; + 9AF255CD1F6FEE50005BB0C9 /* ShopPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */; }; + 9AF255CE1F6FEE50005BB0C9 /* CheckoutShippingLineUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */; }; + 9AF255CF1F6FEE50005BB0C9 /* CheckoutGiftCardRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80091EAA51C50020F187 /* CheckoutGiftCardRemovePayload.swift */; }; + 9AF255D01F6FEE50005BB0C9 /* CheckoutCompleteFreePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */; }; + 9AF255D11F6FEE50005BB0C9 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; + 9AF255D21F6FEE50005BB0C9 /* MailingAddressInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80351EAA51C50020F187 /* MailingAddressInput.swift */; }; + 9AF255D31F6FEE50005BB0C9 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; + 9AF255D41F6FEE50005BB0C9 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; + 9AF255D51F6FEE50005BB0C9 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; + 9AF255D61F6FEE50005BB0C9 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; + 9AF255D71F6FEE50005BB0C9 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80521EAA51C50020F187 /* Transaction.swift */; }; + 9AF255D81F6FEE50005BB0C9 /* CheckoutCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */; }; + 9AF255D91F6FEE50005BB0C9 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; + 9AF255DA1F6FEE50005BB0C9 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; + 9AF255DB1F6FEE50005BB0C9 /* CheckoutShippingAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80121EAA51C50020F187 /* CheckoutShippingAddressUpdatePayload.swift */; }; + 9AF255DC1F6FEE50005BB0C9 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; + 9AF255DD1F6FEE50005BB0C9 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; + 9AF255DE1F6FEE50005BB0C9 /* CheckoutLineItemUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */; }; + 9AF255DF1F6FEE50005BB0C9 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; + 9AF255E01F6FEE50005BB0C9 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; + 9AF255E11F6FEE50005BB0C9 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; + 9AF255E21F6FEE50005BB0C9 /* ProductImageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */; }; + 9AF255E31F6FEE50005BB0C9 /* CollectionEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80161EAA51C50020F187 /* CollectionEdge.swift */; }; + 9AF255E41F6FEE50005BB0C9 /* SelectedOptionInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80FB1EBA27970020F187 /* SelectedOptionInput.swift */; }; + 9AF255E51F6FEE50005BB0C9 /* Mutation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80361EAA51C50020F187 /* Mutation.swift */; }; + 9AF255E61F6FEE50005BB0C9 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A49DC821EC4AD580053710B /* Header.swift */; }; + 9AF255E71F6FEE50005BB0C9 /* CommentAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D51EE095BB0060029B /* CommentAuthor.swift */; }; + 9AF255E81F6FEE50005BB0C9 /* ProductVariantConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804A1EAA51C50020F187 /* ProductVariantConnection.swift */; }; + 9AF255E91F6FEE50005BB0C9 /* Comment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D41EE095BB0060029B /* Comment.swift */; }; + 9AF255EA1F6FEE50005BB0C9 /* CustomerResetInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802A1EAA51C50020F187 /* CustomerResetInput.swift */; }; + 9AF255EB1F6FEE50005BB0C9 /* CustomerAccessTokenDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80201EAA51C50020F187 /* CustomerAccessTokenDeletePayload.swift */; }; + 9AF255EC1F6FEE50005BB0C9 /* CheckoutCompleteWithTokenizedPaymentPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80021EAA51C50020F187 /* CheckoutCompleteWithTokenizedPaymentPayload.swift */; }; + 9AF255ED1F6FEE50005BB0C9 /* BlogConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CD1EE095B20060029B /* BlogConnection.swift */; }; + 9AF255EE1F6FEE50005BB0C9 /* CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80181EAA51C50020F187 /* CreditCard.swift */; }; + 9AF255EF1F6FEE50005BB0C9 /* GraphQL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFA3B6C1E6D9A5E0056C5AA /* GraphQL.swift */; }; + 9AF255F01F6FEE50005BB0C9 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802F1EAA51C50020F187 /* Image.swift */; }; + 9AF255F11F6FEE50005BB0C9 /* CustomerAddressCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80241EAA51C50020F187 /* CustomerAddressCreatePayload.swift */; }; + 9AF255F21F6FEE50005BB0C9 /* PageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80421EAA51C50020F187 /* PageInfo.swift */; }; + 9AF255F31F6FEE50005BB0C9 /* CustomerAccessTokenRenewPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80211EAA51C50020F187 /* CustomerAccessTokenRenewPayload.swift */; }; + 9AF255F41F6FEE50005BB0C9 /* CustomerAddressDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80251EAA51C50020F187 /* CustomerAddressDeletePayload.swift */; }; + 9AF255F51F6FEE50005BB0C9 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80441EAA51C50020F187 /* Product.swift */; }; + 9AF255F61F6FEE50005BB0C9 /* CustomerAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80261EAA51C50020F187 /* CustomerAddressUpdatePayload.swift */; }; + 9AF255F71F6FEE50005BB0C9 /* Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80431EAA51C50020F187 /* Payment.swift */; }; + 9AF255F81F6FEE50005BB0C9 /* ProductCollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */; }; + 9AF255F91F6FEE50005BB0C9 /* CheckoutLineItemsUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */; }; + 9AF255FA1F6FEE50005BB0C9 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB711E60766E00864A17 /* Global.swift */; }; + 9AF255FB1F6FEE50005BB0C9 /* ImageConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80301EAA51C50020F187 /* ImageConnection.swift */; }; + 9AF255FC1F6FEE50005BB0C9 /* Graph.CachePolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */; }; + 9AF255FD1F6FEE50005BB0C9 /* ProductVariant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80491EAA51C50020F187 /* ProductVariant.swift */; }; + 9AF255FE1F6FEE50005BB0C9 /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */; }; + 9AF255FF1F6FEE50005BB0C9 /* CollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */; }; + 9AF256001F6FEE50005BB0C9 /* CustomerCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80281EAA51C50020F187 /* CustomerCreatePayload.swift */; }; + 9AF256011F6FEE50005BB0C9 /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C21EE095AA0060029B /* Article.swift */; }; + 9AF256021F6FEE50005BB0C9 /* MailingAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80321EAA51C50020F187 /* MailingAddress.swift */; }; + 9AF256031F6FEE50005BB0C9 /* ArticleConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C41EE095AA0060029B /* ArticleConnection.swift */; }; + 9AF256041F6FEE50005BB0C9 /* CropRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801A1EAA51C50020F187 /* CropRegion.swift */; }; + 9AF256051F6FEE50005BB0C9 /* CheckoutLineItemsRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */; }; + 9AF256061F6FEE50005BB0C9 /* StringConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFE1F16A0D7008DCF38 /* StringConnection.swift */; }; + 9AF256071F6FEE50005BB0C9 /* Graph.CacheItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7AC751EBB77660014D95D /* Graph.CacheItem.swift */; }; + 9AF256081F6FEE50005BB0C9 /* BlogSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CF1EE095B20060029B /* BlogSortKeys.swift */; }; + 9AF256091F6FEE50005BB0C9 /* Checkout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */; }; + 9AF2560A1F6FEE50005BB0C9 /* CheckoutLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */; }; + 9AF2560B1F6FEE50005BB0C9 /* MailingAddressEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80341EAA51C50020F187 /* MailingAddressEdge.swift */; }; + 9AF2560C1F6FEE50005BB0C9 /* CommentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D61EE095BB0060029B /* CommentConnection.swift */; }; + 9AF2560D1F6FEE50005BB0C9 /* TransactionKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80531EAA51C50020F187 /* TransactionKind.swift */; }; + 9AF2560E1F6FEE50005BB0C9 /* CustomerCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80271EAA51C50020F187 /* CustomerCreateInput.swift */; }; + 9AF2560F1F6FEE50005BB0C9 /* ArticleEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C51EE095AA0060029B /* ArticleEdge.swift */; }; + 9AF256101F6FEE50005BB0C9 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; + 9AF256111F6FEE50005BB0C9 /* CustomerActivateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80221EAA51C50020F187 /* CustomerActivateInput.swift */; }; + 9AF256121F6FEE50005BB0C9 /* CustomerActivatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80231EAA51C50020F187 /* CustomerActivatePayload.swift */; }; + 9AF256131F6FEE50005BB0C9 /* AttributeInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */; }; + 9AF256141F6FEE50005BB0C9 /* Storefront.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80571EAA51C50020F187 /* Storefront.swift */; }; + 9AF256151F6FEE50005BB0C9 /* CountryCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1861F13ACCF0064AEA0 /* CountryCode.swift */; }; + 9AF256161F6FEE50005BB0C9 /* MailingAddressConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80331EAA51C50020F187 /* MailingAddressConnection.swift */; }; + 9AF256171F6FEE50005BB0C9 /* ImageEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80311EAA51C50020F187 /* ImageEdge.swift */; }; + 9AF256181F6FEE50005BB0C9 /* ArticleAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */; }; + 9AF256191F6FEE50005BB0C9 /* SelectedOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */; }; + 9AF2561A1F6FEE50005BB0C9 /* OrderLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803F1EAA51C50020F187 /* OrderLineItemConnection.swift */; }; + 9AF2561B1F6FEE50005BB0C9 /* CheckoutAttributesUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFE1EAA51C50020F187 /* CheckoutAttributesUpdateInput.swift */; }; + 9AF2561C1F6FEE50005BB0C9 /* CheckoutLineItemsAddPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */; }; + 9AF2561D1F6FEE50005BB0C9 /* CreditCardPaymentInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80191EAA51C50020F187 /* CreditCardPaymentInput.swift */; }; + 9AF2561E1F6FEE50005BB0C9 /* StringEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFD1F16A0D7008DCF38 /* StringEdge.swift */; }; + 9AF2561F1F6FEE50005BB0C9 /* Graph.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61B81E5F64230067FA90 /* Graph.Client.swift */; }; + 9AF256201F6FEE50005BB0C9 /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CB1E8EA710000254CD /* Graph.swift */; }; + 9AF256211F6FEE50005BB0C9 /* ProductSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80481EAA51C50020F187 /* ProductSortKeys.swift */; }; + 9AF256221F6FEE50005BB0C9 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; + 9AF256231F6FEE50005BB0C9 /* OrderEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803D1EAA51C50020F187 /* OrderEdge.swift */; }; + 9AF256241F6FEE50005BB0C9 /* CheckoutEmailUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80071EAA51C50020F187 /* CheckoutEmailUpdatePayload.swift */; }; + 9AF256251F6FEE50005BB0C9 /* Card.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F31EB785310020F187 /* Card.Client.swift */; }; + 9AF256261F6FEE50005BB0C9 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80141EAA51C50020F187 /* Collection.swift */; }; + 9AF256271F6FEE50005BB0C9 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; + 9AF256281F6FEE50005BB0C9 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; + 9AF256291F6FEE50005BB0C9 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; + 9AF2562A1F6FEE50005BB0C9 /* CheckoutCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */; }; + 9AF2562B1F6FEE50005BB0C9 /* OrderSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */; }; + 9AF2562C1F6FEE50005BB0C9 /* CheckoutCompleteWithCreditCardPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80011EAA51C50020F187 /* CheckoutCompleteWithCreditCardPayload.swift */; }; + 9AF2562D1F6FEE50005BB0C9 /* CheckoutLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */; }; + 9AF2562E1F6FEE50005BB0C9 /* ProductConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80451EAA51C50020F187 /* ProductConnection.swift */; }; + 9AF2562F1F6FEE50005BB0C9 /* CustomerAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801D1EAA51C50020F187 /* CustomerAccessToken.swift */; }; + 9AF256301F6FEE50005BB0C9 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80381EAA51C50020F187 /* Order.swift */; }; + 9AF256311F6FEE50005BB0C9 /* CheckoutLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */; }; + 9AF256321F6FEE50005BB0C9 /* TokenizedPaymentInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80511EAA51C50020F187 /* TokenizedPaymentInput.swift */; }; + 9AF256331F6FEE50005BB0C9 /* CheckoutLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */; }; + 9AF256341F6FEE50005BB0C9 /* OrderDisplayFinancialStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803B1EAA51C50020F187 /* OrderDisplayFinancialStatus.swift */; }; + 9AF256351F6FEE50005BB0C9 /* ProductVariantEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */; }; + 9AF256361F6FEE50005BB0C9 /* AppliedGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */; }; + 9AF256371F6FEE50005BB0C9 /* CheckoutCustomerDisassociatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80061EAA51C50020F187 /* CheckoutCustomerDisassociatePayload.swift */; }; + 9AF256381F6FEE50005BB0C9 /* CommentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D71EE095BB0060029B /* CommentEdge.swift */; }; + 9AF256391F6FEE50005BB0C9 /* GraphQL+ScalarSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61A01E5F5A190067FA90 /* GraphQL+ScalarSupport.swift */; }; + 9AF2563C1F6FEE50005BB0C9 /* Buy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AEF60F61E5F42D90067FA90 /* Buy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9AF2563D1F6FEE50005BB0C9 /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A664D701EF05F97001BFB01 /* MD5.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9AF256441F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; + 9AF256451F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; 9AFA38EF1E64850A0056C5AA /* Buy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AEF60F31E5F42D90067FA90 /* Buy.framework */; }; 9AFA3B6D1E6D9A5E0056C5AA /* GraphQL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFA3B6C1E6D9A5E0056C5AA /* GraphQL.swift */; }; + 9AFEF46E1F72DB64003FA8C5 /* MockPaySession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -392,6 +670,8 @@ 9AAFAB711E60766E00864A17 /* Global.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = ""; }; 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.QueryError.swift; sourceTree = ""; }; 9AB421B01E93CA45005098C4 /* PayAuthorization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayAuthorization.swift; sourceTree = ""; }; + 9AC2EFC81F6818180037E0D7 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+Input.swift"; sourceTree = ""; }; 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariantSortKeys.swift; sourceTree = ""; }; 9AE2A1C11EC6373B00921247 /* Graph.CachePolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.CachePolicyTests.swift; sourceTree = ""; }; 9AE2A1C51EC9EE1D00921247 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; @@ -405,9 +685,11 @@ 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCollectionSortKeys.swift; sourceTree = ""; }; 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentSettings.swift; sourceTree = ""; }; 9AF1C1861F13ACCF0064AEA0 /* CountryCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryCode.swift; sourceTree = ""; }; + 9AF256421F6FEE50005BB0C9 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AFA38EA1E64850A0056C5AA /* BuyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BuyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9AFA38EE1E64850A0056C5AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9AFA3B6C1E6D9A5E0056C5AA /* GraphQL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQL.swift; sourceTree = ""; }; + 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPaySession.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -426,6 +708,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AC2EFC01F6818180037E0D7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AEF60EF1E5F42D90067FA90 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -433,6 +722,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AF2563A1F6FEE50005BB0C9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AFA38E71E64850A0056C5AA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -664,6 +960,7 @@ 9AADF1C61EA63ED000D22740 /* MockPaymentMethod.swift */, 9AADF1C81EA63FB900D22740 /* MockPaymentToken.swift */, 9AADF1CA1EA640C000D22740 /* MockPayment.swift */, + 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */, ); path = Mocks; sourceTree = ""; @@ -736,8 +1033,10 @@ isa = PBXGroup; children = ( 9AEF60F31E5F42D90067FA90 /* Buy.framework */, - 9AFA38EA1E64850A0056C5AA /* BuyTests.xctest */, + 9AC2EFC81F6818180037E0D7 /* Buy.framework */, + 9AF256421F6FEE50005BB0C9 /* Buy.framework */, 9A4068DC1E8E7658000254CD /* Pay.framework */, + 9AFA38EA1E64850A0056C5AA /* BuyTests.xctest */, 9A4068E41E8E7659000254CD /* PayTests.xctest */, ); name = Products; @@ -771,6 +1070,7 @@ isa = PBXGroup; children = ( 9AEF61A01E5F5A190067FA90 /* GraphQL+ScalarSupport.swift */, + 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */, ); path = Custom; sourceTree = ""; @@ -808,6 +1108,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AC2EFC11F6818180037E0D7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9AC2EFC21F6818180037E0D7 /* Buy.h in Headers */, + 9AC2EFC31F6818180037E0D7 /* MD5.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AEF60F01E5F42D90067FA90 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -817,6 +1126,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AF2563B1F6FEE50005BB0C9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9AF2563C1F6FEE50005BB0C9 /* Buy.h in Headers */, + 9AF2563D1F6FEE50005BB0C9 /* MD5.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -856,6 +1174,24 @@ productReference = 9A4068E41E8E7659000254CD /* PayTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 9AC2EF371F6818180037E0D7 /* Buy watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9AC2EFC51F6818180037E0D7 /* Build configuration list for PBXNativeTarget "Buy watchOS" */; + buildPhases = ( + 9AC2EF381F6818180037E0D7 /* Sources */, + 9AC2EFC01F6818180037E0D7 /* Frameworks */, + 9AC2EFC11F6818180037E0D7 /* Headers */, + 9AC2EFC41F6818180037E0D7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Buy watchOS"; + productName = Buy; + productReference = 9AC2EFC81F6818180037E0D7 /* Buy.framework */; + productType = "com.apple.product-type.framework"; + }; 9AEF60F21E5F42D90067FA90 /* Buy */ = { isa = PBXNativeTarget; buildConfigurationList = 9AEF60FB1E5F42D90067FA90 /* Build configuration list for PBXNativeTarget "Buy" */; @@ -874,6 +1210,24 @@ productReference = 9AEF60F31E5F42D90067FA90 /* Buy.framework */; productType = "com.apple.product-type.framework"; }; + 9AF255B11F6FEE50005BB0C9 /* Buy tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9AF2563F1F6FEE50005BB0C9 /* Build configuration list for PBXNativeTarget "Buy tvOS" */; + buildPhases = ( + 9AF255B21F6FEE50005BB0C9 /* Sources */, + 9AF2563A1F6FEE50005BB0C9 /* Frameworks */, + 9AF2563B1F6FEE50005BB0C9 /* Headers */, + 9AF2563E1F6FEE50005BB0C9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Buy tvOS"; + productName = Buy; + productReference = 9AF256421F6FEE50005BB0C9 /* Buy.framework */; + productType = "com.apple.product-type.framework"; + }; 9AFA38E91E64850A0056C5AA /* BuyTests */ = { isa = PBXNativeTarget; buildConfigurationList = 9AFA38F41E64850A0056C5AA /* Build configuration list for PBXNativeTarget "BuyTests" */; @@ -899,7 +1253,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Shopify Inc."; TargetAttributes = { 9A0C80C51EAE73840020F187 = { @@ -916,10 +1270,17 @@ CreatedOnToolsVersion = 8.3; ProvisioningStyle = Automatic; }; + 9AC2EF371F6818180037E0D7 = { + ProvisioningStyle = Automatic; + }; 9AEF60F21E5F42D90067FA90 = { CreatedOnToolsVersion = 8.2.1; ProvisioningStyle = Automatic; }; + 9AF255B11F6FEE50005BB0C9 = { + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; 9AFA38E91E64850A0056C5AA = { CreatedOnToolsVersion = 8.2.1; ProvisioningStyle = Automatic; @@ -939,8 +1300,10 @@ projectRoot = ""; targets = ( 9AEF60F21E5F42D90067FA90 /* Buy */, - 9AFA38E91E64850A0056C5AA /* BuyTests */, + 9AC2EF371F6818180037E0D7 /* Buy watchOS */, + 9AF255B11F6FEE50005BB0C9 /* Buy tvOS */, 9A4068DB1E8E7658000254CD /* Pay */, + 9AFA38E91E64850A0056C5AA /* BuyTests */, 9A4068E31E8E7659000254CD /* PayTests */, 9A0C80C51EAE73840020F187 /* Documentation */, ); @@ -962,6 +1325,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AC2EFC41F6818180037E0D7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AEF60F11E5F42D90067FA90 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -969,6 +1339,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AF2563E1F6FEE50005BB0C9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AFA38E81E64850A0056C5AA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1029,6 +1406,7 @@ 9A4068EA1E8E7659000254CD /* PaySessionTests.swift in Sources */, 9A0C7FD91EA686A20020F187 /* PayAddressTests.swift in Sources */, 9A0C7FD71EA686240020F187 /* PayCurrencyTests.swift in Sources */, + 9AFEF46E1F72DB64003FA8C5 /* MockPaySession.swift in Sources */, 9A0C7FD51EA682640020F187 /* PayLineItemTests.swift in Sources */, 9A0C7FCD1EA6631B0020F187 /* Models.swift in Sources */, 9AEC90E41E9FFAA6008C6E1C /* MockAuthorizationController.swift in Sources */, @@ -1041,6 +1419,149 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AC2EF381F6818180037E0D7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9AC2EF391F6818180037E0D7 /* Attribute.swift in Sources */, + 9AC2EF3A1F6818180037E0D7 /* OrderLineItem.swift in Sources */, + 9AC2EF3B1F6818180037E0D7 /* Log.swift in Sources */, + 9AC2EF3C1F6818180037E0D7 /* OrderCancelReason.swift in Sources */, + 9AC2EF3D1F6818180037E0D7 /* ProductVariantSortKeys.swift in Sources */, + 9AC2EF3E1F6818180037E0D7 /* ProductOption.swift in Sources */, + 9AC2EF3F1F6818180037E0D7 /* QueryRoot.swift in Sources */, + 9AC2EF401F6818180037E0D7 /* ShippingRate.swift in Sources */, + 9AC2EF411F6818180037E0D7 /* CheckoutCustomerAssociatePayload.swift in Sources */, + 9AC2EF421F6818180037E0D7 /* Blog.swift in Sources */, + 9AC2EF431F6818180037E0D7 /* AvailableShippingRates.swift in Sources */, + 9AC2EF441F6818180037E0D7 /* CollectionConnection.swift in Sources */, + 9AC2EF451F6818180037E0D7 /* CheckoutGiftCardApplyPayload.swift in Sources */, + 9AC2EF461F6818180037E0D7 /* OrderDisplayFulfillmentStatus.swift in Sources */, + 9AC2EF471F6818180037E0D7 /* ProductEdge.swift in Sources */, + 9AC2EF481F6818180037E0D7 /* CheckoutAttributesUpdatePayload.swift in Sources */, + 9AC2EF491F6818180037E0D7 /* WeightUnit.swift in Sources */, + 9AC2EF4A1F6818180037E0D7 /* CustomerUpdatePayload.swift in Sources */, + 9AC2EF4B1F6818180037E0D7 /* Graph.Task.swift in Sources */, + 9AC2EF4C1F6818180037E0D7 /* Customer.swift in Sources */, + 9AC2EF4D1F6818180037E0D7 /* CustomerAccessTokenCreateInput.swift in Sources */, + 9AC2EF4E1F6818180037E0D7 /* CustomerUpdateInput.swift in Sources */, + 9AC2EF4F1F6818180037E0D7 /* OrderConnection.swift in Sources */, + 9AC2EF501F6818180037E0D7 /* MD5.m in Sources */, + 9AC2EF511F6818180037E0D7 /* Graph.RetryHandler.swift in Sources */, + 9AC2EF521F6818180037E0D7 /* CurrencyCode.swift in Sources */, + 9AC2EF531F6818180037E0D7 /* ShopPolicy.swift in Sources */, + 9AC2EF541F6818180037E0D7 /* CheckoutShippingLineUpdatePayload.swift in Sources */, + 9AC2EF551F6818180037E0D7 /* CheckoutGiftCardRemovePayload.swift in Sources */, + 9AC2EF561F6818180037E0D7 /* CheckoutCompleteFreePayload.swift in Sources */, + 9AC2EF571F6818180037E0D7 /* DigitalWallet.swift in Sources */, + 9AC2EF581F6818180037E0D7 /* MailingAddressInput.swift in Sources */, + 9AC2EF591F6818180037E0D7 /* CustomerRecoverPayload.swift in Sources */, + 9AC2EF5A1F6818180037E0D7 /* PaymentSettings.swift in Sources */, + 9AC2EF5B1F6818180037E0D7 /* Domain.swift in Sources */, + 9AC2EF5C1F6818180037E0D7 /* Card.CreditCard.swift in Sources */, + 9AC2EF5D1F6818180037E0D7 /* Transaction.swift in Sources */, + 9AC2EF5E1F6818180037E0D7 /* CheckoutCreatePayload.swift in Sources */, + 9AC2EF5F1F6818180037E0D7 /* Graph.Cache.swift in Sources */, + 9AC2EF601F6818180037E0D7 /* Node.swift in Sources */, + 9AC2EF611F6818180037E0D7 /* CheckoutShippingAddressUpdatePayload.swift in Sources */, + 9AC2EF621F6818180037E0D7 /* OrderLineItemEdge.swift in Sources */, + 9AC2EF631F6818180037E0D7 /* Card.swift in Sources */, + 9AC2EF641F6818180037E0D7 /* CheckoutLineItemUpdateInput.swift in Sources */, + 9AC2EF651F6818180037E0D7 /* CustomerAccessTokenCreatePayload.swift in Sources */, + 9AC2EF661F6818180037E0D7 /* BlogEdge.swift in Sources */, + 9AC2EF671F6818180037E0D7 /* Shop.swift in Sources */, + 9AC2EF681F6818180037E0D7 /* ProductImageSortKeys.swift in Sources */, + 9AC2EF691F6818180037E0D7 /* CollectionEdge.swift in Sources */, + 9AC2EF6A1F6818180037E0D7 /* SelectedOptionInput.swift in Sources */, + 9AC2EF6B1F6818180037E0D7 /* Mutation.swift in Sources */, + 9AC2EF6C1F6818180037E0D7 /* Header.swift in Sources */, + 9AC2EF6D1F6818180037E0D7 /* CommentAuthor.swift in Sources */, + 9AC2EF6E1F6818180037E0D7 /* ProductVariantConnection.swift in Sources */, + 9AC2EF6F1F6818180037E0D7 /* Comment.swift in Sources */, + 9AC2EF701F6818180037E0D7 /* CustomerResetInput.swift in Sources */, + 9AC2EF711F6818180037E0D7 /* CustomerAccessTokenDeletePayload.swift in Sources */, + 9AC2EF721F6818180037E0D7 /* CheckoutCompleteWithTokenizedPaymentPayload.swift in Sources */, + 9AC2EF731F6818180037E0D7 /* BlogConnection.swift in Sources */, + 9AC2EF741F6818180037E0D7 /* CreditCard.swift in Sources */, + 9AC2EF751F6818180037E0D7 /* GraphQL.swift in Sources */, + 9AC2EF761F6818180037E0D7 /* Image.swift in Sources */, + 9AC2EF771F6818180037E0D7 /* CustomerAddressCreatePayload.swift in Sources */, + 9AC2EF781F6818180037E0D7 /* PageInfo.swift in Sources */, + 9AC2EF791F6818180037E0D7 /* CustomerAccessTokenRenewPayload.swift in Sources */, + 9AC2EF7A1F6818180037E0D7 /* CustomerAddressDeletePayload.swift in Sources */, + 9AC2EF7B1F6818180037E0D7 /* Product.swift in Sources */, + 9AC2EF7C1F6818180037E0D7 /* CustomerAddressUpdatePayload.swift in Sources */, + 9AC2EF7D1F6818180037E0D7 /* Payment.swift in Sources */, + 9AC2EF7E1F6818180037E0D7 /* ProductCollectionSortKeys.swift in Sources */, + 9AC2EF7F1F6818180037E0D7 /* CheckoutLineItemsUpdatePayload.swift in Sources */, + 9AC2EF801F6818180037E0D7 /* Global.swift in Sources */, + 9AC2EF811F6818180037E0D7 /* ImageConnection.swift in Sources */, + 9AC2EF821F6818180037E0D7 /* Graph.CachePolicy.swift in Sources */, + 9AC2EF831F6818180037E0D7 /* ProductVariant.swift in Sources */, + 9AC2EF841F6818180037E0D7 /* TransactionStatus.swift in Sources */, + 9AC2EF851F6818180037E0D7 /* CollectionSortKeys.swift in Sources */, + 9AC2EF861F6818180037E0D7 /* CustomerCreatePayload.swift in Sources */, + 9AC2EF871F6818180037E0D7 /* Article.swift in Sources */, + 9AC2EF881F6818180037E0D7 /* MailingAddress.swift in Sources */, + 9AC2EF891F6818180037E0D7 /* ArticleConnection.swift in Sources */, + 9AC2EF8A1F6818180037E0D7 /* CropRegion.swift in Sources */, + 9AC2EF8B1F6818180037E0D7 /* CheckoutLineItemsRemovePayload.swift in Sources */, + 9AC2EF8C1F6818180037E0D7 /* StringConnection.swift in Sources */, + 9AC2EF8D1F6818180037E0D7 /* Graph.CacheItem.swift in Sources */, + 9AC2EF8E1F6818180037E0D7 /* BlogSortKeys.swift in Sources */, + 9AC2EF8F1F6818180037E0D7 /* Checkout.swift in Sources */, + 9AC2EF901F6818180037E0D7 /* CheckoutLineItemConnection.swift in Sources */, + 9AF256451F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */, + 9AC2EF911F6818180037E0D7 /* MailingAddressEdge.swift in Sources */, + 9AC2EF921F6818180037E0D7 /* CommentConnection.swift in Sources */, + 9AC2EF931F6818180037E0D7 /* TransactionKind.swift in Sources */, + 9AC2EF941F6818180037E0D7 /* CustomerCreateInput.swift in Sources */, + 9AC2EF951F6818180037E0D7 /* ArticleEdge.swift in Sources */, + 9AC2EF961F6818180037E0D7 /* UserError.swift in Sources */, + 9AC2EF971F6818180037E0D7 /* CustomerActivateInput.swift in Sources */, + 9AC2EF981F6818180037E0D7 /* CustomerActivatePayload.swift in Sources */, + 9AC2EF991F6818180037E0D7 /* AttributeInput.swift in Sources */, + 9AC2EF9A1F6818180037E0D7 /* Storefront.swift in Sources */, + 9AC2EF9B1F6818180037E0D7 /* CountryCode.swift in Sources */, + 9AC2EF9C1F6818180037E0D7 /* MailingAddressConnection.swift in Sources */, + 9AC2EF9D1F6818180037E0D7 /* ImageEdge.swift in Sources */, + 9AC2EF9E1F6818180037E0D7 /* ArticleAuthor.swift in Sources */, + 9AC2EF9F1F6818180037E0D7 /* SelectedOption.swift in Sources */, + 9AC2EFA01F6818180037E0D7 /* OrderLineItemConnection.swift in Sources */, + 9AC2EFA11F6818180037E0D7 /* CheckoutAttributesUpdateInput.swift in Sources */, + 9AC2EFA21F6818180037E0D7 /* CheckoutLineItemsAddPayload.swift in Sources */, + 9AC2EFA31F6818180037E0D7 /* CreditCardPaymentInput.swift in Sources */, + 9AC2EFA41F6818180037E0D7 /* StringEdge.swift in Sources */, + 9AC2EFA51F6818180037E0D7 /* Graph.Client.swift in Sources */, + 9AC2EFA61F6818180037E0D7 /* Graph.swift in Sources */, + 9AC2EFA71F6818180037E0D7 /* ProductSortKeys.swift in Sources */, + 9AC2EFA81F6818180037E0D7 /* Graph.QueryError.swift in Sources */, + 9AC2EFA91F6818180037E0D7 /* OrderEdge.swift in Sources */, + 9AC2EFAA1F6818180037E0D7 /* CheckoutEmailUpdatePayload.swift in Sources */, + 9AC2EFAB1F6818180037E0D7 /* Card.Client.swift in Sources */, + 9AC2EFAC1F6818180037E0D7 /* Collection.swift in Sources */, + 9AC2EFAD1F6818180037E0D7 /* CustomerResetPayload.swift in Sources */, + 9AC2EFAE1F6818180037E0D7 /* ArticleSortKeys.swift in Sources */, + 9AC2EFAF1F6818180037E0D7 /* CardBrand.swift in Sources */, + 9AC2EFB01F6818180037E0D7 /* CheckoutCreateInput.swift in Sources */, + 9AC2EFB11F6818180037E0D7 /* OrderSortKeys.swift in Sources */, + 9AC2EFB21F6818180037E0D7 /* CheckoutCompleteWithCreditCardPayload.swift in Sources */, + 9AC2EFB31F6818180037E0D7 /* CheckoutLineItemEdge.swift in Sources */, + 9AC2EFB41F6818180037E0D7 /* ProductConnection.swift in Sources */, + 9AC2EFB51F6818180037E0D7 /* CustomerAccessToken.swift in Sources */, + 9AC2EFB61F6818180037E0D7 /* Order.swift in Sources */, + 9AC2EFB71F6818180037E0D7 /* CheckoutLineItemInput.swift in Sources */, + 9AC2EFB81F6818180037E0D7 /* TokenizedPaymentInput.swift in Sources */, + 9AC2EFB91F6818180037E0D7 /* CheckoutLineItem.swift in Sources */, + 9AC2EFBA1F6818180037E0D7 /* OrderDisplayFinancialStatus.swift in Sources */, + 9AC2EFBB1F6818180037E0D7 /* ProductVariantEdge.swift in Sources */, + 9AC2EFBC1F6818180037E0D7 /* AppliedGiftCard.swift in Sources */, + 9AC2EFBD1F6818180037E0D7 /* CheckoutCustomerDisassociatePayload.swift in Sources */, + 9AC2EFBE1F6818180037E0D7 /* CommentEdge.swift in Sources */, + 9AC2EFBF1F6818180037E0D7 /* GraphQL+ScalarSupport.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AEF60EE1E5F42D90067FA90 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1133,6 +1654,7 @@ 9AA416D31EE095B20060029B /* BlogSortKeys.swift in Sources */, 9A0C805C1EAA51C50020F187 /* Checkout.swift in Sources */, 9A0C806A1EAA51C50020F187 /* CheckoutLineItemConnection.swift in Sources */, + 9AC2EFD71F686DB90037E0D7 /* Optional+Input.swift in Sources */, 9A0C80931EAA51C50020F187 /* MailingAddressEdge.swift in Sources */, 9AA416DA1EE095BB0060029B /* CommentConnection.swift in Sources */, 9A0C80B21EAA51C50020F187 /* TransactionKind.swift in Sources */, @@ -1183,6 +1705,149 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9AF255B21F6FEE50005BB0C9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9AF255B31F6FEE50005BB0C9 /* Attribute.swift in Sources */, + 9AF255B41F6FEE50005BB0C9 /* OrderLineItem.swift in Sources */, + 9AF255B51F6FEE50005BB0C9 /* Log.swift in Sources */, + 9AF255B61F6FEE50005BB0C9 /* OrderCancelReason.swift in Sources */, + 9AF255B71F6FEE50005BB0C9 /* ProductVariantSortKeys.swift in Sources */, + 9AF255B81F6FEE50005BB0C9 /* ProductOption.swift in Sources */, + 9AF255B91F6FEE50005BB0C9 /* QueryRoot.swift in Sources */, + 9AF255BA1F6FEE50005BB0C9 /* ShippingRate.swift in Sources */, + 9AF255BB1F6FEE50005BB0C9 /* CheckoutCustomerAssociatePayload.swift in Sources */, + 9AF255BC1F6FEE50005BB0C9 /* Blog.swift in Sources */, + 9AF255BD1F6FEE50005BB0C9 /* AvailableShippingRates.swift in Sources */, + 9AF255BE1F6FEE50005BB0C9 /* CollectionConnection.swift in Sources */, + 9AF255BF1F6FEE50005BB0C9 /* CheckoutGiftCardApplyPayload.swift in Sources */, + 9AF255C01F6FEE50005BB0C9 /* OrderDisplayFulfillmentStatus.swift in Sources */, + 9AF255C11F6FEE50005BB0C9 /* ProductEdge.swift in Sources */, + 9AF255C21F6FEE50005BB0C9 /* CheckoutAttributesUpdatePayload.swift in Sources */, + 9AF255C31F6FEE50005BB0C9 /* WeightUnit.swift in Sources */, + 9AF255C41F6FEE50005BB0C9 /* CustomerUpdatePayload.swift in Sources */, + 9AF255C51F6FEE50005BB0C9 /* Graph.Task.swift in Sources */, + 9AF255C61F6FEE50005BB0C9 /* Customer.swift in Sources */, + 9AF255C71F6FEE50005BB0C9 /* CustomerAccessTokenCreateInput.swift in Sources */, + 9AF255C81F6FEE50005BB0C9 /* CustomerUpdateInput.swift in Sources */, + 9AF255C91F6FEE50005BB0C9 /* OrderConnection.swift in Sources */, + 9AF255CA1F6FEE50005BB0C9 /* MD5.m in Sources */, + 9AF255CB1F6FEE50005BB0C9 /* Graph.RetryHandler.swift in Sources */, + 9AF255CC1F6FEE50005BB0C9 /* CurrencyCode.swift in Sources */, + 9AF255CD1F6FEE50005BB0C9 /* ShopPolicy.swift in Sources */, + 9AF255CE1F6FEE50005BB0C9 /* CheckoutShippingLineUpdatePayload.swift in Sources */, + 9AF255CF1F6FEE50005BB0C9 /* CheckoutGiftCardRemovePayload.swift in Sources */, + 9AF255D01F6FEE50005BB0C9 /* CheckoutCompleteFreePayload.swift in Sources */, + 9AF255D11F6FEE50005BB0C9 /* DigitalWallet.swift in Sources */, + 9AF255D21F6FEE50005BB0C9 /* MailingAddressInput.swift in Sources */, + 9AF255D31F6FEE50005BB0C9 /* CustomerRecoverPayload.swift in Sources */, + 9AF255D41F6FEE50005BB0C9 /* PaymentSettings.swift in Sources */, + 9AF255D51F6FEE50005BB0C9 /* Domain.swift in Sources */, + 9AF255D61F6FEE50005BB0C9 /* Card.CreditCard.swift in Sources */, + 9AF255D71F6FEE50005BB0C9 /* Transaction.swift in Sources */, + 9AF255D81F6FEE50005BB0C9 /* CheckoutCreatePayload.swift in Sources */, + 9AF255D91F6FEE50005BB0C9 /* Graph.Cache.swift in Sources */, + 9AF255DA1F6FEE50005BB0C9 /* Node.swift in Sources */, + 9AF255DB1F6FEE50005BB0C9 /* CheckoutShippingAddressUpdatePayload.swift in Sources */, + 9AF255DC1F6FEE50005BB0C9 /* OrderLineItemEdge.swift in Sources */, + 9AF255DD1F6FEE50005BB0C9 /* Card.swift in Sources */, + 9AF255DE1F6FEE50005BB0C9 /* CheckoutLineItemUpdateInput.swift in Sources */, + 9AF255DF1F6FEE50005BB0C9 /* CustomerAccessTokenCreatePayload.swift in Sources */, + 9AF255E01F6FEE50005BB0C9 /* BlogEdge.swift in Sources */, + 9AF255E11F6FEE50005BB0C9 /* Shop.swift in Sources */, + 9AF255E21F6FEE50005BB0C9 /* ProductImageSortKeys.swift in Sources */, + 9AF255E31F6FEE50005BB0C9 /* CollectionEdge.swift in Sources */, + 9AF255E41F6FEE50005BB0C9 /* SelectedOptionInput.swift in Sources */, + 9AF255E51F6FEE50005BB0C9 /* Mutation.swift in Sources */, + 9AF255E61F6FEE50005BB0C9 /* Header.swift in Sources */, + 9AF255E71F6FEE50005BB0C9 /* CommentAuthor.swift in Sources */, + 9AF255E81F6FEE50005BB0C9 /* ProductVariantConnection.swift in Sources */, + 9AF255E91F6FEE50005BB0C9 /* Comment.swift in Sources */, + 9AF255EA1F6FEE50005BB0C9 /* CustomerResetInput.swift in Sources */, + 9AF255EB1F6FEE50005BB0C9 /* CustomerAccessTokenDeletePayload.swift in Sources */, + 9AF255EC1F6FEE50005BB0C9 /* CheckoutCompleteWithTokenizedPaymentPayload.swift in Sources */, + 9AF255ED1F6FEE50005BB0C9 /* BlogConnection.swift in Sources */, + 9AF255EE1F6FEE50005BB0C9 /* CreditCard.swift in Sources */, + 9AF255EF1F6FEE50005BB0C9 /* GraphQL.swift in Sources */, + 9AF255F01F6FEE50005BB0C9 /* Image.swift in Sources */, + 9AF255F11F6FEE50005BB0C9 /* CustomerAddressCreatePayload.swift in Sources */, + 9AF255F21F6FEE50005BB0C9 /* PageInfo.swift in Sources */, + 9AF255F31F6FEE50005BB0C9 /* CustomerAccessTokenRenewPayload.swift in Sources */, + 9AF255F41F6FEE50005BB0C9 /* CustomerAddressDeletePayload.swift in Sources */, + 9AF255F51F6FEE50005BB0C9 /* Product.swift in Sources */, + 9AF255F61F6FEE50005BB0C9 /* CustomerAddressUpdatePayload.swift in Sources */, + 9AF255F71F6FEE50005BB0C9 /* Payment.swift in Sources */, + 9AF255F81F6FEE50005BB0C9 /* ProductCollectionSortKeys.swift in Sources */, + 9AF255F91F6FEE50005BB0C9 /* CheckoutLineItemsUpdatePayload.swift in Sources */, + 9AF255FA1F6FEE50005BB0C9 /* Global.swift in Sources */, + 9AF255FB1F6FEE50005BB0C9 /* ImageConnection.swift in Sources */, + 9AF255FC1F6FEE50005BB0C9 /* Graph.CachePolicy.swift in Sources */, + 9AF255FD1F6FEE50005BB0C9 /* ProductVariant.swift in Sources */, + 9AF255FE1F6FEE50005BB0C9 /* TransactionStatus.swift in Sources */, + 9AF255FF1F6FEE50005BB0C9 /* CollectionSortKeys.swift in Sources */, + 9AF256001F6FEE50005BB0C9 /* CustomerCreatePayload.swift in Sources */, + 9AF256011F6FEE50005BB0C9 /* Article.swift in Sources */, + 9AF256021F6FEE50005BB0C9 /* MailingAddress.swift in Sources */, + 9AF256031F6FEE50005BB0C9 /* ArticleConnection.swift in Sources */, + 9AF256041F6FEE50005BB0C9 /* CropRegion.swift in Sources */, + 9AF256051F6FEE50005BB0C9 /* CheckoutLineItemsRemovePayload.swift in Sources */, + 9AF256061F6FEE50005BB0C9 /* StringConnection.swift in Sources */, + 9AF256071F6FEE50005BB0C9 /* Graph.CacheItem.swift in Sources */, + 9AF256081F6FEE50005BB0C9 /* BlogSortKeys.swift in Sources */, + 9AF256091F6FEE50005BB0C9 /* Checkout.swift in Sources */, + 9AF2560A1F6FEE50005BB0C9 /* CheckoutLineItemConnection.swift in Sources */, + 9AF256441F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */, + 9AF2560B1F6FEE50005BB0C9 /* MailingAddressEdge.swift in Sources */, + 9AF2560C1F6FEE50005BB0C9 /* CommentConnection.swift in Sources */, + 9AF2560D1F6FEE50005BB0C9 /* TransactionKind.swift in Sources */, + 9AF2560E1F6FEE50005BB0C9 /* CustomerCreateInput.swift in Sources */, + 9AF2560F1F6FEE50005BB0C9 /* ArticleEdge.swift in Sources */, + 9AF256101F6FEE50005BB0C9 /* UserError.swift in Sources */, + 9AF256111F6FEE50005BB0C9 /* CustomerActivateInput.swift in Sources */, + 9AF256121F6FEE50005BB0C9 /* CustomerActivatePayload.swift in Sources */, + 9AF256131F6FEE50005BB0C9 /* AttributeInput.swift in Sources */, + 9AF256141F6FEE50005BB0C9 /* Storefront.swift in Sources */, + 9AF256151F6FEE50005BB0C9 /* CountryCode.swift in Sources */, + 9AF256161F6FEE50005BB0C9 /* MailingAddressConnection.swift in Sources */, + 9AF256171F6FEE50005BB0C9 /* ImageEdge.swift in Sources */, + 9AF256181F6FEE50005BB0C9 /* ArticleAuthor.swift in Sources */, + 9AF256191F6FEE50005BB0C9 /* SelectedOption.swift in Sources */, + 9AF2561A1F6FEE50005BB0C9 /* OrderLineItemConnection.swift in Sources */, + 9AF2561B1F6FEE50005BB0C9 /* CheckoutAttributesUpdateInput.swift in Sources */, + 9AF2561C1F6FEE50005BB0C9 /* CheckoutLineItemsAddPayload.swift in Sources */, + 9AF2561D1F6FEE50005BB0C9 /* CreditCardPaymentInput.swift in Sources */, + 9AF2561E1F6FEE50005BB0C9 /* StringEdge.swift in Sources */, + 9AF2561F1F6FEE50005BB0C9 /* Graph.Client.swift in Sources */, + 9AF256201F6FEE50005BB0C9 /* Graph.swift in Sources */, + 9AF256211F6FEE50005BB0C9 /* ProductSortKeys.swift in Sources */, + 9AF256221F6FEE50005BB0C9 /* Graph.QueryError.swift in Sources */, + 9AF256231F6FEE50005BB0C9 /* OrderEdge.swift in Sources */, + 9AF256241F6FEE50005BB0C9 /* CheckoutEmailUpdatePayload.swift in Sources */, + 9AF256251F6FEE50005BB0C9 /* Card.Client.swift in Sources */, + 9AF256261F6FEE50005BB0C9 /* Collection.swift in Sources */, + 9AF256271F6FEE50005BB0C9 /* CustomerResetPayload.swift in Sources */, + 9AF256281F6FEE50005BB0C9 /* ArticleSortKeys.swift in Sources */, + 9AF256291F6FEE50005BB0C9 /* CardBrand.swift in Sources */, + 9AF2562A1F6FEE50005BB0C9 /* CheckoutCreateInput.swift in Sources */, + 9AF2562B1F6FEE50005BB0C9 /* OrderSortKeys.swift in Sources */, + 9AF2562C1F6FEE50005BB0C9 /* CheckoutCompleteWithCreditCardPayload.swift in Sources */, + 9AF2562D1F6FEE50005BB0C9 /* CheckoutLineItemEdge.swift in Sources */, + 9AF2562E1F6FEE50005BB0C9 /* ProductConnection.swift in Sources */, + 9AF2562F1F6FEE50005BB0C9 /* CustomerAccessToken.swift in Sources */, + 9AF256301F6FEE50005BB0C9 /* Order.swift in Sources */, + 9AF256311F6FEE50005BB0C9 /* CheckoutLineItemInput.swift in Sources */, + 9AF256321F6FEE50005BB0C9 /* TokenizedPaymentInput.swift in Sources */, + 9AF256331F6FEE50005BB0C9 /* CheckoutLineItem.swift in Sources */, + 9AF256341F6FEE50005BB0C9 /* OrderDisplayFinancialStatus.swift in Sources */, + 9AF256351F6FEE50005BB0C9 /* ProductVariantEdge.swift in Sources */, + 9AF256361F6FEE50005BB0C9 /* AppliedGiftCard.swift in Sources */, + 9AF256371F6FEE50005BB0C9 /* CheckoutCustomerDisassociatePayload.swift in Sources */, + 9AF256381F6FEE50005BB0C9 /* CommentEdge.swift in Sources */, + 9AF256391F6FEE50005BB0C9 /* GraphQL+ScalarSupport.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9AFA38E61E64850A0056C5AA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1241,22 +1906,22 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 3.0.8; + CURRENT_PROJECT_VERSION = 3.1.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 3.0.8; + DYLIB_CURRENT_VERSION = 3.1.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Pay/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-function-bodies=100"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Pay; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1266,11 +1931,11 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 3.0.8; + CURRENT_PROJECT_VERSION = 3.1.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 3.0.8; + DYLIB_CURRENT_VERSION = 3.1.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Pay/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1279,7 +1944,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Pay; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1294,7 +1959,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.PayTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1309,7 +1974,60 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.PayTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 9AC2EFC61F6818180037E0D7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3.1.0; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 3.1.0; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Buy/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_SWIFT_FLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; + PRODUCT_NAME = Buy; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 9AC2EFC71F6818180037E0D7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3.1.0; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 3.1.0; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Buy/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; + PRODUCT_NAME = Buy; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1322,7 +2040,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -1330,7 +2050,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1375,7 +2099,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -1383,7 +2109,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1416,21 +2146,21 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 3.0.8; + CURRENT_PROJECT_VERSION = 3.1.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 3.0.8; + DYLIB_CURRENT_VERSION = 3.1.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Buy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-function-bodies=100"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1438,11 +2168,11 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 3.0.8; + CURRENT_PROJECT_VERSION = 3.1.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 3.0.8; + DYLIB_CURRENT_VERSION = 3.1.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Buy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -1451,7 +2181,64 @@ PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 9AF256401F6FEE50005BB0C9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3.1.0; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 3.1.0; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Buy/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_SWIFT_FLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; + PRODUCT_MODULE_NAME = Buy; + PRODUCT_NAME = Buy; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + 9AF256411F6FEE50005BB0C9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 3.1.0; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 3.1.0; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Buy/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Buy; + PRODUCT_MODULE_NAME = Buy; + PRODUCT_NAME = Buy; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; + TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; @@ -1466,7 +2253,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.shopify.BuyTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1481,7 +2268,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.shopify.BuyTests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1515,6 +2302,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9AC2EFC51F6818180037E0D7 /* Build configuration list for PBXNativeTarget "Buy watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9AC2EFC61F6818180037E0D7 /* Debug */, + 9AC2EFC71F6818180037E0D7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 9AEF60ED1E5F42D90067FA90 /* Build configuration list for PBXProject "Buy" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1533,6 +2329,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9AF2563F1F6FEE50005BB0C9 /* Build configuration list for PBXNativeTarget "Buy tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9AF256401F6FEE50005BB0C9 /* Debug */, + 9AF256411F6FEE50005BB0C9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 9AFA38F41E64850A0056C5AA /* Build configuration list for PBXNativeTarget "BuyTests" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Buy tvOS.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Buy tvOS.xcscheme new file mode 100644 index 00000000..7ac5f27e --- /dev/null +++ b/Buy.xcodeproj/xcshareddata/xcschemes/Buy tvOS.xcscheme @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Buy watchOS.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Buy watchOS.xcscheme new file mode 100644 index 00000000..44fe187e --- /dev/null +++ b/Buy.xcodeproj/xcshareddata/xcschemes/Buy watchOS.xcscheme @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Buy.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Buy.xcscheme index 89819e21..6338877b 100644 --- a/Buy.xcodeproj/xcshareddata/xcschemes/Buy.xcscheme +++ b/Buy.xcodeproj/xcshareddata/xcschemes/Buy.xcscheme @@ -1,6 +1,6 @@ @@ -56,6 +57,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/BuyTests.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/BuyTests.xcscheme index db838dbb..8384e3bc 100644 --- a/Buy.xcodeproj/xcshareddata/xcschemes/BuyTests.xcscheme +++ b/Buy.xcodeproj/xcshareddata/xcschemes/BuyTests.xcscheme @@ -1,6 +1,6 @@ @@ -47,6 +48,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme index e5487288..a3a44b16 100644 --- a/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme +++ b/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme index e596cc21..3aedfad2 100644 --- a/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme +++ b/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme @@ -1,6 +1,6 @@ @@ -56,6 +57,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme index 6ec14a3f..ba0a18a0 100644 --- a/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme +++ b/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme @@ -1,6 +1,6 @@ @@ -47,6 +48,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Buy/Client/Graph.Cache.swift b/Buy/Client/Graph.Cache.swift index 2bfe5320..8255601e 100644 --- a/Buy/Client/Graph.Cache.swift +++ b/Buy/Client/Graph.Cache.swift @@ -32,7 +32,7 @@ internal extension Graph { internal class Cache { - static let cacheName = "com.buy.graph.cache" + static let cacheName = "com.buy.graph.cache-\(Global.frameworkVersion)" private static let fileManager = FileManager.default diff --git a/Buy/Custom/Optional+Input.swift b/Buy/Custom/Optional+Input.swift new file mode 100644 index 00000000..6a6dc4bc --- /dev/null +++ b/Buy/Custom/Optional+Input.swift @@ -0,0 +1,40 @@ +// +// Optional+Input.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 Shopify Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +public extension Optional { + + /// Transforms an Optional into Input.value(T), or Input.value(nil) if optional is nil. + public var orNull: Input { + return Input(orNull: self) + } + + /// Transforms an Optional into Input.value(T), or Input.undefined if optional is nil. + public var orUndefined: Input { + return Input(orUndefined: self) + } +} diff --git a/Buy/Generated/Storefront/AppliedGiftCard.swift b/Buy/Generated/Storefront/AppliedGiftCard.swift index 74087aa9..2c91cd78 100644 --- a/Buy/Generated/Storefront/AppliedGiftCard.swift +++ b/Buy/Generated/Storefront/AppliedGiftCard.swift @@ -69,30 +69,30 @@ extension Storefront { switch fieldName { case "amountUsed": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "balance": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "lastCharacters": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Article.swift b/Buy/Generated/Storefront/Article.swift index 7b8140ad..7fb61d6f 100644 --- a/Buy/Generated/Storefront/Article.swift +++ b/Buy/Generated/Storefront/Article.swift @@ -55,18 +55,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func comments(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (CommentConnectionQuery) -> Void) -> ArticleQuery { + open func comments(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (CommentConnectionQuery) -> Void) -> ArticleQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -213,87 +225,87 @@ extension Storefront { switch fieldName { case "author": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return try ArticleAuthor(fields: value) case "blog": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return try Blog(fields: value) case "comments": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return try CommentConnection(fields: value) case "content": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value case "contentHtml": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value case "excerpt": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value case "excerptHtml": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "image": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return try Image(fields: value) case "publishedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "tags": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value.map { return $0 } case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return value case "url": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Article.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ArticleAuthor.swift b/Buy/Generated/Storefront/ArticleAuthor.swift index 9e232114..046f0567 100644 --- a/Buy/Generated/Storefront/ArticleAuthor.swift +++ b/Buy/Generated/Storefront/ArticleAuthor.swift @@ -75,36 +75,36 @@ extension Storefront { case "bio": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } return value case "email": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } return value case "firstName": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } return value case "lastName": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } return value case "name": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleAuthor.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ArticleConnection.swift b/Buy/Generated/Storefront/ArticleConnection.swift index bba6fd03..1b64daf1 100644 --- a/Buy/Generated/Storefront/ArticleConnection.swift +++ b/Buy/Generated/Storefront/ArticleConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try ArticleEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ArticleEdge.swift b/Buy/Generated/Storefront/ArticleEdge.swift index 82294122..e505868d 100644 --- a/Buy/Generated/Storefront/ArticleEdge.swift +++ b/Buy/Generated/Storefront/ArticleEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleEdge.self, field: fieldName, value: fieldValue) } return try Article(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ArticleEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Attribute.swift b/Buy/Generated/Storefront/Attribute.swift index 02e40ad1..e3c2e08f 100644 --- a/Buy/Generated/Storefront/Attribute.swift +++ b/Buy/Generated/Storefront/Attribute.swift @@ -55,19 +55,19 @@ extension Storefront { switch fieldName { case "key": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Attribute.self, field: fieldName, value: fieldValue) } return value case "value": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Attribute.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Attribute.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/AttributeInput.swift b/Buy/Generated/Storefront/AttributeInput.swift index be99eab4..533cd8b0 100644 --- a/Buy/Generated/Storefront/AttributeInput.swift +++ b/Buy/Generated/Storefront/AttributeInput.swift @@ -33,6 +33,16 @@ extension Storefront { open var value: String + /// Creates the input object. + /// + /// - parameters: + /// - key: No description + /// - value: No description + /// + public static func create(key: String, value: String) -> AttributeInput { + return AttributeInput(key: key, value: value) + } + /// Creates the input object. /// /// - parameters: diff --git a/Buy/Generated/Storefront/AvailableShippingRates.swift b/Buy/Generated/Storefront/AvailableShippingRates.swift index 416d056e..086c5a5b 100644 --- a/Buy/Generated/Storefront/AvailableShippingRates.swift +++ b/Buy/Generated/Storefront/AvailableShippingRates.swift @@ -60,19 +60,19 @@ extension Storefront { switch fieldName { case "ready": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) } return value case "shippingRates": if value is NSNull { return nil } guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) } return try value.map { return try ShippingRate(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Blog.swift b/Buy/Generated/Storefront/Blog.swift index 2125c9b9..88aa7ae7 100644 --- a/Buy/Generated/Storefront/Blog.swift +++ b/Buy/Generated/Storefront/Blog.swift @@ -35,18 +35,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func articles(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (ArticleConnectionQuery) -> Void) -> BlogQuery { + open func articles(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (ArticleConnectionQuery) -> Void) -> BlogQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -90,30 +102,30 @@ extension Storefront { switch fieldName { case "articles": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Blog.self, field: fieldName, value: fieldValue) } return try ArticleConnection(fields: value) case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Blog.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Blog.self, field: fieldName, value: fieldValue) } return value case "url": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Blog.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Blog.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/BlogConnection.swift b/Buy/Generated/Storefront/BlogConnection.swift index a06dbc8d..bb74819d 100644 --- a/Buy/Generated/Storefront/BlogConnection.swift +++ b/Buy/Generated/Storefront/BlogConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try BlogEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/BlogEdge.swift b/Buy/Generated/Storefront/BlogEdge.swift index 8f37417b..4a2aaeef 100644 --- a/Buy/Generated/Storefront/BlogEdge.swift +++ b/Buy/Generated/Storefront/BlogEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogEdge.self, field: fieldName, value: fieldValue) } return try Blog(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: BlogEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Checkout.swift b/Buy/Generated/Storefront/Checkout.swift index 39fc9f90..d7f3932c 100644 --- a/Buy/Generated/Storefront/Checkout.swift +++ b/Buy/Generated/Storefront/Checkout.swift @@ -112,18 +112,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func lineItems(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (CheckoutLineItemConnectionQuery) -> Void) -> CheckoutQuery { + open func lineItems(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (CheckoutLineItemConnectionQuery) -> Void) -> CheckoutQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -268,165 +280,165 @@ extension Storefront { switch fieldName { case "appliedGiftCards": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try value.map { return try AppliedGiftCard(fields: $0) } case "availableShippingRates": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try AvailableShippingRates(fields: value) case "completedAt": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "createdAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "currencyCode": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return CurrencyCode(rawValue: value) ?? .unknownValue case "customAttributes": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try value.map { return try Attribute(fields: $0) } case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "email": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "lineItems": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try CheckoutLineItemConnection(fields: value) case "note": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "order": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try Order(fields: value) case "orderStatusUrl": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return URL(string: value)! case "paymentDue": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "ready": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "requiresShipping": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "shippingAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "shippingLine": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return try ShippingRate(fields: value) case "subtotalPrice": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "taxExempt": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "taxesIncluded": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return value case "totalPrice": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "totalTax": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "updatedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "webUrl": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutAttributesUpdateInput.swift b/Buy/Generated/Storefront/CheckoutAttributesUpdateInput.swift index d8a64107..2ca6ea1a 100644 --- a/Buy/Generated/Storefront/CheckoutAttributesUpdateInput.swift +++ b/Buy/Generated/Storefront/CheckoutAttributesUpdateInput.swift @@ -30,15 +30,15 @@ extension Storefront { /// Specifies the fields required to update a checkout's attributes. open class CheckoutAttributesUpdateInput { /// The text of an optional note that a shop owner can attach to the checkout. - open var note: String? + open var note: Input /// A list of extra information that is added to the checkout. - open var customAttributes: [AttributeInput]? + open var customAttributes: Input<[AttributeInput]> /// Allows setting partial addresses on a Checkout, skipping the full /// validation of attributes. The required attributes are city, province, and /// country. Full validation of the addresses is still done at complete time. - open var allowPartialAddresses: Bool? + open var allowPartialAddresses: Input /// Creates the input object. /// @@ -47,25 +47,59 @@ extension Storefront { /// - customAttributes: A list of extra information that is added to the checkout. /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of the addresses is still done at complete time. /// - public init(note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil) { + public static func create(note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) -> CheckoutAttributesUpdateInput { + return CheckoutAttributesUpdateInput(note: note, customAttributes: customAttributes, allowPartialAddresses: allowPartialAddresses) + } + + private init(note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) { self.note = note self.customAttributes = customAttributes self.allowPartialAddresses = allowPartialAddresses } + /// Creates the input object. + /// + /// - parameters: + /// - note: The text of an optional note that a shop owner can attach to the checkout. + /// - customAttributes: A list of extra information that is added to the checkout. + /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of the addresses is still done at complete time. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil) { + self.init(note: note.orNull, customAttributes: customAttributes.orNull, allowPartialAddresses: allowPartialAddresses.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let note = note { + switch note { + case .value(let note): + guard let note = note else { + fields.append("note:null") + break + } fields.append("note:\(GraphQL.quoteString(input: note))") + case .undefined: break } - if let customAttributes = customAttributes { + switch customAttributes { + case .value(let customAttributes): + guard let customAttributes = customAttributes else { + fields.append("customAttributes:null") + break + } fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break } - if let allowPartialAddresses = allowPartialAddresses { + switch allowPartialAddresses { + case .value(let allowPartialAddresses): + guard let allowPartialAddresses = allowPartialAddresses else { + fields.append("allowPartialAddresses:null") + break + } fields.append("allowPartialAddresses:\(allowPartialAddresses)") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/CheckoutAttributesUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutAttributesUpdatePayload.swift index ffe4e9f3..17bbc117 100644 --- a/Buy/Generated/Storefront/CheckoutAttributesUpdatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutAttributesUpdatePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutAttributesUpdatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutAttributesUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutAttributesUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift b/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift index c92825c8..6f2351cb 100644 --- a/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift +++ b/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardPayload.swift b/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardPayload.swift index a7cd273c..7b514a21 100644 --- a/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardPayload.swift +++ b/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardPayload.swift @@ -69,25 +69,25 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithCreditCardPayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "payment": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithCreditCardPayload.self, field: fieldName, value: fieldValue) } return try Payment(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithCreditCardPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithCreditCardPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentPayload.swift b/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentPayload.swift index 3c313295..2d855de5 100644 --- a/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentPayload.swift +++ b/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentPayload.swift @@ -69,25 +69,25 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentPayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "payment": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentPayload.self, field: fieldName, value: fieldValue) } return try Payment(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCreateInput.swift b/Buy/Generated/Storefront/CheckoutCreateInput.swift index db8a4e12..9f31d34e 100644 --- a/Buy/Generated/Storefront/CheckoutCreateInput.swift +++ b/Buy/Generated/Storefront/CheckoutCreateInput.swift @@ -30,25 +30,25 @@ extension Storefront { /// Specifies the fields required to create a checkout. open class CheckoutCreateInput { /// The email with which the customer wants to checkout. - open var email: String? + open var email: Input /// A list of line item objects, each one containing information about an item /// in the checkout. - open var lineItems: [CheckoutLineItemInput]? + open var lineItems: Input<[CheckoutLineItemInput]> /// The shipping address to where the line items will be shipped. - open var shippingAddress: MailingAddressInput? + open var shippingAddress: Input /// The text of an optional note that a shop owner can attach to the checkout. - open var note: String? + open var note: Input /// A list of extra information that is added to the checkout. - open var customAttributes: [AttributeInput]? + open var customAttributes: Input<[AttributeInput]> /// Allows setting partial addresses on a Checkout, skipping the full /// validation of attributes. The required attributes are city, province, and /// country. Full validation of addresses is still done at complete time. - open var allowPartialAddresses: Bool? + open var allowPartialAddresses: Input /// Creates the input object. /// @@ -60,7 +60,11 @@ extension Storefront { /// - customAttributes: A list of extra information that is added to the checkout. /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of addresses is still done at complete time. /// - public init(email: String? = nil, lineItems: [CheckoutLineItemInput]? = nil, shippingAddress: MailingAddressInput? = nil, note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil) { + public static func create(email: Input = .undefined, lineItems: Input<[CheckoutLineItemInput]> = .undefined, shippingAddress: Input = .undefined, note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) -> CheckoutCreateInput { + return CheckoutCreateInput(email: email, lineItems: lineItems, shippingAddress: shippingAddress, note: note, customAttributes: customAttributes, allowPartialAddresses: allowPartialAddresses) + } + + private init(email: Input = .undefined, lineItems: Input<[CheckoutLineItemInput]> = .undefined, shippingAddress: Input = .undefined, note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) { self.email = email self.lineItems = lineItems self.shippingAddress = shippingAddress @@ -69,31 +73,82 @@ extension Storefront { self.allowPartialAddresses = allowPartialAddresses } + /// Creates the input object. + /// + /// - parameters: + /// - email: The email with which the customer wants to checkout. + /// - lineItems: A list of line item objects, each one containing information about an item in the checkout. + /// - shippingAddress: The shipping address to where the line items will be shipped. + /// - note: The text of an optional note that a shop owner can attach to the checkout. + /// - customAttributes: A list of extra information that is added to the checkout. + /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of addresses is still done at complete time. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(email: String? = nil, lineItems: [CheckoutLineItemInput]? = nil, shippingAddress: MailingAddressInput? = nil, note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil) { + self.init(email: email.orNull, lineItems: lineItems.orNull, shippingAddress: shippingAddress.orNull, note: note.orNull, customAttributes: customAttributes.orNull, allowPartialAddresses: allowPartialAddresses.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let email = email { + switch email { + case .value(let email): + guard let email = email else { + fields.append("email:null") + break + } fields.append("email:\(GraphQL.quoteString(input: email))") + case .undefined: break } - if let lineItems = lineItems { + switch lineItems { + case .value(let lineItems): + guard let lineItems = lineItems else { + fields.append("lineItems:null") + break + } fields.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break } - if let shippingAddress = shippingAddress { + switch shippingAddress { + case .value(let shippingAddress): + guard let shippingAddress = shippingAddress else { + fields.append("shippingAddress:null") + break + } fields.append("shippingAddress:\(shippingAddress.serialize())") + case .undefined: break } - if let note = note { + switch note { + case .value(let note): + guard let note = note else { + fields.append("note:null") + break + } fields.append("note:\(GraphQL.quoteString(input: note))") + case .undefined: break } - if let customAttributes = customAttributes { + switch customAttributes { + case .value(let customAttributes): + guard let customAttributes = customAttributes else { + fields.append("customAttributes:null") + break + } fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break } - if let allowPartialAddresses = allowPartialAddresses { + switch allowPartialAddresses { + case .value(let allowPartialAddresses): + guard let allowPartialAddresses = allowPartialAddresses else { + fields.append("allowPartialAddresses:null") + break + } fields.append("allowPartialAddresses:\(allowPartialAddresses)") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/CheckoutCreatePayload.swift b/Buy/Generated/Storefront/CheckoutCreatePayload.swift index 0c810a11..b5681d27 100644 --- a/Buy/Generated/Storefront/CheckoutCreatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutCreatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCustomerAssociatePayload.swift b/Buy/Generated/Storefront/CheckoutCustomerAssociatePayload.swift index d85814d2..88cbcd4d 100644 --- a/Buy/Generated/Storefront/CheckoutCustomerAssociatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutCustomerAssociatePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerAssociatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerAssociatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerAssociatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutCustomerDisassociatePayload.swift b/Buy/Generated/Storefront/CheckoutCustomerDisassociatePayload.swift index 1b1f6a92..6a619c49 100644 --- a/Buy/Generated/Storefront/CheckoutCustomerDisassociatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutCustomerDisassociatePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerDisassociatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerDisassociatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutCustomerDisassociatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutEmailUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutEmailUpdatePayload.swift index b11f2bc0..606b2031 100644 --- a/Buy/Generated/Storefront/CheckoutEmailUpdatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutEmailUpdatePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutEmailUpdatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutEmailUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutEmailUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutGiftCardApplyPayload.swift b/Buy/Generated/Storefront/CheckoutGiftCardApplyPayload.swift index 82117724..93c92e4a 100644 --- a/Buy/Generated/Storefront/CheckoutGiftCardApplyPayload.swift +++ b/Buy/Generated/Storefront/CheckoutGiftCardApplyPayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardApplyPayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardApplyPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardApplyPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutGiftCardRemovePayload.swift b/Buy/Generated/Storefront/CheckoutGiftCardRemovePayload.swift index 04b0f4d8..9e2a0427 100644 --- a/Buy/Generated/Storefront/CheckoutGiftCardRemovePayload.swift +++ b/Buy/Generated/Storefront/CheckoutGiftCardRemovePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardRemovePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardRemovePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutGiftCardRemovePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItem.swift b/Buy/Generated/Storefront/CheckoutLineItem.swift index 99d01a98..27cd2abe 100644 --- a/Buy/Generated/Storefront/CheckoutLineItem.swift +++ b/Buy/Generated/Storefront/CheckoutLineItem.swift @@ -83,37 +83,37 @@ extension Storefront { switch fieldName { case "customAttributes": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } return try value.map { return try Attribute(fields: $0) } case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "quantity": guard let value = value as? Int else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } return Int32(value) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } return value case "variant": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } return try ProductVariant(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItemConnection.swift b/Buy/Generated/Storefront/CheckoutLineItemConnection.swift index 0dd11f0b..3301d39b 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemConnection.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try CheckoutLineItemEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItemEdge.swift b/Buy/Generated/Storefront/CheckoutLineItemEdge.swift index 9f012721..0761bdbc 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemEdge.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) } return try CheckoutLineItem(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItemInput.swift b/Buy/Generated/Storefront/CheckoutLineItemInput.swift index 8e9338ea..4b25472d 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemInput.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemInput.swift @@ -29,39 +29,61 @@ import Foundation extension Storefront { /// Specifies the input fields to create a line item on a checkout. open class CheckoutLineItemInput { - /// The identifier of the product variant for the line item. - open var variantId: GraphQL.ID + /// Extra information in the form of an array of Key-Value pairs about the line + /// item. + open var customAttributes: Input<[AttributeInput]> /// The quantity of the line item. open var quantity: Int32 - /// Extra information in the form of an array of Key-Value pairs about the line - /// item. - open var customAttributes: [AttributeInput]? + /// The identifier of the product variant for the line item. + open var variantId: GraphQL.ID /// Creates the input object. /// /// - parameters: - /// - variantId: The identifier of the product variant for the line item. - /// - quantity: The quantity of the line item. /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. + /// - quantity: The quantity of the line item. + /// - variantId: The identifier of the product variant for the line item. /// - public init(variantId: GraphQL.ID, quantity: Int32, customAttributes: [AttributeInput]? = nil) { - self.variantId = variantId - self.quantity = quantity + public static func create(quantity: Int32, variantId: GraphQL.ID, customAttributes: Input<[AttributeInput]> = .undefined) -> CheckoutLineItemInput { + return CheckoutLineItemInput(quantity: quantity, variantId: variantId, customAttributes: customAttributes) + } + + private init(quantity: Int32, variantId: GraphQL.ID, customAttributes: Input<[AttributeInput]> = .undefined) { self.customAttributes = customAttributes + self.quantity = quantity + self.variantId = variantId + } + + /// Creates the input object. + /// + /// - parameters: + /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. + /// - quantity: The quantity of the line item. + /// - variantId: The identifier of the product variant for the line item. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(quantity: Int32, variantId: GraphQL.ID, customAttributes: [AttributeInput]? = nil) { + self.init(quantity: quantity, variantId: variantId, customAttributes: customAttributes.orNull) } internal func serialize() -> String { var fields: [String] = [] - fields.append("variantId:\(GraphQL.quoteString(input: "\(variantId.rawValue)"))") + switch customAttributes { + case .value(let customAttributes): + guard let customAttributes = customAttributes else { + fields.append("customAttributes:null") + break + } + fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } fields.append("quantity:\(quantity)") - if let customAttributes = customAttributes { - fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") - } + fields.append("variantId:\(GraphQL.quoteString(input: "\(variantId.rawValue)"))") return "{\(fields.joined(separator: ","))}" } diff --git a/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift b/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift index 1e665777..ab90820b 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift @@ -29,17 +29,17 @@ import Foundation extension Storefront { /// Specifies the input fields to update a line item on the checkout. open class CheckoutLineItemUpdateInput { - open var id: GraphQL.ID? + open var id: Input /// The variant identifier of the line item. - open var variantId: GraphQL.ID? + open var variantId: Input /// The quantity of the line item. - open var quantity: Int32? + open var quantity: Input /// Extra information in the form of an array of Key-Value pairs about the line /// item. - open var customAttributes: [AttributeInput]? + open var customAttributes: Input<[AttributeInput]> /// Creates the input object. /// @@ -49,30 +49,71 @@ extension Storefront { /// - quantity: The quantity of the line item. /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. /// - public init(id: GraphQL.ID? = nil, variantId: GraphQL.ID? = nil, quantity: Int32? = nil, customAttributes: [AttributeInput]? = nil) { + public static func create(id: Input = .undefined, variantId: Input = .undefined, quantity: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined) -> CheckoutLineItemUpdateInput { + return CheckoutLineItemUpdateInput(id: id, variantId: variantId, quantity: quantity, customAttributes: customAttributes) + } + + private init(id: Input = .undefined, variantId: Input = .undefined, quantity: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined) { self.id = id self.variantId = variantId self.quantity = quantity self.customAttributes = customAttributes } + /// Creates the input object. + /// + /// - parameters: + /// - id: No description + /// - variantId: The variant identifier of the line item. + /// - quantity: The quantity of the line item. + /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(id: GraphQL.ID? = nil, variantId: GraphQL.ID? = nil, quantity: Int32? = nil, customAttributes: [AttributeInput]? = nil) { + self.init(id: id.orNull, variantId: variantId.orNull, quantity: quantity.orNull, customAttributes: customAttributes.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let id = id { + switch id { + case .value(let id): + guard let id = id else { + fields.append("id:null") + break + } fields.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") + case .undefined: break } - if let variantId = variantId { + switch variantId { + case .value(let variantId): + guard let variantId = variantId else { + fields.append("variantId:null") + break + } fields.append("variantId:\(GraphQL.quoteString(input: "\(variantId.rawValue)"))") + case .undefined: break } - if let quantity = quantity { + switch quantity { + case .value(let quantity): + guard let quantity = quantity else { + fields.append("quantity:null") + break + } fields.append("quantity:\(quantity)") + case .undefined: break } - if let customAttributes = customAttributes { + switch customAttributes { + case .value(let customAttributes): + guard let customAttributes = customAttributes else { + fields.append("customAttributes:null") + break + } fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift index ffa625a0..4bd3de4c 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift index 47c2e40e..5f59bca2 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift @@ -59,18 +59,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift index b2e2935b..5e4b1a07 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutShippingAddressUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutShippingAddressUpdatePayload.swift index 1c69d0d2..432e5e64 100644 --- a/Buy/Generated/Storefront/CheckoutShippingAddressUpdatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutShippingAddressUpdatePayload.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift index ae940e65..5bacbe34 100644 --- a/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift +++ b/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "checkout": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Collection.swift b/Buy/Generated/Storefront/Collection.swift index 177cd342..b87433a4 100644 --- a/Buy/Generated/Storefront/Collection.swift +++ b/Buy/Generated/Storefront/Collection.swift @@ -115,27 +115,39 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// @discardableResult - open func products(alias: String? = nil, first: Int32, after: String? = nil, sortKey: ProductCollectionSortKeys? = nil, reverse: Bool? = nil, _ subfields: (ProductConnectionQuery) -> Void) -> CollectionQuery { + open func products(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: ProductCollectionSortKeys? = nil, _ subfields: (ProductConnectionQuery) -> Void) -> CollectionQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" let subquery = ProductConnectionQuery() @@ -170,55 +182,55 @@ extension Storefront { switch fieldName { case "description": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return value case "descriptionHtml": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return value case "handle": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "image": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return try Image(fields: value) case "products": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return try ProductConnection(fields: value) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return value case "updatedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Collection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CollectionConnection.swift b/Buy/Generated/Storefront/CollectionConnection.swift index a7698da1..70f6a123 100644 --- a/Buy/Generated/Storefront/CollectionConnection.swift +++ b/Buy/Generated/Storefront/CollectionConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try CollectionEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CollectionEdge.swift b/Buy/Generated/Storefront/CollectionEdge.swift index 0bc988e6..65c27aa5 100644 --- a/Buy/Generated/Storefront/CollectionEdge.swift +++ b/Buy/Generated/Storefront/CollectionEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionEdge.self, field: fieldName, value: fieldValue) } return try Collection(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CollectionEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Comment.swift b/Buy/Generated/Storefront/Comment.swift index 0fab22af..099ad9ee 100644 --- a/Buy/Generated/Storefront/Comment.swift +++ b/Buy/Generated/Storefront/Comment.swift @@ -82,30 +82,30 @@ extension Storefront { switch fieldName { case "author": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Comment.self, field: fieldName, value: fieldValue) } return try CommentAuthor(fields: value) case "content": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Comment.self, field: fieldName, value: fieldValue) } return value case "contentHtml": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Comment.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Comment.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Comment.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CommentAuthor.swift b/Buy/Generated/Storefront/CommentAuthor.swift index 6096049a..c358ca17 100644 --- a/Buy/Generated/Storefront/CommentAuthor.swift +++ b/Buy/Generated/Storefront/CommentAuthor.swift @@ -53,18 +53,18 @@ extension Storefront { switch fieldName { case "email": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentAuthor.self, field: fieldName, value: fieldValue) } return value case "name": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentAuthor.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentAuthor.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CommentConnection.swift b/Buy/Generated/Storefront/CommentConnection.swift index b156f2df..f55d44bd 100644 --- a/Buy/Generated/Storefront/CommentConnection.swift +++ b/Buy/Generated/Storefront/CommentConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try CommentEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CommentEdge.swift b/Buy/Generated/Storefront/CommentEdge.swift index 8f126f0f..f2c32824 100644 --- a/Buy/Generated/Storefront/CommentEdge.swift +++ b/Buy/Generated/Storefront/CommentEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentEdge.self, field: fieldName, value: fieldValue) } return try Comment(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CommentEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CreditCard.swift b/Buy/Generated/Storefront/CreditCard.swift index 78365156..3ed8bf17 100644 --- a/Buy/Generated/Storefront/CreditCard.swift +++ b/Buy/Generated/Storefront/CreditCard.swift @@ -91,61 +91,61 @@ extension Storefront { case "brand": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value case "expiryMonth": if value is NSNull { return nil } guard let value = value as? Int else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return Int32(value) case "expiryYear": if value is NSNull { return nil } guard let value = value as? Int else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return Int32(value) case "firstDigits": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value case "firstName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value case "lastDigits": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value case "lastName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value case "maskedNumber": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CreditCardPaymentInput.swift b/Buy/Generated/Storefront/CreditCardPaymentInput.swift index 0af752e9..b5d9133b 100644 --- a/Buy/Generated/Storefront/CreditCardPaymentInput.swift +++ b/Buy/Generated/Storefront/CreditCardPaymentInput.swift @@ -45,7 +45,7 @@ extension Storefront { open var vaultId: String /// Executes the payment in test mode if possible. Defaults to `false`. - open var test: Bool? + open var test: Input /// Creates the input object. /// @@ -56,7 +56,11 @@ extension Storefront { /// - vaultId: The ID returned by Shopify's Card Vault. /// - test: Executes the payment in test mode if possible. Defaults to `false`. /// - public init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Bool? = nil) { + public static func create(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Input = .undefined) -> CreditCardPaymentInput { + return CreditCardPaymentInput(amount: amount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, vaultId: vaultId, test: test) + } + + private init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Input = .undefined) { self.amount = amount self.idempotencyKey = idempotencyKey self.billingAddress = billingAddress @@ -64,6 +68,20 @@ extension Storefront { self.test = test } + /// Creates the input object. + /// + /// - parameters: + /// - amount: The amount of the payment. + /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + /// - billingAddress: The billing address for the payment. + /// - vaultId: The ID returned by Shopify's Card Vault. + /// - test: Executes the payment in test mode if possible. Defaults to `false`. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Bool? = nil) { + self.init(amount: amount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, vaultId: vaultId, test: test.orNull) + } + internal func serialize() -> String { var fields: [String] = [] @@ -75,8 +93,14 @@ extension Storefront { fields.append("vaultId:\(GraphQL.quoteString(input: vaultId))") - if let test = test { + switch test { + case .value(let test): + guard let test = test else { + fields.append("test:null") + break + } fields.append("test:\(test)") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/Customer.swift b/Buy/Generated/Storefront/Customer.swift index 71d6f2de..990c4b42 100644 --- a/Buy/Generated/Storefront/Customer.swift +++ b/Buy/Generated/Storefront/Customer.swift @@ -46,18 +46,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func addresses(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (MailingAddressConnectionQuery) -> Void) -> CustomerQuery { + open func addresses(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (MailingAddressConnectionQuery) -> Void) -> CustomerQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -128,29 +140,41 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - query: Supported filter parameters: /// - `processed_at` /// @discardableResult - open func orders(alias: String? = nil, first: Int32, after: String? = nil, sortKey: OrderSortKeys? = nil, reverse: Bool? = nil, query: String? = nil, _ subfields: (OrderConnectionQuery) -> Void) -> CustomerQuery { + open func orders(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: OrderSortKeys? = nil, query: String? = nil, _ subfields: (OrderConnectionQuery) -> Void) -> CustomerQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let query = query { args.append("query:\(GraphQL.quoteString(input: query))") } @@ -190,83 +214,83 @@ extension Storefront { switch fieldName { case "acceptsMarketing": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "addresses": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return try MailingAddressConnection(fields: value) case "createdAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "defaultAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "displayName": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "email": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "firstName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "lastName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "orders": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return try OrderConnection(fields: value) case "phone": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return value case "updatedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAccessToken.swift b/Buy/Generated/Storefront/CustomerAccessToken.swift index dec5e584..c830c166 100644 --- a/Buy/Generated/Storefront/CustomerAccessToken.swift +++ b/Buy/Generated/Storefront/CustomerAccessToken.swift @@ -57,18 +57,18 @@ extension Storefront { switch fieldName { case "accessToken": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessToken.self, field: fieldName, value: fieldValue) } return value case "expiresAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessToken.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessToken.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAccessTokenCreateInput.swift b/Buy/Generated/Storefront/CustomerAccessTokenCreateInput.swift index 612ce4a4..f360754a 100644 --- a/Buy/Generated/Storefront/CustomerAccessTokenCreateInput.swift +++ b/Buy/Generated/Storefront/CustomerAccessTokenCreateInput.swift @@ -35,6 +35,16 @@ extension Storefront { /// The login password to be used by the customer. open var password: String + /// Creates the input object. + /// + /// - parameters: + /// - email: The email associated to the customer. + /// - password: The login password to be used by the customer. + /// + public static func create(email: String, password: String) -> CustomerAccessTokenCreateInput { + return CustomerAccessTokenCreateInput(email: email, password: password) + } + /// Creates the input object. /// /// - parameters: diff --git a/Buy/Generated/Storefront/CustomerAccessTokenCreatePayload.swift b/Buy/Generated/Storefront/CustomerAccessTokenCreatePayload.swift index ba00cdcb..2ed531e1 100644 --- a/Buy/Generated/Storefront/CustomerAccessTokenCreatePayload.swift +++ b/Buy/Generated/Storefront/CustomerAccessTokenCreatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customerAccessToken": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenCreatePayload.self, field: fieldName, value: fieldValue) } return try CustomerAccessToken(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenCreatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenCreatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAccessTokenDeletePayload.swift b/Buy/Generated/Storefront/CustomerAccessTokenDeletePayload.swift index 62e30871..327e0d5b 100644 --- a/Buy/Generated/Storefront/CustomerAccessTokenDeletePayload.swift +++ b/Buy/Generated/Storefront/CustomerAccessTokenDeletePayload.swift @@ -64,25 +64,25 @@ extension Storefront { case "deletedAccessToken": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenDeletePayload.self, field: fieldName, value: fieldValue) } return value case "deletedCustomerAccessTokenId": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenDeletePayload.self, field: fieldName, value: fieldValue) } return value case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenDeletePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenDeletePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAccessTokenRenewPayload.swift b/Buy/Generated/Storefront/CustomerAccessTokenRenewPayload.swift index 82b536fc..aa484164 100644 --- a/Buy/Generated/Storefront/CustomerAccessTokenRenewPayload.swift +++ b/Buy/Generated/Storefront/CustomerAccessTokenRenewPayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customerAccessToken": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenRenewPayload.self, field: fieldName, value: fieldValue) } return try CustomerAccessToken(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenRenewPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAccessTokenRenewPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerActivateInput.swift b/Buy/Generated/Storefront/CustomerActivateInput.swift index 507a5025..17ff1941 100644 --- a/Buy/Generated/Storefront/CustomerActivateInput.swift +++ b/Buy/Generated/Storefront/CustomerActivateInput.swift @@ -35,6 +35,16 @@ extension Storefront { /// The login password used by the customer. open var password: String + /// Creates the input object. + /// + /// - parameters: + /// - activationToken: The activation token required to activate the customer + /// - password: The login password used by the customer. + /// + public static func create(activationToken: String, password: String) -> CustomerActivateInput { + return CustomerActivateInput(activationToken: activationToken, password: password) + } + /// Creates the input object. /// /// - parameters: diff --git a/Buy/Generated/Storefront/CustomerActivatePayload.swift b/Buy/Generated/Storefront/CustomerActivatePayload.swift index b35291d1..d7d42c9f 100644 --- a/Buy/Generated/Storefront/CustomerActivatePayload.swift +++ b/Buy/Generated/Storefront/CustomerActivatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerActivatePayload.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerActivatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerActivatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAddressCreatePayload.swift b/Buy/Generated/Storefront/CustomerAddressCreatePayload.swift index c7448462..a88f504f 100644 --- a/Buy/Generated/Storefront/CustomerAddressCreatePayload.swift +++ b/Buy/Generated/Storefront/CustomerAddressCreatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customerAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressCreatePayload.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressCreatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressCreatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAddressDeletePayload.swift b/Buy/Generated/Storefront/CustomerAddressDeletePayload.swift index 32e13351..76eece6c 100644 --- a/Buy/Generated/Storefront/CustomerAddressDeletePayload.swift +++ b/Buy/Generated/Storefront/CustomerAddressDeletePayload.swift @@ -57,18 +57,18 @@ extension Storefront { case "deletedCustomerAddressId": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressDeletePayload.self, field: fieldName, value: fieldValue) } return value case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressDeletePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressDeletePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerAddressUpdatePayload.swift b/Buy/Generated/Storefront/CustomerAddressUpdatePayload.swift index 4378cd5d..62e0494e 100644 --- a/Buy/Generated/Storefront/CustomerAddressUpdatePayload.swift +++ b/Buy/Generated/Storefront/CustomerAddressUpdatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customerAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressUpdatePayload.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerAddressUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerCreateInput.swift b/Buy/Generated/Storefront/CustomerCreateInput.swift index 30cb3b27..225a866c 100644 --- a/Buy/Generated/Storefront/CustomerCreateInput.swift +++ b/Buy/Generated/Storefront/CustomerCreateInput.swift @@ -30,23 +30,23 @@ extension Storefront { /// Specifies the fields required to create a new Customer. open class CustomerCreateInput { /// The customer’s first name. - open var firstName: String? + open var firstName: Input /// The customer’s last name. - open var lastName: String? + open var lastName: Input /// The customer’s email. open var email: String /// The customer’s phone number. - open var phone: String? + open var phone: Input /// The login password used by the customer. open var password: String /// Indicates whether the customer has consented to be sent marketing material /// via email. - open var acceptsMarketing: Bool? + open var acceptsMarketing: Input /// Creates the input object. /// @@ -58,7 +58,11 @@ extension Storefront { /// - password: The login password used by the customer. /// - acceptsMarketing: Indicates whether the customer has consented to be sent marketing material via email. /// - public init(email: String, password: String, firstName: String? = nil, lastName: String? = nil, phone: String? = nil, acceptsMarketing: Bool? = nil) { + public static func create(email: String, password: String, firstName: Input = .undefined, lastName: Input = .undefined, phone: Input = .undefined, acceptsMarketing: Input = .undefined) -> CustomerCreateInput { + return CustomerCreateInput(email: email, password: password, firstName: firstName, lastName: lastName, phone: phone, acceptsMarketing: acceptsMarketing) + } + + private init(email: String, password: String, firstName: Input = .undefined, lastName: Input = .undefined, phone: Input = .undefined, acceptsMarketing: Input = .undefined) { self.firstName = firstName self.lastName = lastName self.email = email @@ -67,27 +71,66 @@ extension Storefront { self.acceptsMarketing = acceptsMarketing } + /// Creates the input object. + /// + /// - parameters: + /// - firstName: The customer’s first name. + /// - lastName: The customer’s last name. + /// - email: The customer’s email. + /// - phone: The customer’s phone number. + /// - password: The login password used by the customer. + /// - acceptsMarketing: Indicates whether the customer has consented to be sent marketing material via email. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(email: String, password: String, firstName: String? = nil, lastName: String? = nil, phone: String? = nil, acceptsMarketing: Bool? = nil) { + self.init(email: email, password: password, firstName: firstName.orNull, lastName: lastName.orNull, phone: phone.orNull, acceptsMarketing: acceptsMarketing.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let firstName = firstName { + switch firstName { + case .value(let firstName): + guard let firstName = firstName else { + fields.append("firstName:null") + break + } fields.append("firstName:\(GraphQL.quoteString(input: firstName))") + case .undefined: break } - if let lastName = lastName { + switch lastName { + case .value(let lastName): + guard let lastName = lastName else { + fields.append("lastName:null") + break + } fields.append("lastName:\(GraphQL.quoteString(input: lastName))") + case .undefined: break } fields.append("email:\(GraphQL.quoteString(input: email))") - if let phone = phone { + switch phone { + case .value(let phone): + guard let phone = phone else { + fields.append("phone:null") + break + } fields.append("phone:\(GraphQL.quoteString(input: phone))") + case .undefined: break } fields.append("password:\(GraphQL.quoteString(input: password))") - if let acceptsMarketing = acceptsMarketing { + switch acceptsMarketing { + case .value(let acceptsMarketing): + guard let acceptsMarketing = acceptsMarketing else { + fields.append("acceptsMarketing:null") + break + } fields.append("acceptsMarketing:\(acceptsMarketing)") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/CustomerCreatePayload.swift b/Buy/Generated/Storefront/CustomerCreatePayload.swift index ccfa611b..5053b4d7 100644 --- a/Buy/Generated/Storefront/CustomerCreatePayload.swift +++ b/Buy/Generated/Storefront/CustomerCreatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerCreatePayload.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerCreatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerCreatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerRecoverPayload.swift b/Buy/Generated/Storefront/CustomerRecoverPayload.swift index fdfcc6ec..5c5284cd 100644 --- a/Buy/Generated/Storefront/CustomerRecoverPayload.swift +++ b/Buy/Generated/Storefront/CustomerRecoverPayload.swift @@ -49,12 +49,12 @@ extension Storefront { switch fieldName { case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerRecoverPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerRecoverPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerResetInput.swift b/Buy/Generated/Storefront/CustomerResetInput.swift index 11067578..2df34018 100644 --- a/Buy/Generated/Storefront/CustomerResetInput.swift +++ b/Buy/Generated/Storefront/CustomerResetInput.swift @@ -35,6 +35,16 @@ extension Storefront { /// New password that will be set as part of the reset password process. open var password: String + /// Creates the input object. + /// + /// - parameters: + /// - resetToken: The reset token required to reset the customer’s password. + /// - password: New password that will be set as part of the reset password process. + /// + public static func create(resetToken: String, password: String) -> CustomerResetInput { + return CustomerResetInput(resetToken: resetToken, password: password) + } + /// Creates the input object. /// /// - parameters: diff --git a/Buy/Generated/Storefront/CustomerResetPayload.swift b/Buy/Generated/Storefront/CustomerResetPayload.swift index 971fc50a..4b7fdf9c 100644 --- a/Buy/Generated/Storefront/CustomerResetPayload.swift +++ b/Buy/Generated/Storefront/CustomerResetPayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerResetPayload.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerResetPayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerResetPayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/CustomerUpdateInput.swift b/Buy/Generated/Storefront/CustomerUpdateInput.swift index bf0b3f73..fb743488 100644 --- a/Buy/Generated/Storefront/CustomerUpdateInput.swift +++ b/Buy/Generated/Storefront/CustomerUpdateInput.swift @@ -30,23 +30,23 @@ extension Storefront { /// Specifies the fields required to update the Customer information. open class CustomerUpdateInput { /// The customer’s first name. - open var firstName: String? + open var firstName: Input /// The customer’s last name. - open var lastName: String? + open var lastName: Input /// The customer’s email. - open var email: String? + open var email: Input /// The customer’s phone number. - open var phone: String? + open var phone: Input /// The login password used by the customer. - open var password: String? + open var password: Input /// Indicates whether the customer has consented to be sent marketing material /// via email. - open var acceptsMarketing: Bool? + open var acceptsMarketing: Input /// Creates the input object. /// @@ -58,7 +58,11 @@ extension Storefront { /// - password: The login password used by the customer. /// - acceptsMarketing: Indicates whether the customer has consented to be sent marketing material via email. /// - public init(firstName: String? = nil, lastName: String? = nil, email: String? = nil, phone: String? = nil, password: String? = nil, acceptsMarketing: Bool? = nil) { + public static func create(firstName: Input = .undefined, lastName: Input = .undefined, email: Input = .undefined, phone: Input = .undefined, password: Input = .undefined, acceptsMarketing: Input = .undefined) -> CustomerUpdateInput { + return CustomerUpdateInput(firstName: firstName, lastName: lastName, email: email, phone: phone, password: password, acceptsMarketing: acceptsMarketing) + } + + private init(firstName: Input = .undefined, lastName: Input = .undefined, email: Input = .undefined, phone: Input = .undefined, password: Input = .undefined, acceptsMarketing: Input = .undefined) { self.firstName = firstName self.lastName = lastName self.email = email @@ -67,31 +71,82 @@ extension Storefront { self.acceptsMarketing = acceptsMarketing } + /// Creates the input object. + /// + /// - parameters: + /// - firstName: The customer’s first name. + /// - lastName: The customer’s last name. + /// - email: The customer’s email. + /// - phone: The customer’s phone number. + /// - password: The login password used by the customer. + /// - acceptsMarketing: Indicates whether the customer has consented to be sent marketing material via email. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(firstName: String? = nil, lastName: String? = nil, email: String? = nil, phone: String? = nil, password: String? = nil, acceptsMarketing: Bool? = nil) { + self.init(firstName: firstName.orNull, lastName: lastName.orNull, email: email.orNull, phone: phone.orNull, password: password.orNull, acceptsMarketing: acceptsMarketing.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let firstName = firstName { + switch firstName { + case .value(let firstName): + guard let firstName = firstName else { + fields.append("firstName:null") + break + } fields.append("firstName:\(GraphQL.quoteString(input: firstName))") + case .undefined: break } - if let lastName = lastName { + switch lastName { + case .value(let lastName): + guard let lastName = lastName else { + fields.append("lastName:null") + break + } fields.append("lastName:\(GraphQL.quoteString(input: lastName))") + case .undefined: break } - if let email = email { + switch email { + case .value(let email): + guard let email = email else { + fields.append("email:null") + break + } fields.append("email:\(GraphQL.quoteString(input: email))") + case .undefined: break } - if let phone = phone { + switch phone { + case .value(let phone): + guard let phone = phone else { + fields.append("phone:null") + break + } fields.append("phone:\(GraphQL.quoteString(input: phone))") + case .undefined: break } - if let password = password { + switch password { + case .value(let password): + guard let password = password else { + fields.append("password:null") + break + } fields.append("password:\(GraphQL.quoteString(input: password))") + case .undefined: break } - if let acceptsMarketing = acceptsMarketing { + switch acceptsMarketing { + case .value(let acceptsMarketing): + guard let acceptsMarketing = acceptsMarketing else { + fields.append("acceptsMarketing:null") + break + } fields.append("acceptsMarketing:\(acceptsMarketing)") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/CustomerUpdatePayload.swift b/Buy/Generated/Storefront/CustomerUpdatePayload.swift index 0f042d18..5822b3ba 100644 --- a/Buy/Generated/Storefront/CustomerUpdatePayload.swift +++ b/Buy/Generated/Storefront/CustomerUpdatePayload.swift @@ -60,18 +60,18 @@ extension Storefront { case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerUpdatePayload.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerUpdatePayload.self, field: fieldName, value: fieldValue) } return try value.map { return try UserError(fields: $0) } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CustomerUpdatePayload.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Domain.swift b/Buy/Generated/Storefront/Domain.swift index a7054319..4d47b9ee 100644 --- a/Buy/Generated/Storefront/Domain.swift +++ b/Buy/Generated/Storefront/Domain.swift @@ -62,24 +62,24 @@ extension Storefront { switch fieldName { case "host": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Domain.self, field: fieldName, value: fieldValue) } return value case "sslEnabled": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Domain.self, field: fieldName, value: fieldValue) } return value case "url": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Domain.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Domain.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Image.swift b/Buy/Generated/Storefront/Image.swift index bb47a70d..419b2c82 100644 --- a/Buy/Generated/Storefront/Image.swift +++ b/Buy/Generated/Storefront/Image.swift @@ -63,25 +63,25 @@ extension Storefront { case "altText": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Image.self, field: fieldName, value: fieldValue) } return value case "id": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Image.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "src": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Image.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Image.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ImageConnection.swift b/Buy/Generated/Storefront/ImageConnection.swift index e60f8f44..8fd862e9 100644 --- a/Buy/Generated/Storefront/ImageConnection.swift +++ b/Buy/Generated/Storefront/ImageConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try ImageEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ImageEdge.swift b/Buy/Generated/Storefront/ImageEdge.swift index f19c30f6..4f1e5456 100644 --- a/Buy/Generated/Storefront/ImageEdge.swift +++ b/Buy/Generated/Storefront/ImageEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageEdge.self, field: fieldName, value: fieldValue) } return try Image(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ImageEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/MailingAddress.swift b/Buy/Generated/Storefront/MailingAddress.swift index 92da3ed5..d0aa6c12 100644 --- a/Buy/Generated/Storefront/MailingAddress.swift +++ b/Buy/Generated/Storefront/MailingAddress.swift @@ -31,42 +31,49 @@ extension Storefront { open class MailingAddressQuery: GraphQL.AbstractQuery, GraphQLQuery { public typealias Response = MailingAddress + /// Address line 1 (Street address/PO Box/Company name). @discardableResult open func address1(alias: String? = nil) -> MailingAddressQuery { addField(field: "address1", aliasSuffix: alias) return self } + /// Address line 2 (Apartment/Suite/Unit/Building). @discardableResult open func address2(alias: String? = nil) -> MailingAddressQuery { addField(field: "address2", aliasSuffix: alias) return self } + /// City/District/Suburb/Town/Village. @discardableResult open func city(alias: String? = nil) -> MailingAddressQuery { addField(field: "city", aliasSuffix: alias) return self } + /// Company/Organization/Government. @discardableResult open func company(alias: String? = nil) -> MailingAddressQuery { addField(field: "company", aliasSuffix: alias) return self } + /// State/County/Province/Region. @discardableResult open func country(alias: String? = nil) -> MailingAddressQuery { addField(field: "country", aliasSuffix: alias) return self } + /// Two-letter country code. For example, US. @discardableResult open func countryCode(alias: String? = nil) -> MailingAddressQuery { addField(field: "countryCode", aliasSuffix: alias) return self } + /// First name of the customer. @discardableResult open func firstName(alias: String? = nil) -> MailingAddressQuery { addField(field: "firstName", aliasSuffix: alias) @@ -96,6 +103,7 @@ extension Storefront { return self } + /// Comma-separated list of city, province, and country. @discardableResult open func formattedArea(alias: String? = nil) -> MailingAddressQuery { addField(field: "formattedArea", aliasSuffix: alias) @@ -109,48 +117,57 @@ extension Storefront { return self } + /// Last name of the customer. @discardableResult open func lastName(alias: String? = nil) -> MailingAddressQuery { addField(field: "lastName", aliasSuffix: alias) return self } + /// Latitude coordinate of the customer address. @discardableResult open func latitude(alias: String? = nil) -> MailingAddressQuery { addField(field: "latitude", aliasSuffix: alias) return self } + /// Longitude coordinate of the customer address. @discardableResult open func longitude(alias: String? = nil) -> MailingAddressQuery { addField(field: "longitude", aliasSuffix: alias) return self } + /// Name of the customer, based on first name + last name. @discardableResult open func name(alias: String? = nil) -> MailingAddressQuery { addField(field: "name", aliasSuffix: alias) return self } + /// Unique phone number for the customer. Formatted using E.164 standard. For + /// example, _+16135551111_. @discardableResult open func phone(alias: String? = nil) -> MailingAddressQuery { addField(field: "phone", aliasSuffix: alias) return self } + /// State/County/Province/Region. @discardableResult open func province(alias: String? = nil) -> MailingAddressQuery { addField(field: "province", aliasSuffix: alias) return self } + /// Two-letter province or state code. For example, ON. @discardableResult open func provinceCode(alias: String? = nil) -> MailingAddressQuery { addField(field: "provinceCode", aliasSuffix: alias) return self } + /// Zip/Postal Code. @discardableResult open func zip(alias: String? = nil) -> MailingAddressQuery { addField(field: "zip", aliasSuffix: alias) @@ -168,132 +185,133 @@ extension Storefront { case "address1": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "address2": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "city": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "company": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "country": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "countryCode": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "firstName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "formatted": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value.map { return $0 } case "formattedArea": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "lastName": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "latitude": if value is NSNull { return nil } guard let value = value as? Double else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "longitude": if value is NSNull { return nil } guard let value = value as? Double else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "name": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "phone": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "province": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "provinceCode": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value case "zip": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddress.self, field: fieldName, value: fieldValue) } } + /// Address line 1 (Street address/PO Box/Company name). open var address1: String? { return internalGetAddress1() } @@ -302,6 +320,7 @@ extension Storefront { return field(field: "address1", aliasSuffix: alias) as! String? } + /// Address line 2 (Apartment/Suite/Unit/Building). open var address2: String? { return internalGetAddress2() } @@ -310,6 +329,7 @@ extension Storefront { return field(field: "address2", aliasSuffix: alias) as! String? } + /// City/District/Suburb/Town/Village. open var city: String? { return internalGetCity() } @@ -318,6 +338,7 @@ extension Storefront { return field(field: "city", aliasSuffix: alias) as! String? } + /// Company/Organization/Government. open var company: String? { return internalGetCompany() } @@ -326,6 +347,7 @@ extension Storefront { return field(field: "company", aliasSuffix: alias) as! String? } + /// State/County/Province/Region. open var country: String? { return internalGetCountry() } @@ -334,6 +356,7 @@ extension Storefront { return field(field: "country", aliasSuffix: alias) as! String? } + /// Two-letter country code. For example, US. open var countryCode: String? { return internalGetCountryCode() } @@ -342,6 +365,7 @@ extension Storefront { return field(field: "countryCode", aliasSuffix: alias) as! String? } + /// First name of the customer. open var firstName: String? { return internalGetFirstName() } @@ -362,6 +386,7 @@ extension Storefront { return field(field: "formatted", aliasSuffix: alias) as! [String] } + /// Comma-separated list of city, province, and country. open var formattedArea: String? { return internalGetFormattedArea() } @@ -379,6 +404,7 @@ extension Storefront { return field(field: "id", aliasSuffix: alias) as! GraphQL.ID } + /// Last name of the customer. open var lastName: String? { return internalGetLastName() } @@ -387,6 +413,7 @@ extension Storefront { return field(field: "lastName", aliasSuffix: alias) as! String? } + /// Latitude coordinate of the customer address. open var latitude: Double? { return internalGetLatitude() } @@ -395,6 +422,7 @@ extension Storefront { return field(field: "latitude", aliasSuffix: alias) as! Double? } + /// Longitude coordinate of the customer address. open var longitude: Double? { return internalGetLongitude() } @@ -403,6 +431,7 @@ extension Storefront { return field(field: "longitude", aliasSuffix: alias) as! Double? } + /// Name of the customer, based on first name + last name. open var name: String? { return internalGetName() } @@ -411,6 +440,8 @@ extension Storefront { return field(field: "name", aliasSuffix: alias) as! String? } + /// Unique phone number for the customer. Formatted using E.164 standard. For + /// example, _+16135551111_. open var phone: String? { return internalGetPhone() } @@ -419,6 +450,7 @@ extension Storefront { return field(field: "phone", aliasSuffix: alias) as! String? } + /// State/County/Province/Region. open var province: String? { return internalGetProvince() } @@ -427,6 +459,7 @@ extension Storefront { return field(field: "province", aliasSuffix: alias) as! String? } + /// Two-letter province or state code. For example, ON. open var provinceCode: String? { return internalGetProvinceCode() } @@ -435,6 +468,7 @@ extension Storefront { return field(field: "provinceCode", aliasSuffix: alias) as! String? } + /// Zip/Postal Code. open var zip: String? { return internalGetZip() } diff --git a/Buy/Generated/Storefront/MailingAddressConnection.swift b/Buy/Generated/Storefront/MailingAddressConnection.swift index d903596f..176e56e2 100644 --- a/Buy/Generated/Storefront/MailingAddressConnection.swift +++ b/Buy/Generated/Storefront/MailingAddressConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try MailingAddressEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/MailingAddressEdge.swift b/Buy/Generated/Storefront/MailingAddressEdge.swift index 7e349f14..25a1d24d 100644 --- a/Buy/Generated/Storefront/MailingAddressEdge.swift +++ b/Buy/Generated/Storefront/MailingAddressEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressEdge.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: MailingAddressEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/MailingAddressInput.swift b/Buy/Generated/Storefront/MailingAddressInput.swift index a8b7d47f..e97b4a27 100644 --- a/Buy/Generated/Storefront/MailingAddressInput.swift +++ b/Buy/Generated/Storefront/MailingAddressInput.swift @@ -29,25 +29,25 @@ import Foundation extension Storefront { /// Specifies the fields accepted to create or update a mailing address. open class MailingAddressInput { - open var address1: String? + open var address1: Input - open var address2: String? + open var address2: Input - open var city: String? + open var city: Input - open var company: String? + open var company: Input - open var country: String? + open var country: Input - open var firstName: String? + open var firstName: Input - open var lastName: String? + open var lastName: Input - open var phone: String? + open var phone: Input - open var province: String? + open var province: Input - open var zip: String? + open var zip: Input /// Creates the input object. /// @@ -63,7 +63,11 @@ extension Storefront { /// - province: No description /// - zip: No description /// - public init(address1: String? = nil, address2: String? = nil, city: String? = nil, company: String? = nil, country: String? = nil, firstName: String? = nil, lastName: String? = nil, phone: String? = nil, province: String? = nil, zip: String? = nil) { + public static func create(address1: Input = .undefined, address2: Input = .undefined, city: Input = .undefined, company: Input = .undefined, country: Input = .undefined, firstName: Input = .undefined, lastName: Input = .undefined, phone: Input = .undefined, province: Input = .undefined, zip: Input = .undefined) -> MailingAddressInput { + return MailingAddressInput(address1: address1, address2: address2, city: city, company: company, country: country, firstName: firstName, lastName: lastName, phone: phone, province: province, zip: zip) + } + + private init(address1: Input = .undefined, address2: Input = .undefined, city: Input = .undefined, company: Input = .undefined, country: Input = .undefined, firstName: Input = .undefined, lastName: Input = .undefined, phone: Input = .undefined, province: Input = .undefined, zip: Input = .undefined) { self.address1 = address1 self.address2 = address2 self.city = city @@ -76,47 +80,126 @@ extension Storefront { self.zip = zip } + /// Creates the input object. + /// + /// - parameters: + /// - address1: No description + /// - address2: No description + /// - city: No description + /// - company: No description + /// - country: No description + /// - firstName: No description + /// - lastName: No description + /// - phone: No description + /// - province: No description + /// - zip: No description + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(address1: String? = nil, address2: String? = nil, city: String? = nil, company: String? = nil, country: String? = nil, firstName: String? = nil, lastName: String? = nil, phone: String? = nil, province: String? = nil, zip: String? = nil) { + self.init(address1: address1.orNull, address2: address2.orNull, city: city.orNull, company: company.orNull, country: country.orNull, firstName: firstName.orNull, lastName: lastName.orNull, phone: phone.orNull, province: province.orNull, zip: zip.orNull) + } + internal func serialize() -> String { var fields: [String] = [] - if let address1 = address1 { + switch address1 { + case .value(let address1): + guard let address1 = address1 else { + fields.append("address1:null") + break + } fields.append("address1:\(GraphQL.quoteString(input: address1))") + case .undefined: break } - if let address2 = address2 { + switch address2 { + case .value(let address2): + guard let address2 = address2 else { + fields.append("address2:null") + break + } fields.append("address2:\(GraphQL.quoteString(input: address2))") + case .undefined: break } - if let city = city { + switch city { + case .value(let city): + guard let city = city else { + fields.append("city:null") + break + } fields.append("city:\(GraphQL.quoteString(input: city))") + case .undefined: break } - if let company = company { + switch company { + case .value(let company): + guard let company = company else { + fields.append("company:null") + break + } fields.append("company:\(GraphQL.quoteString(input: company))") + case .undefined: break } - if let country = country { + switch country { + case .value(let country): + guard let country = country else { + fields.append("country:null") + break + } fields.append("country:\(GraphQL.quoteString(input: country))") + case .undefined: break } - if let firstName = firstName { + switch firstName { + case .value(let firstName): + guard let firstName = firstName else { + fields.append("firstName:null") + break + } fields.append("firstName:\(GraphQL.quoteString(input: firstName))") + case .undefined: break } - if let lastName = lastName { + switch lastName { + case .value(let lastName): + guard let lastName = lastName else { + fields.append("lastName:null") + break + } fields.append("lastName:\(GraphQL.quoteString(input: lastName))") + case .undefined: break } - if let phone = phone { + switch phone { + case .value(let phone): + guard let phone = phone else { + fields.append("phone:null") + break + } fields.append("phone:\(GraphQL.quoteString(input: phone))") + case .undefined: break } - if let province = province { + switch province { + case .value(let province): + guard let province = province else { + fields.append("province:null") + break + } fields.append("province:\(GraphQL.quoteString(input: province))") + case .undefined: break } - if let zip = zip { + switch zip { + case .value(let zip): + guard let zip = zip else { + fields.append("zip:null") + break + } fields.append("zip:\(GraphQL.quoteString(input: zip))") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/Mutation.swift b/Buy/Generated/Storefront/Mutation.swift index 4a54b15c..99014d3c 100644 --- a/Buy/Generated/Storefront/Mutation.swift +++ b/Buy/Generated/Storefront/Mutation.swift @@ -626,187 +626,187 @@ extension Storefront { case "checkoutAttributesUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutAttributesUpdatePayload(fields: value) case "checkoutCompleteFree": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCompleteFreePayload(fields: value) case "checkoutCompleteWithCreditCard": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCompleteWithCreditCardPayload(fields: value) case "checkoutCompleteWithTokenizedPayment": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCompleteWithTokenizedPaymentPayload(fields: value) case "checkoutCreate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCreatePayload(fields: value) case "checkoutCustomerAssociate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCustomerAssociatePayload(fields: value) case "checkoutCustomerDisassociate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutCustomerDisassociatePayload(fields: value) case "checkoutEmailUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutEmailUpdatePayload(fields: value) case "checkoutGiftCardApply": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutGiftCardApplyPayload(fields: value) case "checkoutGiftCardRemove": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutGiftCardRemovePayload(fields: value) case "checkoutLineItemsAdd": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutLineItemsAddPayload(fields: value) case "checkoutLineItemsRemove": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutLineItemsRemovePayload(fields: value) case "checkoutLineItemsUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutLineItemsUpdatePayload(fields: value) case "checkoutShippingAddressUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutShippingAddressUpdatePayload(fields: value) case "checkoutShippingLineUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CheckoutShippingLineUpdatePayload(fields: value) case "customerAccessTokenCreate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAccessTokenCreatePayload(fields: value) case "customerAccessTokenDelete": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAccessTokenDeletePayload(fields: value) case "customerAccessTokenRenew": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAccessTokenRenewPayload(fields: value) case "customerActivate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerActivatePayload(fields: value) case "customerAddressCreate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAddressCreatePayload(fields: value) case "customerAddressDelete": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAddressDeletePayload(fields: value) case "customerAddressUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerAddressUpdatePayload(fields: value) case "customerCreate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerCreatePayload(fields: value) case "customerRecover": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerRecoverPayload(fields: value) case "customerReset": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerResetPayload(fields: value) case "customerUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } return try CustomerUpdatePayload(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Node.swift b/Buy/Generated/Storefront/Node.swift index b7abc117..4cefe523 100644 --- a/Buy/Generated/Storefront/Node.swift +++ b/Buy/Generated/Storefront/Node.swift @@ -184,12 +184,12 @@ extension Storefront { switch fieldName { case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UnknownNode.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UnknownNode.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Order.swift b/Buy/Generated/Storefront/Order.swift index cd2130d4..799a1bac 100644 --- a/Buy/Generated/Storefront/Order.swift +++ b/Buy/Generated/Storefront/Order.swift @@ -74,18 +74,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func lineItems(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (OrderLineItemConnectionQuery) -> Void) -> OrderQuery { + open func lineItems(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (OrderLineItemConnectionQuery) -> Void) -> OrderQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -182,103 +194,103 @@ extension Storefront { switch fieldName { case "currencyCode": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return CurrencyCode(rawValue: value) ?? .unknownValue case "customerLocale": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return value case "customerUrl": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return URL(string: value)! case "email": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "lineItems": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return try OrderLineItemConnection(fields: value) case "orderNumber": guard let value = value as? Int else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Int32(value) case "phone": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return value case "processedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "shippingAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "subtotalPrice": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "totalPrice": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "totalRefunded": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "totalShippingPrice": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "totalTax": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/OrderConnection.swift b/Buy/Generated/Storefront/OrderConnection.swift index 77443c77..f674d591 100644 --- a/Buy/Generated/Storefront/OrderConnection.swift +++ b/Buy/Generated/Storefront/OrderConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try OrderEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/OrderEdge.swift b/Buy/Generated/Storefront/OrderEdge.swift index b8452683..652b1dd6 100644 --- a/Buy/Generated/Storefront/OrderEdge.swift +++ b/Buy/Generated/Storefront/OrderEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderEdge.self, field: fieldName, value: fieldValue) } return try Order(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/OrderLineItem.swift b/Buy/Generated/Storefront/OrderLineItem.swift index fd211114..0e137bbb 100644 --- a/Buy/Generated/Storefront/OrderLineItem.swift +++ b/Buy/Generated/Storefront/OrderLineItem.swift @@ -77,31 +77,31 @@ extension Storefront { switch fieldName { case "customAttributes": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItem.self, field: fieldName, value: fieldValue) } return try value.map { return try Attribute(fields: $0) } case "quantity": guard let value = value as? Int else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItem.self, field: fieldName, value: fieldValue) } return Int32(value) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItem.self, field: fieldName, value: fieldValue) } return value case "variant": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItem.self, field: fieldName, value: fieldValue) } return try ProductVariant(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItem.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/OrderLineItemConnection.swift b/Buy/Generated/Storefront/OrderLineItemConnection.swift index ff583abe..181d5da8 100644 --- a/Buy/Generated/Storefront/OrderLineItemConnection.swift +++ b/Buy/Generated/Storefront/OrderLineItemConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try OrderLineItemEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/OrderLineItemEdge.swift b/Buy/Generated/Storefront/OrderLineItemEdge.swift index e1b8f85e..eee70f7f 100644 --- a/Buy/Generated/Storefront/OrderLineItemEdge.swift +++ b/Buy/Generated/Storefront/OrderLineItemEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemEdge.self, field: fieldName, value: fieldValue) } return try OrderLineItem(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: OrderLineItemEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/PageInfo.swift b/Buy/Generated/Storefront/PageInfo.swift index 02874a34..3e241347 100644 --- a/Buy/Generated/Storefront/PageInfo.swift +++ b/Buy/Generated/Storefront/PageInfo.swift @@ -55,18 +55,18 @@ extension Storefront { switch fieldName { case "hasNextPage": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PageInfo.self, field: fieldName, value: fieldValue) } return value case "hasPreviousPage": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PageInfo.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PageInfo.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Payment.swift b/Buy/Generated/Storefront/Payment.swift index da815853..95f0a190 100644 --- a/Buy/Generated/Storefront/Payment.swift +++ b/Buy/Generated/Storefront/Payment.swift @@ -126,71 +126,71 @@ extension Storefront { switch fieldName { case "amount": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "billingAddress": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return try MailingAddress(fields: value) case "checkout": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return try Checkout(fields: value) case "creditCard": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return try CreditCard(fields: value) case "errorMessage": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "idempotencyKey": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return value case "ready": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return value case "test": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return value case "transaction": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } return try Transaction(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/PaymentSettings.swift b/Buy/Generated/Storefront/PaymentSettings.swift index 4f7ccd92..1d1d7949 100644 --- a/Buy/Generated/Storefront/PaymentSettings.swift +++ b/Buy/Generated/Storefront/PaymentSettings.swift @@ -83,43 +83,43 @@ extension Storefront { switch fieldName { case "acceptedCardBrands": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return value.map { return CardBrand(rawValue: $0) ?? .unknownValue } case "cardVaultUrl": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return URL(string: value)! case "countryCode": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return CountryCode(rawValue: value) ?? .unknownValue case "currencyCode": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return CurrencyCode(rawValue: value) ?? .unknownValue case "shopifyPaymentsAccountId": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return value case "supportedDigitalWallets": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } return value.map { return DigitalWallet(rawValue: $0) ?? .unknownValue } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: PaymentSettings.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Product.swift b/Buy/Generated/Storefront/Product.swift index db346924..2ce67308 100644 --- a/Buy/Generated/Storefront/Product.swift +++ b/Buy/Generated/Storefront/Product.swift @@ -40,18 +40,30 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// @discardableResult - open func collections(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, _ subfields: (CollectionConnectionQuery) -> Void) -> ProductQuery { + open func collections(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (CollectionConnectionQuery) -> Void) -> ProductQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -119,31 +131,43 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - maxWidth: Image width in pixels between 1 and 2048 /// - maxHeight: Image height in pixels between 1 and 2048 /// - crop: If specified, crop the image keeping the specified region /// - scale: Image size multiplier retina displays. Must be between 1 and 3 /// @discardableResult - open func images(alias: String? = nil, first: Int32, after: String? = nil, sortKey: ProductImageSortKeys? = nil, reverse: Bool? = nil, maxWidth: Int32? = nil, maxHeight: Int32? = nil, crop: CropRegion? = nil, scale: Int32? = nil, _ subfields: (ImageConnectionQuery) -> Void) -> ProductQuery { + open func images(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: ProductImageSortKeys? = nil, maxWidth: Int32? = nil, maxHeight: Int32? = nil, crop: CropRegion? = nil, scale: Int32? = nil, _ subfields: (ImageConnectionQuery) -> Void) -> ProductQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let maxWidth = maxWidth { args.append("maxWidth:\(maxWidth)") } @@ -265,19 +289,31 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description + /// - last: No description + /// - before: No description /// - reverse: No description /// - sortKey: No description /// @discardableResult - open func variants(alias: String? = nil, first: Int32, after: String? = nil, reverse: Bool? = nil, sortKey: ProductVariantSortKeys? = nil, _ subfields: (ProductVariantConnectionQuery) -> Void) -> ProductQuery { + open func variants(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: ProductVariantSortKeys? = nil, _ subfields: (ProductVariantConnectionQuery) -> Void) -> ProductQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + if let reverse = reverse { args.append("reverse:\(reverse)") } @@ -316,110 +352,110 @@ extension Storefront { switch fieldName { case "collections": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return try CollectionConnection(fields: value) case "createdAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "description": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value case "descriptionHtml": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value case "handle": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "images": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return try ImageConnection(fields: value) case "onlineStoreUrl": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return URL(string: value)! case "options": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return try value.map { return try ProductOption(fields: $0) } case "productType": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value case "publishedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "tags": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value.map { return $0 } case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value case "updatedAt": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return GraphQL.iso8601DateParser.date(from: value)! case "variantBySelectedOptions": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return try ProductVariant(fields: value) case "variants": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return try ProductVariantConnection(fields: value) case "vendor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Product.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductConnection.swift b/Buy/Generated/Storefront/ProductConnection.swift index 49b19213..30f50174 100644 --- a/Buy/Generated/Storefront/ProductConnection.swift +++ b/Buy/Generated/Storefront/ProductConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try ProductEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductEdge.swift b/Buy/Generated/Storefront/ProductEdge.swift index 6090aed6..c5c69248 100644 --- a/Buy/Generated/Storefront/ProductEdge.swift +++ b/Buy/Generated/Storefront/ProductEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductEdge.self, field: fieldName, value: fieldValue) } return try Product(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductOption.swift b/Buy/Generated/Storefront/ProductOption.swift index 6ee07692..8c95ff90 100644 --- a/Buy/Generated/Storefront/ProductOption.swift +++ b/Buy/Generated/Storefront/ProductOption.swift @@ -66,24 +66,24 @@ extension Storefront { switch fieldName { case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "name": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) } return value case "values": guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) } return value.map { return $0 } default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductVariant.swift b/Buy/Generated/Storefront/ProductVariant.swift index 2d588304..58a322db 100644 --- a/Buy/Generated/Storefront/ProductVariant.swift +++ b/Buy/Generated/Storefront/ProductVariant.swift @@ -167,82 +167,82 @@ extension Storefront { case "available": if value is NSNull { return nil } guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value case "availableForSale": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value case "compareAtPrice": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "image": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return try Image(fields: value) case "price": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "product": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return try Product(fields: value) case "selectedOptions": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return try value.map { return try SelectedOption(fields: $0) } case "sku": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value case "weight": if value is NSNull { return nil } guard let value = value as? Double else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value case "weightUnit": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return WeightUnit(rawValue: value) ?? .unknownValue default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductVariantConnection.swift b/Buy/Generated/Storefront/ProductVariantConnection.swift index 2e551f8d..e5c43ea4 100644 --- a/Buy/Generated/Storefront/ProductVariantConnection.swift +++ b/Buy/Generated/Storefront/ProductVariantConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try ProductVariantEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ProductVariantEdge.swift b/Buy/Generated/Storefront/ProductVariantEdge.swift index 62c04d61..1578b8bb 100644 --- a/Buy/Generated/Storefront/ProductVariantEdge.swift +++ b/Buy/Generated/Storefront/ProductVariantEdge.swift @@ -56,18 +56,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantEdge.self, field: fieldName, value: fieldValue) } return try ProductVariant(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/QueryRoot.swift b/Buy/Generated/Storefront/QueryRoot.swift index 9d64a252..cb6d51a5 100644 --- a/Buy/Generated/Storefront/QueryRoot.swift +++ b/Buy/Generated/Storefront/QueryRoot.swift @@ -70,6 +70,25 @@ extension Storefront { return self } + /// + /// - parameters: + /// - ids: No description + /// + @discardableResult + open func nodes(alias: String? = nil, ids: [GraphQL.ID], _ subfields: (NodeQuery) -> Void) -> QueryRootQuery { + var args: [String] = [] + + args.append("ids:[\(ids.map{ "\(GraphQL.quoteString(input: "\($0.rawValue)"))" }.joined(separator: ","))]") + + let argsString = "(\(args.joined(separator: ",")))" + + let subquery = NodeQuery() + subfields(subquery) + + addField(field: "nodes", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + @discardableResult open func shop(alias: String? = nil, _ subfields: (ShopQuery) -> Void) -> QueryRootQuery { let subquery = ShopQuery() @@ -91,25 +110,35 @@ extension Storefront { case "customer": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) } return try Customer(fields: value) case "node": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) } return try UnknownNode.create(fields: value) + case "nodes": + guard let value = value as? [Any] else { + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) + } + return try value.map { if $0 is NSNull { return nil } + guard let value = $0 as? [String: Any] else { + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) + } + return try UnknownNode.create(fields: value) } as [Any?] + case "shop": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) } return try Shop(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: QueryRoot.self, field: fieldName, value: fieldValue) } } @@ -137,6 +166,18 @@ extension Storefront { return field(field: "node", aliasSuffix: alias) as! Node? } + open var nodes: [Node?] { + return internalGetNodes() + } + + open func aliasedNodes(alias: String) -> [Node?] { + return internalGetNodes(alias: alias) + } + + func internalGetNodes(alias: String? = nil) -> [Node?] { + return field(field: "nodes", aliasSuffix: alias) as! [Node?] + } + open var shop: Storefront.Shop { return internalGetShop() } @@ -161,6 +202,14 @@ extension Storefront { response.append(contentsOf: (value as! GraphQL.AbstractResponse).childResponseObjectMap()) } + case "nodes": + internalGetNodes().forEach { + if let value = $0 { + response.append((value as! GraphQL.AbstractResponse)) + response.append(contentsOf: (value as! GraphQL.AbstractResponse).childResponseObjectMap()) + } + } + case "shop": response.append(internalGetShop()) response.append(contentsOf: internalGetShop().childResponseObjectMap()) diff --git a/Buy/Generated/Storefront/SelectedOption.swift b/Buy/Generated/Storefront/SelectedOption.swift index 3f8e3ea9..15c5741f 100644 --- a/Buy/Generated/Storefront/SelectedOption.swift +++ b/Buy/Generated/Storefront/SelectedOption.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "name": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: SelectedOption.self, field: fieldName, value: fieldValue) } return value case "value": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: SelectedOption.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: SelectedOption.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/SelectedOptionInput.swift b/Buy/Generated/Storefront/SelectedOptionInput.swift index 91cdf5a3..bef4235f 100644 --- a/Buy/Generated/Storefront/SelectedOptionInput.swift +++ b/Buy/Generated/Storefront/SelectedOptionInput.swift @@ -35,6 +35,16 @@ extension Storefront { /// The product option’s value. open var value: String + /// Creates the input object. + /// + /// - parameters: + /// - name: The product option’s name. + /// - value: The product option’s value. + /// + public static func create(name: String, value: String) -> SelectedOptionInput { + return SelectedOptionInput(name: name, value: value) + } + /// Creates the input object. /// /// - parameters: diff --git a/Buy/Generated/Storefront/ShippingRate.swift b/Buy/Generated/Storefront/ShippingRate.swift index b6598359..e4fda686 100644 --- a/Buy/Generated/Storefront/ShippingRate.swift +++ b/Buy/Generated/Storefront/ShippingRate.swift @@ -62,24 +62,24 @@ extension Storefront { switch fieldName { case "handle": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) } return value case "price": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/Shop.swift b/Buy/Generated/Storefront/Shop.swift index b9962ad9..4401a399 100644 --- a/Buy/Generated/Storefront/Shop.swift +++ b/Buy/Generated/Storefront/Shop.swift @@ -37,8 +37,10 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - query: Supported filter parameters: /// - `author` /// - `updated_at` @@ -47,23 +49,33 @@ extension Storefront { /// - `tag` /// @discardableResult - open func articles(alias: String? = nil, first: Int32, after: String? = nil, sortKey: ArticleSortKeys? = nil, reverse: Bool? = nil, query: String? = nil, _ subfields: (ArticleConnectionQuery) -> Void) -> ShopQuery { + open func articles(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: ArticleSortKeys? = nil, query: String? = nil, _ subfields: (ArticleConnectionQuery) -> Void) -> ShopQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let query = query { args.append("query:\(GraphQL.quoteString(input: query))") } @@ -82,8 +94,10 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - query: Supported filter parameters: /// - `handle` /// - `title` @@ -91,23 +105,33 @@ extension Storefront { /// - `created_at` /// @discardableResult - open func blogs(alias: String? = nil, first: Int32, after: String? = nil, sortKey: BlogSortKeys? = nil, reverse: Bool? = nil, query: String? = nil, _ subfields: (BlogConnectionQuery) -> Void) -> ShopQuery { + open func blogs(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: BlogSortKeys? = nil, query: String? = nil, _ subfields: (BlogConnectionQuery) -> Void) -> ShopQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let query = query { args.append("query:\(GraphQL.quoteString(input: query))") } @@ -154,31 +178,43 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - query: Supported filter parameters: /// - `title` /// - `collection_type` /// - `updated_at` /// @discardableResult - open func collections(alias: String? = nil, first: Int32, after: String? = nil, sortKey: CollectionSortKeys? = nil, reverse: Bool? = nil, query: String? = nil, _ subfields: (CollectionConnectionQuery) -> Void) -> ShopQuery { + open func collections(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: CollectionSortKeys? = nil, query: String? = nil, _ subfields: (CollectionConnectionQuery) -> Void) -> ShopQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let query = query { args.append("query:\(GraphQL.quoteString(input: query))") } @@ -297,8 +333,10 @@ extension Storefront { /// - parameters: /// - first: No description /// - after: No description - /// - sortKey: No description + /// - last: No description + /// - before: No description /// - reverse: No description + /// - sortKey: No description /// - query: Supported filter parameters: /// - `title` /// - `product_type` @@ -308,23 +346,33 @@ extension Storefront { /// - `tag` /// @discardableResult - open func products(alias: String? = nil, first: Int32, after: String? = nil, sortKey: ProductSortKeys? = nil, reverse: Bool? = nil, query: String? = nil, _ subfields: (ProductConnectionQuery) -> Void) -> ShopQuery { + open func products(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, sortKey: ProductSortKeys? = nil, query: String? = nil, _ subfields: (ProductConnectionQuery) -> Void) -> ShopQuery { var args: [String] = [] - args.append("first:\(first)") + if let first = first { + args.append("first:\(first)") + } if let after = after { args.append("after:\(GraphQL.quoteString(input: after))") } - if let sortKey = sortKey { - args.append("sortKey:\(sortKey.rawValue)") + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") } if let reverse = reverse { args.append("reverse:\(reverse)") } + if let sortKey = sortKey { + args.append("sortKey:\(sortKey.rawValue)") + } + if let query = query { args.append("query:\(GraphQL.quoteString(input: query))") } @@ -377,121 +425,121 @@ extension Storefront { switch fieldName { case "articles": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try ArticleConnection(fields: value) case "blogs": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try BlogConnection(fields: value) case "cardVaultUrl": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return URL(string: value)! case "collectionByHandle": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try Collection(fields: value) case "collections": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try CollectionConnection(fields: value) case "currencyCode": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return CurrencyCode(rawValue: value) ?? .unknownValue case "description": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return value case "moneyFormat": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return value case "name": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return value case "paymentSettings": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try PaymentSettings(fields: value) case "primaryDomain": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try Domain(fields: value) case "privacyPolicy": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try ShopPolicy(fields: value) case "productByHandle": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try Product(fields: value) case "productTypes": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try StringConnection(fields: value) case "products": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try ProductConnection(fields: value) case "refundPolicy": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try ShopPolicy(fields: value) case "shopifyPaymentsAccountId": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return value case "termsOfService": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } return try ShopPolicy(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Shop.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/ShopPolicy.swift b/Buy/Generated/Storefront/ShopPolicy.swift index 287a9bf0..e939d90f 100644 --- a/Buy/Generated/Storefront/ShopPolicy.swift +++ b/Buy/Generated/Storefront/ShopPolicy.swift @@ -71,30 +71,30 @@ extension Storefront { switch fieldName { case "body": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShopPolicy.self, field: fieldName, value: fieldValue) } return value case "id": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShopPolicy.self, field: fieldName, value: fieldValue) } return GraphQL.ID(rawValue: value) case "title": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShopPolicy.self, field: fieldName, value: fieldValue) } return value case "url": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShopPolicy.self, field: fieldName, value: fieldValue) } return URL(string: value)! default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ShopPolicy.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/StringConnection.swift b/Buy/Generated/Storefront/StringConnection.swift index 28916ed3..1bb9f550 100644 --- a/Buy/Generated/Storefront/StringConnection.swift +++ b/Buy/Generated/Storefront/StringConnection.swift @@ -59,18 +59,18 @@ extension Storefront { switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringConnection.self, field: fieldName, value: fieldValue) } return try value.map { return try StringEdge(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringConnection.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/StringEdge.swift b/Buy/Generated/Storefront/StringEdge.swift index c0ce6173..7352af82 100644 --- a/Buy/Generated/Storefront/StringEdge.swift +++ b/Buy/Generated/Storefront/StringEdge.swift @@ -53,18 +53,18 @@ extension Storefront { switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringEdge.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: StringEdge.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/TokenizedPaymentInput.swift b/Buy/Generated/Storefront/TokenizedPaymentInput.swift index 815a03a6..a30dd857 100644 --- a/Buy/Generated/Storefront/TokenizedPaymentInput.swift +++ b/Buy/Generated/Storefront/TokenizedPaymentInput.swift @@ -49,10 +49,10 @@ extension Storefront { open var paymentData: String /// Executes the payment in test mode if possible. Defaults to `false`. - open var test: Bool? + open var test: Input /// Public Hash Key used for AndroidPay payments only. - open var identifier: String? + open var identifier: Input /// Creates the input object. /// @@ -65,7 +65,11 @@ extension Storefront { /// - test: Executes the payment in test mode if possible. Defaults to `false`. /// - identifier: Public Hash Key used for AndroidPay payments only. /// - public init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, type: String, paymentData: String, test: Bool? = nil, identifier: String? = nil) { + public static func create(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, type: String, paymentData: String, test: Input = .undefined, identifier: Input = .undefined) -> TokenizedPaymentInput { + return TokenizedPaymentInput(amount: amount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, type: type, paymentData: paymentData, test: test, identifier: identifier) + } + + private init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, type: String, paymentData: String, test: Input = .undefined, identifier: Input = .undefined) { self.amount = amount self.idempotencyKey = idempotencyKey self.billingAddress = billingAddress @@ -75,6 +79,22 @@ extension Storefront { self.identifier = identifier } + /// Creates the input object. + /// + /// - parameters: + /// - amount: The amount of the payment. + /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + /// - billingAddress: The billing address for the payment. + /// - type: The type of payment token. + /// - paymentData: A simple string or JSON containing the required payment data for the tokenized payment. + /// - test: Executes the payment in test mode if possible. Defaults to `false`. + /// - identifier: Public Hash Key used for AndroidPay payments only. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(amount: Decimal, idempotencyKey: String, billingAddress: MailingAddressInput, type: String, paymentData: String, test: Bool? = nil, identifier: String? = nil) { + self.init(amount: amount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, type: type, paymentData: paymentData, test: test.orNull, identifier: identifier.orNull) + } + internal func serialize() -> String { var fields: [String] = [] @@ -88,12 +108,24 @@ extension Storefront { fields.append("paymentData:\(GraphQL.quoteString(input: paymentData))") - if let test = test { + switch test { + case .value(let test): + guard let test = test else { + fields.append("test:null") + break + } fields.append("test:\(test)") + case .undefined: break } - if let identifier = identifier { + switch identifier { + case .value(let identifier): + guard let identifier = identifier else { + fields.append("identifier:null") + break + } fields.append("identifier:\(GraphQL.quoteString(input: identifier))") + case .undefined: break } return "{\(fields.joined(separator: ","))}" diff --git a/Buy/Generated/Storefront/Transaction.swift b/Buy/Generated/Storefront/Transaction.swift index 7ae63b54..4bab6f84 100644 --- a/Buy/Generated/Storefront/Transaction.swift +++ b/Buy/Generated/Storefront/Transaction.swift @@ -69,30 +69,30 @@ extension Storefront { switch fieldName { case "amount": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) } return Decimal(string: value, locale: GraphQL.posixLocale) case "kind": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) } return TransactionKind(rawValue: value) ?? .unknownValue case "status": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) } return TransactionStatus(rawValue: value) ?? .unknownValue case "test": guard let value = value as? Bool else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) } } diff --git a/Buy/Generated/Storefront/UserError.swift b/Buy/Generated/Storefront/UserError.swift index ece07d69..5a3ca960 100644 --- a/Buy/Generated/Storefront/UserError.swift +++ b/Buy/Generated/Storefront/UserError.swift @@ -56,18 +56,18 @@ extension Storefront { case "field": if value is NSNull { return nil } guard let value = value as? [String] else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserError.self, field: fieldName, value: fieldValue) } return value.map { return $0 } case "message": guard let value = value as? String else { - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserError.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: type(of: self), field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserError.self, field: fieldName, value: fieldValue) } } diff --git a/Dependencies/Swift Gen b/Dependencies/Swift Gen index 9329858e..674542f2 160000 --- a/Dependencies/Swift Gen +++ b/Dependencies/Swift Gen @@ -1 +1 @@ -Subproject commit 9329858e6e3c622f03d001bb435e0862dd708aad +Subproject commit 674542f2aeda8fb1e8e629fbabc825bd22e004bb diff --git a/Mobile-Buy-SDK.podspec b/Mobile-Buy-SDK.podspec index 34c039fa..66cdfbd9 100644 --- a/Mobile-Buy-SDK.podspec +++ b/Mobile-Buy-SDK.podspec @@ -1,14 +1,18 @@ Pod::Spec.new do |s| s.name = 'Mobile-Buy-SDK' - s.version = '3.0.8' + s.version = '3.1.0' s.summary = 'Create custom Shopify storefront on iOS.' s.description = 'Shopify’s Mobile Buy SDK makes it simple to create custom storefronts in your mobile app. Utitlizing the power and flexibility of GraphQL you can build native storefront experiences using the Shopify platform.' s.homepage = 'https://github.com/Shopify/mobile-buy-sdk-ios' s.author = 'Shopify Inc.' - s.platform = :ios, '10.0' s.module_name = 'MobileBuySDK' s.requires_arc = true + s.platforms = { + :ios => '10.0', + :watchos => '3.1', + :tvos => '9.0' + } s.license = { :type => 'MIT', @@ -21,7 +25,10 @@ Pod::Spec.new do |s| :submodules => true } - s.source_files = 'Buy/**/*.{h,m,c,swift}', 'Pay/**/*.{swift}', 'Dependencies/Swift Gen/support/Sources/GraphQL.swift' + s.source_files = 'Buy/**/*.{h,m,c,swift}', 'Dependencies/Swift Gen/support/Sources/GraphQL.swift' + s.ios.source_files = 'Pay/**/*.{swift}' + s.watchos.source_files = 'Pay/**/*.{swift}' + s.xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) COCOAPODS=1' } diff --git a/Pay/PaySession.swift b/Pay/PaySession.swift index 04011489..d3cb65f2 100644 --- a/Pay/PaySession.swift +++ b/Pay/PaySession.swift @@ -189,6 +189,14 @@ extension PaySession: PKPaymentAuthorizationControllerDelegate { // ------------------------------------------------------- // MARK: - PKPaymentAuthorizationControllerDelegate - // + @available(iOS 11.0, *) + public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) { + self.paymentAuthorizationController(controller, didAuthorizePayment: payment) { (status: PKPaymentAuthorizationStatus) in + let result = PKPaymentAuthorizationResult(status: status, errors: nil) + completion(result) + } + } + public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { var shippingRate: PayShippingRate? @@ -220,6 +228,16 @@ extension PaySession: PKPaymentAuthorizationControllerDelegate { } }) } + + @available(iOS 11.0, *) + public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { + + self.paymentAuthorizationController(controller, didSelectShippingContact: contact) { status, shippingMethod, summaryItems in + let result = PKPaymentRequestShippingContactUpdate(errors: nil, paymentSummaryItems: summaryItems, shippingMethods: shippingMethod) + result.status = status + completion(result) + } + } public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) { Log("Selecting shipping contact...") @@ -293,6 +311,15 @@ extension PaySession: PKPaymentAuthorizationControllerDelegate { }) }) } + + @available(iOS 11.0, *) + public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { + self.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod) { status, summaryItems in + let result = PKPaymentRequestShippingMethodUpdate(paymentSummaryItems: summaryItems) + result.status = status + completion(result) + } + } public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) { Log("Selecting delivery method...") diff --git a/PayTests/Mocks/MockAuthorizationController.swift b/PayTests/Mocks/MockAuthorizationController.swift index 3a219f2c..a80ab770 100644 --- a/PayTests/Mocks/MockAuthorizationController.swift +++ b/PayTests/Mocks/MockAuthorizationController.swift @@ -60,7 +60,7 @@ final class MockAuthorizationController: PKPaymentAuthorizationController { static func invokeDidAuthorizePayment(_ payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController(authorizationController, didAuthorizePayment: payment, completion: completion) + authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didAuthorizePayment: payment, completion: completion) } } @@ -83,4 +83,31 @@ final class MockAuthorizationController: PKPaymentAuthorizationController { authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectPaymentMethod: paymentMethod, completion: completion) } } + + // ---------------------------------- + // MARK: - iOS 11 - + // + @available(iOS 11.0, *) + static func invokeDidAuthorizePaymentHandler(_ payment: PKPayment, handler: @escaping (PKPaymentAuthorizationResult) -> Void) { + + self.instances.forEach { authorizationController in + authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didAuthorizePayment: payment, handler: handler) + } + } + + @available(iOS 11.0, *) + static func invokeDidSelectShippingContactHandler(_ contact: PKContact, handler: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { + + self.instances.forEach { authorizationController in + authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingContact: contact, handler: handler) + } + } + + @available(iOS 11.0, *) + static func invokeDidSelectShippingMethodHandler(_ shippingMethod: PKShippingMethod, handler: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { + + self.instances.forEach { authorizationController in + authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingMethod: shippingMethod, handler: handler) + } + } } diff --git a/PayTests/Mocks/MockPaySession.swift b/PayTests/Mocks/MockPaySession.swift new file mode 100644 index 00000000..0a1a9268 --- /dev/null +++ b/PayTests/Mocks/MockPaySession.swift @@ -0,0 +1,76 @@ +// +// MockPaySession.swift +// PayTests +// +// Created by Dima Bart on 2017-09-20. +// Copyright © 2017 Shopify Inc. All rights reserved. +// + +import Foundation +import PassKit +@testable import Pay + +@available(iOS 11.0, *) +class MockPaySession: PaySession { + + enum Status { + case handled + case unhandled + } + + // ---------------------------------- + // MARK: - iOS 11 - + // + var didSelectShippingContactHandler: ((PKPaymentAuthorizationController, PKContact, @escaping (PKPaymentRequestShippingContactUpdate) -> Void) -> Status)? + var didSelectShippingMethodHandler: ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) -> Status)? + var didAuthorizePaymentHandler: ((PKPaymentAuthorizationController, PKPayment, @escaping (PKPaymentAuthorizationResult) -> Void) -> Status)? + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { + let status = self.didSelectShippingContactHandler?(controller, contact, handler) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didSelectShippingContact: contact, handler: handler) + } + } + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { + let status = self.didSelectShippingMethodHandler?(controller, shippingMethod, handler) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod, handler: handler) + } + } + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler: @escaping (PKPaymentAuthorizationResult) -> Void) { + let status = self.didAuthorizePaymentHandler?(controller, payment, handler) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didAuthorizePayment: payment, handler: handler) + } + } + + // ---------------------------------- + // MARK: - Delegate Callbacks - + // + var didSelectShippingContact: ((PKPaymentAuthorizationController, PKContact, @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) -> Status)? + var didSelectShippingMethod: ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) -> Status)? + var didAuthorizePayment: ((PKPaymentAuthorizationController, PKPayment, @escaping (PKPaymentAuthorizationStatus) -> Void) -> Status)? + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) { + let status = self.didSelectShippingContact?(controller, contact, completion) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didSelectShippingContact: contact, completion: completion) + } + } + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) { + let status = self.didSelectShippingMethod?(controller, shippingMethod, completion) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod, completion: completion) + } + } + + override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { + let status = self.didAuthorizePayment?(controller, payment, completion) ?? .unhandled + if status == .unhandled { + super.paymentAuthorizationController(controller, didAuthorizePayment: payment, completion: completion) + } + } +} diff --git a/PayTests/Models/Models.swift b/PayTests/Models/Models.swift index 1ac22b95..20a72da9 100644 --- a/PayTests/Models/Models.swift +++ b/PayTests/Models/Models.swift @@ -28,6 +28,7 @@ import Foundation import PassKit import Pay +@available(iOS 11.0, *) struct Models { static func createShippingMethod(identifier: String? = nil) -> PKShippingMethod { @@ -65,8 +66,8 @@ struct Models { // ---------------------------------- // MARK: - Pay Models - // - static func createSession(checkout: PayCheckout, currency: PayCurrency) -> PaySession { - return PaySession(checkout: checkout, currency: currency, merchantID: "com.merchant.identifier", controllerType: MockAuthorizationController.self) + static func createSession(checkout: PayCheckout, currency: PayCurrency) -> MockPaySession { + return MockPaySession(checkout: checkout, currency: currency, merchantID: "com.merchant.identifier", controllerType: MockAuthorizationController.self) } static func createDiscount() -> PayDiscount { diff --git a/PayTests/PayAddressTests.swift b/PayTests/PayAddressTests.swift index a82a07e5..0f37cb9c 100644 --- a/PayTests/PayAddressTests.swift +++ b/PayTests/PayAddressTests.swift @@ -28,6 +28,7 @@ import XCTest import PassKit @testable import Pay +@available(iOS 11.0, *) class PayAddressTests: XCTestCase { // ---------------------------------- diff --git a/PayTests/PayAuthorizationTests.swift b/PayTests/PayAuthorizationTests.swift index acf3d6c2..021c7aa5 100644 --- a/PayTests/PayAuthorizationTests.swift +++ b/PayTests/PayAuthorizationTests.swift @@ -27,6 +27,7 @@ import XCTest @testable import Pay +@available(iOS 11.0, *) class PayAuthorizationTests: XCTestCase { // ---------------------------------- diff --git a/PayTests/PayCheckoutTests.swift b/PayTests/PayCheckoutTests.swift index cf7c846f..de11f73b 100644 --- a/PayTests/PayCheckoutTests.swift +++ b/PayTests/PayCheckoutTests.swift @@ -27,6 +27,7 @@ import XCTest @testable import Pay +@available(iOS 11.0, *) class PayCheckoutTests: XCTestCase { // ---------------------------------- diff --git a/PayTests/PaySessionTests.swift b/PayTests/PaySessionTests.swift index 36681908..29e31ec2 100644 --- a/PayTests/PaySessionTests.swift +++ b/PayTests/PaySessionTests.swift @@ -28,6 +28,7 @@ import XCTest import PassKit @testable import Pay +@available(iOS 11.0, *) class PaySessionTests: XCTestCase { // ---------------------------------- @@ -246,7 +247,6 @@ class PaySessionTests: XCTestCase { let shippingContact = Models.createContact() let shippingAddress = Models.createAddress() - let shippingRate = Models.createShippingRate() let addressCheckout = Models.createCheckout(requiresShipping: false, shippingAddress: shippingAddress) let e1 = self.expectation(description: "") @@ -453,6 +453,116 @@ class PaySessionTests: XCTestCase { self.wait(for: [expectation], timeout: 10) } + // ---------------------------------- + // MARK: - iOS 11 Support - + // + @available(iOS 11.0, *) + func testSessionForwardsShippingContact() { + let checkout = Models.createCheckout(requiresShipping: true) + let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) + + let shippingContact = Models.createContact() + let shippingMethods = [Models.createShippingMethod()] + let summaryItems = checkout.summaryItems + + let e2 = self.expectation(description: "") + session.didSelectShippingContactHandler = { controller, contact, handler in + XCTAssertTrue(contact === shippingContact) + e2.fulfill() + return .unhandled + } + + let e1 = self.expectation(description: "") + session.didSelectShippingContact = { controller, contact, completion in + completion(.success, shippingMethods, summaryItems) + e1.fulfill() + return .handled + } + + session.authorize() + + let e3 = self.expectation(description: "") + MockAuthorizationController.invokeDidSelectShippingContactHandler(shippingContact) { result in + + XCTAssertEqual(result.status, .success) + XCTAssertEqual(result.shippingMethods, shippingMethods) + XCTAssertEqual(result.paymentSummaryItems, summaryItems) + + e3.fulfill() + } + + self.wait(for: [e1, e2, e3], timeout: 2.0) + } + + @available(iOS 11.0, *) + func testSessionForwardsShippingMethod() { + + let shippingMethod = Models.createShippingMethod() + let checkout = Models.createCheckout(requiresShipping: true, shippingRate: Models.createShippingRate()) + let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) + let summaryItems = checkout.summaryItems + + let e2 = self.expectation(description: "") + session.didSelectShippingMethodHandler = { controller, method, handler in + XCTAssertTrue(method === shippingMethod) + e2.fulfill() + return .unhandled + } + + let e1 = self.expectation(description: "") + session.didSelectShippingMethod = { controller, shippingMethod, completion in + completion(.success, summaryItems) + e1.fulfill() + return .handled + } + + session.authorize() + + let e3 = self.expectation(description: "") + MockAuthorizationController.invokeDidSelectShippingMethodHandler(shippingMethod) { result in + XCTAssertEqual(result.status, .success) + XCTAssertEqual(result.paymentSummaryItems, summaryItems) + e3.fulfill() + } + + self.wait(for: [e1, e2, e3], timeout: 2.0) + } + + @available(iOS 11.0, *) + func testSessionForwardsAuthorizedPayment() { + + let checkout = Models.createCheckout(requiresShipping: true, shippingRate: Models.createShippingRate()) + let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) + + let method = MockPaymentMethod(displayName: "Test Payment", network: .amex, type: .credit) + let token = MockPaymentToken(paymentMethod: method) + let payment = MockPayment(token: token) + + let e2 = self.expectation(description: "") + session.didAuthorizePaymentHandler = { controller, currentPayment, handler in + XCTAssertTrue(currentPayment === payment) + e2.fulfill() + return .unhandled + } + + let e1 = self.expectation(description: "") + session.didAuthorizePayment = { controller, payment, completion in + completion(.success) + e1.fulfill() + return .handled + } + + session.authorize() + + let e3 = self.expectation(description: "") + MockAuthorizationController.invokeDidAuthorizePaymentHandler(payment) { result in + XCTAssertEqual(result.status, .success) + e3.fulfill() + } + + self.wait(for: [e1, e2, e3], timeout: 2.0) + } + // ---------------------------------- // MARK: - Session Delegate - // diff --git a/PayTests/PayShippingRateTests.swift b/PayTests/PayShippingRateTests.swift index 3d75b4a9..a2908242 100644 --- a/PayTests/PayShippingRateTests.swift +++ b/PayTests/PayShippingRateTests.swift @@ -28,6 +28,7 @@ import XCTest import PassKit @testable import Pay +@available(iOS 11.0, *) class PayShippingRateTests: XCTestCase { // ---------------------------------- diff --git a/README.md b/README.md index bfdc9f30..5220b017 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Mobile Buy SDK](https://cloud.githubusercontent.com/assets/5244861/26374751/6895a582-3fd4-11e7-80c4-2c1632262d66.png) -[![Build Status](https://travis-ci.org/Shopify/mobile-buy-sdk-ios.svg?branch=master)](https://travis-ci.org/Shopify/mobile-buy-sdk-ios) +[![CircleCI](https://circleci.com/gh/Shopify/mobile-buy-sdk-ios.svg?style=shield)](https://circleci.com/gh/Shopify/mobile-buy-sdk-ios) [![GitHub release](https://img.shields.io/github/release/shopify/mobile-buy-sdk-ios.svg?style=flat)](https://github.com/Shopify/mobile-buy-sdk-ios/releases/latest) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/Shopify/mobile-buy-sdk-ios/blob/master/LICENSE) @@ -72,6 +72,7 @@ The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app - [Customer information](#customer-information-) - [Customer Addresses](#customer-addresses-) - [Customer Orders](#customer-orders-) + - [Customer Update](#customer-update-) - [Sample application](#sample-application-) - [Contributions](#contributions-) @@ -336,7 +337,7 @@ The following example shows how you can reset a customer's password using a reco ```swift let customerID = GraphQL.ID(rawValue: "YSBjdXN0b21lciBpZA") -let input = Storefront.CustomerResetInput(resetToken: "c29tZSB0b2tlbiB2YWx1ZQ", password: "abc123") +let input = Storefront.CustomerResetInput.create(resetToken: "c29tZSB0b2tlbiB2YWx1ZQ", password: "abc123") let mutation = Storefront.buildMutation { $0 .customerReset(id: customerID, input: input) { $0 .customer { $0 @@ -1016,11 +1017,11 @@ After browsing products and collections, a customer might eventually want to pur Almost every `mutation` request requires an input object. This is the object that dictates what fields will be mutated for a particular resource. In this case, we'll need to create a `Storefront.CheckoutCreateInput`: ```swift -let input = Storefront.CheckoutCreateInput( - lineItems: [ - Storefront.CheckoutLineItemInput(variantId: GraphQL.ID(rawValue: "mFyaWFu"), quantity: 5), - Storefront.CheckoutLineItemInput(variantId: GraphQL.ID(rawValue: "8vc2hGl"), quantity: 3), - ] +let input = Storefront.CheckoutCreateInput.create( + lineItems: .value([ + Storefront.CheckoutLineItemInput.create(variantId: GraphQL.ID(rawValue: "mFyaWFu"), quantity: 5), + Storefront.CheckoutLineItemInput.create(variantId: GraphQL.ID(rawValue: "8vc2hGl"), quantity: 3), + ]) ) ``` @@ -1160,7 +1161,7 @@ After obtaining a credit card vault token, we can proceed to complete the checko // let payCheckout: PayCheckout // let payAuthorization: PayAuthorization -let payment = Storefront.CreditCardPaymentInput( +let payment = Storefront.CreditCardPaymentInput.create( amount: payCheckout.paymentDue, idempotencyKey: paySession.identifier, billingAddress: self.mailingAddressInputFrom(payAuthorization.billingAddress, @@ -1214,7 +1215,7 @@ The Buy SDK makes  Pay integration easy with the provided `Pay.framework`. To // let payCheckout: PayCheckout // let payAuthorization: PayAuthorization -let payment = Storefront.TokenizedPaymentInput( +let payment = Storefront.TokenizedPaymentInput.create( amount: payCheckout.paymentDue, idempotencyKey: paySession.identifier, billingAddress: self.mailingAddressInputFrom(payAuthorization.billingAddress), // <- perform the conversion @@ -1322,12 +1323,12 @@ Using the Buy SDK, you can build custom storefronts that let your customers crea Before a customer can log in, they must first create an account. In your application, you can provide a sign-up form that runs the following `mutation` request. In this example, the `input` for the mutation is some basic customer information that will create an account on your shop. ```swift -let input = Storefront.CustomerCreateInput( - email: "john.smith@gmail.com", - password: "123456", - firstName: "John", - lastName: "Smith", - acceptsMarketing: true +let input = Storefront.CustomerCreateInput.create( + email: .value("john.smith@gmail.com"), + password: .value("123456"), + firstName: .value("John"), + lastName: .value("Smith"), + acceptsMarketing: .value(true) ) let mutation = Storefront.buildMutation { $0 @@ -1353,7 +1354,7 @@ Keep in mind that this mutation returns a `Storefront.Customer` object, **not** Any customer who has an account can log in to your shop. All log-in operations are `mutation` requests that exchange customer credentials for an access token. You can log in your customers using the `customerAccessTokenCreate` mutation. Keep in mind that the return access token will eventually expire. The expiry `Date` is provided by the `expiresAt` property of the returned payload. ```swift -let input = Storefront.CustomerAccessTokenCreateInput( +let input = Storefront.CustomerAccessTokenCreateInput.create( email: "john.smith@gmail.com", password: "123456" ) @@ -1400,16 +1401,16 @@ You can create, update, and delete addresses on the customer's behalf using the The following example shows a mutation for creating an address: ```swift -let input = Storefront.MailingAddressInput( - address1: "80 Spadina Ave.", - address2: "Suite 400", - city: "Toronto", - country: "Canada", - firstName: "John", - lastName: "Smith", - phone: "1-123-456-7890", - province: "ON", - zip: "M5V 2J4" +let input = Storefront.MailingAddressInput.create( + address1: .value("80 Spadina Ave."), + address2: .value("Suite 400"), + city: .value("Toronto"), + country: .value("Canada"), + firstName: .value("John"), + lastName: .value("Smith"), + phone: .value("1-123-456-7890"), + province: .value("ON"), + zip: .value("M5V 2J4") ) let mutation = Storefront.buildMutation { $0 @@ -1486,6 +1487,56 @@ let query = Storefront.buildQuery { $0 } ``` +#### Customer Update [⤴](#table-of-contents) + +Input objects, like `Storefront.MailingAddressInput`, use `Input` (where `T` is the type of value) to represent optional fields and distinguish `nil` values from `undefined` values (eg. `phone: Input`). + +The following example uses `Storefront.CustomerUpdateInput` to show how to update a customer's phone number: + +```swift +let input = Storefront.CustomerUpdateInput( + phone: .value("+16471234567") +) +``` + +In this example, you create an input object by setting the `phone` field to the new phone number that you want to update the field with. Notice that you need to pass in an `Input.value()` instead of a simple string containing the phone number. + +The `Storefront.CustomerUpdateInput` object also includes other fields besides the `phone` field. These fields all default to a value of `.undefined` if you don't specify them otherwise. This means that the fields aren't serialized in the mutation, and will be omitted entirely. The result looks like this: + +```graphql +mutation { + customerUpdate(customer: { + phone: "+16471234567" + }, customerAccessToken: "...") { + customer { + phone + } + } +} +``` + +This approach works well for setting a new phone number or updating an existing phone number to a new value. But what if the customer wants to remove the phone number completely? Leaving the phone number blank or sending an empty string are semantically different and won't achieve the intended result. The former approach indicates that we didn't define a value, and the latter returns an invalid phone number error. This is where the `Input` is especially useful. You can use it to signal the intention to remove a phone number by specifying a `nil` value: + +```swift +let input = Storefront.CustomerUpdateInput( + phone: .value(nil) +) +``` + +The result is a mutation that updates a customer's phone number to `null`. + +```graphql +mutation { + customerUpdate(customer: { + phone: null + }, customerAccessToken: "...") { + customer { + phone + } + } +} +``` + ## Sample application [⤴](#table-of-contents) The Buy SDK includes a comprehensive sample application that covers the most common use cases of the SDK. It's built on best practices and our recommended `ViewModel` architecture. You can use it as a template, a starting point, or a place to cherrypick components as needed. Check out the [Storefront readme](/Sample%20Apps/Storefront/) for more details. diff --git a/Sample Apps/Storefront/Storefront.xcodeproj/project.pbxproj b/Sample Apps/Storefront/Storefront.xcodeproj/project.pbxproj index 00675a85..9c90b52e 100644 --- a/Sample Apps/Storefront/Storefront.xcodeproj/project.pbxproj +++ b/Sample Apps/Storefront/Storefront.xcodeproj/project.pbxproj @@ -122,6 +122,20 @@ remoteGlobalIDString = 9AFA38EA1E64850A0056C5AA; remoteInfo = BuyTests; }; + 9AFEF4671F72A7CC003FA8C5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9AEF61BF1E606C710067FA90 /* Buy.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9AC2EFC81F6818180037E0D7; + remoteInfo = "Buy watchOS"; + }; + 9AFEF4691F72A7CC003FA8C5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9AEF61BF1E606C710067FA90 /* Buy.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9AF256421F6FEE50005BB0C9; + remoteInfo = "Buy tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -493,8 +507,10 @@ isa = PBXGroup; children = ( 9AEF61C41E606C710067FA90 /* Buy.framework */, - 9AFA3B7B1E6DB6FE0056C5AA /* BuyTests.xctest */, + 9AFEF4681F72A7CC003FA8C5 /* Buy.framework */, + 9AFEF46A1F72A7CC003FA8C5 /* Buy.framework */, 9A4069021E8E76AB000254CD /* Pay.framework */, + 9AFA3B7B1E6DB6FE0056C5AA /* BuyTests.xctest */, 9A4069041E8E76AB000254CD /* PayTests.xctest */, ); name = Products; @@ -618,6 +634,20 @@ remoteRef = 9AFA3B7A1E6DB6FE0056C5AA /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 9AFEF4681F72A7CC003FA8C5 /* Buy.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Buy.framework; + remoteRef = 9AFEF4671F72A7CC003FA8C5 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 9AFEF46A1F72A7CC003FA8C5 /* Buy.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Buy.framework; + remoteRef = 9AFEF4691F72A7CC003FA8C5 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -840,7 +870,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.buysdk.storefront; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -854,7 +884,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.shopify.buysdk.storefront; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Sample Apps/Storefront/Storefront.xcodeproj/xcshareddata/xcschemes/Storefront.xcscheme b/Sample Apps/Storefront/Storefront.xcodeproj/xcshareddata/xcschemes/Storefront.xcscheme index 97725387..64c19595 100644 --- a/Sample Apps/Storefront/Storefront.xcodeproj/xcshareddata/xcschemes/Storefront.xcscheme +++ b/Sample Apps/Storefront/Storefront.xcodeproj/xcshareddata/xcschemes/Storefront.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Sample Apps/Storefront/Storefront/CartButton.swift b/Sample Apps/Storefront/Storefront/CartButton.swift index d340071e..ebae07bc 100644 --- a/Sample Apps/Storefront/Storefront/CartButton.swift +++ b/Sample Apps/Storefront/Storefront/CartButton.swift @@ -82,7 +82,7 @@ class CartButton: UIBarButtonItem { NotificationCenter.default.removeObserver(self) } - private dynamic func itemCountDidChange(_ notification: Notification) { + @objc private func itemCountDidChange(_ notification: Notification) { self.updateBadgeCount(animated: true) print("Badge count change notification received") } @@ -113,7 +113,7 @@ class CartButton: UIBarButtonItem { // ---------------------------------- // MARK: - Actions - // - dynamic private func cartAction(_ sender: Any) { + @objc private func cartAction(_ sender: Any) { if let target = self.target, let selector = self.action { @@ -300,7 +300,7 @@ private class BadgeView: UIView { private func initialize() { self.clipsToBounds = true - self.backgroundColor = UIColor(colorLiteralRed: 0.9372, green: 0.3372, blue: 0.2156, alpha: 1.0).withAlphaComponent(0.9) + self.backgroundColor = #colorLiteral(red: 0.937254902, green: 0.337254902, blue: 0.2156862745, alpha: 1).withAlphaComponent(0.9) self.initLabel() } diff --git a/Sample Apps/Storefront/Storefront/CartViewController.swift b/Sample Apps/Storefront/Storefront/CartViewController.swift index 7644fcfe..c33ce791 100644 --- a/Sample Apps/Storefront/Storefront/CartViewController.swift +++ b/Sample Apps/Storefront/Storefront/CartViewController.swift @@ -96,7 +96,7 @@ class CartViewController: ParallaxViewController { NotificationCenter.default.removeObserver(self) } - private dynamic func cartControllerItemsDidChange(_ notification: Notification) { + @objc private func cartControllerItemsDidChange(_ notification: Notification) { self.updateSubtotal() } @@ -114,7 +114,7 @@ class CartViewController: ParallaxViewController { func openSafariFor(_ checkout: CheckoutViewModel) { let safari = SFSafariViewController(url: checkout.webURL) safari.navigationItem.title = "Checkout" - self.navigationController?.show(safari, sender: self) + self.navigationController?.present(safari, animated: true, completion: nil) } func authorizePaymentWith(_ checkout: CheckoutViewModel) { diff --git a/Sample Apps/Storefront/Storefront/ClientQuery.swift b/Sample Apps/Storefront/Storefront/ClientQuery.swift index c4cf3fdf..1fee7a23 100644 --- a/Sample Apps/Storefront/Storefront/ClientQuery.swift +++ b/Sample Apps/Storefront/Storefront/ClientQuery.swift @@ -78,12 +78,12 @@ final class ClientQuery { // static func mutationForCreateCheckout(with cartItems: [CartItem]) -> Storefront.MutationQuery { let lineItems = cartItems.map { item in - Storefront.CheckoutLineItemInput(variantId: GraphQL.ID(rawValue: item.variant.id), quantity: Int32(item.quantity)) + Storefront.CheckoutLineItemInput.create(quantity: Int32(item.quantity), variantId: GraphQL.ID(rawValue: item.variant.id)) } - let checkoutInput = Storefront.CheckoutCreateInput( - lineItems: lineItems, - allowPartialAddresses: true + let checkoutInput = Storefront.CheckoutCreateInput.create( + lineItems: .value(lineItems), + allowPartialAddresses: .value(true) ) return Storefront.buildMutation { $0 @@ -98,11 +98,11 @@ final class ClientQuery { static func mutationForUpdateCheckout(_ id: String, updatingPartialShippingAddress address: PayPostalAddress) -> Storefront.MutationQuery { let checkoutID = GraphQL.ID(rawValue: id) - let addressInput = Storefront.MailingAddressInput( - city: address.city, - country: address.country, - province: address.province, - zip: address.zip + let addressInput = Storefront.MailingAddressInput.create( + city: address.city.orNull, + country: address.country.orNull, + province: address.province.orNull, + zip: address.zip.orNull ) return Storefront.buildMutation { $0 @@ -121,16 +121,16 @@ final class ClientQuery { static func mutationForUpdateCheckout(_ id: String, updatingCompleteShippingAddress address: PayAddress) -> Storefront.MutationQuery { let checkoutID = GraphQL.ID(rawValue: id) - let addressInput = Storefront.MailingAddressInput( - address1: address.addressLine1, - address2: address.addressLine2, - city: address.city, - country: address.country, - firstName: address.firstName, - lastName: address.lastName, - phone: address.phone, - province: address.province, - zip: address.zip + let addressInput = Storefront.MailingAddressInput.create( + address1: address.addressLine1.orNull, + address2: address.addressLine2.orNull, + city: address.city.orNull, + country: address.country.orNull, + firstName: address.firstName.orNull, + lastName: address.lastName.orNull, + phone: address.phone.orNull, + province: address.province.orNull, + zip: address.zip.orNull ) return Storefront.buildMutation { $0 @@ -178,18 +178,18 @@ final class ClientQuery { static func mutationForCompleteCheckoutUsingApplePay(_ checkout: PayCheckout, billingAddress: PayAddress, token: String, idempotencyToken: String) -> Storefront.MutationQuery { - let mailingAddress = Storefront.MailingAddressInput( - address1: billingAddress.addressLine1, - address2: billingAddress.addressLine2, - city: billingAddress.city, - country: billingAddress.country, - firstName: billingAddress.firstName, - lastName: billingAddress.lastName, - province: billingAddress.province, - zip: billingAddress.zip + let mailingAddress = Storefront.MailingAddressInput.create( + address1: billingAddress.addressLine1.orNull, + address2: billingAddress.addressLine2.orNull, + city: billingAddress.city.orNull, + country: billingAddress.country.orNull, + firstName: billingAddress.firstName.orNull, + lastName: billingAddress.lastName.orNull, + province: billingAddress.province.orNull, + zip: billingAddress.zip.orNull ) - let paymentInput = Storefront.TokenizedPaymentInput( + let paymentInput = Storefront.TokenizedPaymentInput.create( amount: checkout.paymentDue, idempotencyKey: idempotencyToken, billingAddress: mailingAddress, diff --git a/Sample Apps/Storefront/Storefront/ProductViewModel.swift b/Sample Apps/Storefront/Storefront/ProductViewModel.swift index 435bdf52..62e28749 100644 --- a/Sample Apps/Storefront/Storefront/ProductViewModel.swift +++ b/Sample Apps/Storefront/Storefront/ProductViewModel.swift @@ -49,7 +49,7 @@ final class ProductViewModel: ViewModel { self.cursor = model.cursor let variants = model.node.variants.edges.viewModels.sorted { - $0.0.price < $0.1.price + $0.price < $1.price } let lowestPrice = variants.first?.price diff --git a/Sample Apps/Storefront/Storefront/String+HTML.swift b/Sample Apps/Storefront/Storefront/String+HTML.swift index 6f8c3199..aa34e38b 100644 --- a/Sample Apps/Storefront/Storefront/String+HTML.swift +++ b/Sample Apps/Storefront/Storefront/String+HTML.swift @@ -39,9 +39,9 @@ extension String { let styledHTML = self.trimmingCharacters(in: CharacterSet.newlines).appending(style) let htmlData = styledHTML.data(using: .utf8)! - let options: [String: Any] = [ - NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType, - NSCharacterEncodingDocumentAttribute : String.Encoding.utf8.rawValue, + let options: [NSAttributedString.DocumentReadingOptionKey: Any] = [ + NSAttributedString.DocumentReadingOptionKey.documentType : NSAttributedString.DocumentType.html, + NSAttributedString.DocumentReadingOptionKey.characterEncoding : String.Encoding.utf8.rawValue, ] return try? NSAttributedString(data: htmlData, options: options, documentAttributes: nil) diff --git a/Sample Apps/Storefront/Storefront/SubtitleButton.swift b/Sample Apps/Storefront/Storefront/SubtitleButton.swift index d9c216bb..a8f2ac14 100644 --- a/Sample Apps/Storefront/Storefront/SubtitleButton.swift +++ b/Sample Apps/Storefront/Storefront/SubtitleButton.swift @@ -45,16 +45,16 @@ class SubtitleButton: RoundedButton { style.lineBreakMode = .byClipping let attributedTitle = NSMutableAttributedString(string: title, attributes: [ - NSFontAttributeName : currentFont, - NSParagraphStyleAttributeName : style, - NSForegroundColorAttributeName: currentColor - ]) + NSAttributedStringKey.font : currentFont, + NSAttributedStringKey.paragraphStyle : style, + NSAttributedStringKey.foregroundColor: currentColor + ]) let attributedSubtitle = NSAttributedString(string: "\n\(self.subtitle)", attributes: [ - NSFontAttributeName : UIFont(descriptor: currentFont.fontDescriptor, size: currentFont.pointSize * 0.6), - NSParagraphStyleAttributeName : style, - NSForegroundColorAttributeName: currentColor.withAlphaComponent(0.6) - ]) + NSAttributedStringKey.font : UIFont(descriptor: currentFont.fontDescriptor, size: currentFont.pointSize * 0.6), + NSAttributedStringKey.paragraphStyle : style, + NSAttributedStringKey.foregroundColor: currentColor.withAlphaComponent(0.6) + ]) attributedTitle.append(attributedSubtitle) diff --git a/Sample Apps/Storefront/Storefront/TotalsViewController.swift b/Sample Apps/Storefront/Storefront/TotalsViewController.swift index 9ac4d530..e4199192 100644 --- a/Sample Apps/Storefront/Storefront/TotalsViewController.swift +++ b/Sample Apps/Storefront/Storefront/TotalsViewController.swift @@ -76,7 +76,7 @@ class TotalsViewController: UIViewController { self.buttonStackView.addArrangedSubview(webCheckout) if PKPaymentAuthorizationController.canMakePayments() { - let applePay = PKPaymentButton(type: .buy, style: .black) + let applePay = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black) applePay.addTarget(self, action: #selector(applePayAction(_:)), for: .touchUpInside) self.buttonStackView.addArrangedSubview(applePay) } @@ -85,11 +85,11 @@ class TotalsViewController: UIViewController { // ---------------------------------- // MARK: - Actions - // - dynamic func webCheckoutAction(_ sender: Any) { + @objc func webCheckoutAction(_ sender: Any) { self.delegate?.totalsController(self, didRequestPaymentWith: .webCheckout) } - dynamic func applePayAction(_ sender: Any) { + @objc func applePayAction(_ sender: Any) { self.delegate?.totalsController(self, didRequestPaymentWith: .applePay) } } diff --git a/Scripts/test_buy_tv b/Scripts/test_buy_tv new file mode 100755 index 00000000..6c430a8a --- /dev/null +++ b/Scripts/test_buy_tv @@ -0,0 +1,9 @@ + #!/usr/bin/env bash + +set -ex +set -eo pipefail + +xcodebuild build \ +-project "Buy.xcodeproj" \ +-scheme "Buy tvOS" \ + | xcpretty -c diff --git a/Scripts/test_buy_watch b/Scripts/test_buy_watch new file mode 100755 index 00000000..588bedb1 --- /dev/null +++ b/Scripts/test_buy_watch @@ -0,0 +1,9 @@ + #!/usr/bin/env bash + +set -ex +set -eo pipefail + +xcodebuild build \ +-project "Buy.xcodeproj" \ +-scheme "Buy watchOS" \ + | xcpretty -c diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..742002dd --- /dev/null +++ b/circle.yml @@ -0,0 +1,17 @@ +machine: + xcode: + version: 9.0 + +checkout: + post: + - git submodule sync --recursive + - git submodule update --recursive --init + +test: + override: + - ./Scripts/test_buy + - ./Scripts/test_buy_tv + - ./Scripts/test_buy_watch + - ./Scripts/test_pay + - ./Scripts/test_sample + \ No newline at end of file