From 5e12b52bc4022400004c50f98067107574d2136b Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Fri, 26 Jan 2024 14:45:13 +0000 Subject: [PATCH] [Patch 0.10.1] Fix PixelEvent types (#120) * Add missing Codable type, clean comments on types * bump: patch --- CHANGELOG.md | 4 + README.md | 4 +- ShopifyCheckoutSheetKit.podspec | 2 +- .../ShopifyCheckoutSheetKit/PixelEvents.swift | 82 +------------------ 4 files changed, 9 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6678674..366bcd01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.10.1 - January 26, 2024 + +- Clean Web Pixel types - #120 (@markmur) + ## 0.10.0 - January 26, 2024 - Expose Web Pixel events via new `checkoutDidEmitWebPixelEvent` hook - #101, #103, #105, #107, #112 (@josemiguel-alvarez, @kiftio , @markmur) diff --git a/README.md b/README.md index 11b92c6e..afe268c3 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The SDK is an open-source [Swift Package library](https://www.swift.org/package- ```swift dependencies: [ - .package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "0.10.0") + .package(url: "https://github.com/Shopify/checkout-sheet-kit-swift", from: "0.10") ] ``` @@ -35,7 +35,7 @@ For more details on managing Swift Package dependencies in Xcode, please see [Ap #### CocoaPods ```ruby -pod "ShopifyCheckoutSheetKit", "~> 0.10.0" +pod "ShopifyCheckoutSheetKit", "~> 0.10" ``` For more information on CocoaPods, please see their [getting started guide](https://guides.cocoapods.org/using/getting-started.html). diff --git a/ShopifyCheckoutSheetKit.podspec b/ShopifyCheckoutSheetKit.podspec index 56ea21eb..7ece7dfb 100644 --- a/ShopifyCheckoutSheetKit.podspec +++ b/ShopifyCheckoutSheetKit.podspec @@ -1,5 +1,5 @@ Pod::Spec.new do |s| - s.version = "0.10.0" + s.version = "0.10.1" s.name = "ShopifyCheckoutSheetKit" s.summary = "Enables Swift apps to embed the Shopify's highest converting, customizable, one-page checkout." diff --git a/Sources/ShopifyCheckoutSheetKit/PixelEvents.swift b/Sources/ShopifyCheckoutSheetKit/PixelEvents.swift index 4fcf3398..52678b6a 100644 --- a/Sources/ShopifyCheckoutSheetKit/PixelEvents.swift +++ b/Sources/ShopifyCheckoutSheetKit/PixelEvents.swift @@ -53,7 +53,7 @@ public struct StandardEventData: Codable { /// This event represents any custom events emitted by partners or merchants via /// the `publish` method -public struct CustomEvent { +public struct CustomEvent: Codable { public let context: Context? public let customData: String? /// The ID of the customer event @@ -87,9 +87,6 @@ public struct Context: Codable { // MARK: - WebPixelsDocument -/// Snapshot of a subset of properties of the `document` object in the top -/// frame of the browser -/// /// A snapshot of a subset of properties of the `document` object in the top /// frame of the browser public struct WebPixelsDocument: Codable { @@ -109,13 +106,7 @@ public struct WebPixelsDocument: Codable { // MARK: - Location -/// Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document), -/// returns the URI of the current document -/// -/// A snapshot of a subset of properties of the `location` object in the top -/// frame of the browser -/// -/// Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window), the +/// Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), the /// location, or current URL, of the window object public struct Location: Codable { /// Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Location), a @@ -158,9 +149,6 @@ public struct Location: Codable { // MARK: - WebPixelsNavigator -/// Snapshot of a subset of properties of the `navigator` object in the top -/// frame of the browser -/// /// A snapshot of a subset of properties of the `navigator` object in the top /// frame of the browser public struct WebPixelsNavigator: Codable { @@ -183,9 +171,6 @@ public struct WebPixelsNavigator: Codable { // MARK: - WebPixelsWindow -/// Snapshot of a subset of properties of the `window` object in the top frame -/// of the browser -/// /// A snapshot of a subset of properties of the `window` object in the top frame /// of the browser public struct WebPixelsWindow: Codable { @@ -237,10 +222,6 @@ public struct WebPixelsWindow: Codable { // MARK: - Screen -/// Per [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen), the -/// interface representing a screen, usually the one on which the current -/// window is being rendered -/// /// The interface representing a screen, usually the one on which the current /// window is being rendered public struct Screen: Codable { @@ -254,26 +235,6 @@ public struct Screen: Codable { // MARK: - MoneyV2 -/// The total amount for the customer to pay. -/// -/// A monetary value with currency. -/// -/// The total cost of the merchandise line. -/// -/// The product variant’s price. -/// -/// The monetary value with currency allocated to the discount. -/// -/// Price of this shipping rate. -/// -/// The price at checkout before duties, shipping, and taxes. -/// -/// The sum of all the prices of all the items in the checkout, including -/// duties, taxes, and discounts. -/// -/// The sum of all the taxes applied to the line items and shipping lines in -/// the checkout. -/// /// The monetary value with currency allocated to the transaction method. public struct MoneyV2: Codable { /// The decimal money amount. @@ -299,9 +260,6 @@ public struct CartLine: Codable { // MARK: - CartLineCost -/// The cost of the merchandise that the customer will pay for at checkout. The -/// costs are subject to change and changes will be reflected at checkout. -/// /// The cost of the merchandise line that the customer will pay at checkout. public struct CartLineCost: Codable { /// The total cost of the merchandise line. @@ -310,8 +268,6 @@ public struct CartLineCost: Codable { // MARK: - ProductVariant -/// The merchandise that the buyer intends to purchase. -/// /// A product variant represents a different version of a product, such as /// differing sizes or differing colors. public struct ProductVariant: Codable { @@ -342,8 +298,6 @@ public struct Image: Codable { // MARK: - Product -/// The product object that the product variant belongs to. -/// /// A product is an individual item for sale in a Shopify store. public struct Product: Codable { /// The ID of the product. @@ -493,31 +447,6 @@ public struct DiscountApplication: Codable { // MARK: - Value -/// The value of the discount. Fixed discounts return a `Money` Object, while -/// Percentage discounts return a `PricingPercentageValue` object. -/// -/// The total amount for the customer to pay. -/// -/// A monetary value with currency. -/// -/// The total cost of the merchandise line. -/// -/// The product variant’s price. -/// -/// The monetary value with currency allocated to the discount. -/// -/// Price of this shipping rate. -/// -/// The price at checkout before duties, shipping, and taxes. -/// -/// The sum of all the prices of all the items in the checkout, including -/// duties, taxes, and discounts. -/// -/// The sum of all the taxes applied to the line items and shipping lines in -/// the checkout. -/// -/// The monetary value with currency allocated to the transaction method. -/// /// A value given to a customer when a discount is applied to an order. The /// application of a discount with this value gives the customer the specified /// percentage off a specified item. @@ -643,13 +572,6 @@ public struct PricingPercentageValue: Codable { let percentage: Double? } -// swiftlint:disable type_name -typealias ID = String -// swiftlint:enable type_name - -typealias Name = String -typealias Timestamp = String - // MARK: - Helper functions for creating encoders and decoders func newJSONDecoder() -> JSONDecoder {