From a2291dd39debf25f288bd735508b67460389d1dc Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 11 Dec 2025 08:38:36 -0800 Subject: [PATCH 1/9] Update the current list of formats and legalities. --- .../ScryfallKit/Extensions/Card+helpers.swift | 22 ++++++++++++ .../Models/Card/Card+Legalities.swift | 35 ++++++++++++++++++- Sources/ScryfallKit/Models/Enums.swift | 4 ++- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/Sources/ScryfallKit/Extensions/Card+helpers.swift b/Sources/ScryfallKit/Extensions/Card+helpers.swift index 262eb52..cc6d27b 100644 --- a/Sources/ScryfallKit/Extensions/Card+helpers.swift +++ b/Sources/ScryfallKit/Extensions/Card+helpers.swift @@ -34,6 +34,28 @@ extension Card { return legalities.penny ?? .notLegal case .commander: return legalities.commander ?? .notLegal + case .future: + return legalities.future ?? .notLegal + case .timeless: + return legalities.timeless ?? .notLegal + case .gladiator: + return legalities.gladiator ?? .notLegal + case .oathbreaker: + return legalities.oathbreaker ?? .notLegal + case .standardbrawl: + return legalities.standardbrawl ?? .notLegal + case .alchemy: + return legalities.alchemy ?? .notLegal + case .paupercommander: + return legalities.paupercommander ?? .notLegal + case .duel: + return legalities.duel ?? .notLegal + case .oldschool: + return legalities.oldschool ?? .notLegal + case .premodern: + return legalities.premodern ?? .notLegal + case .predh: + return legalities.predh ?? .notLegal } } diff --git a/Sources/ScryfallKit/Models/Card/Card+Legalities.swift b/Sources/ScryfallKit/Models/Card/Card+Legalities.swift index 94247d5..14ae015 100644 --- a/Sources/ScryfallKit/Models/Card/Card+Legalities.swift +++ b/Sources/ScryfallKit/Models/Card/Card+Legalities.swift @@ -17,6 +17,17 @@ extension Card { public let penny: Legality? public let commander: Legality? public let brawl: Legality? + public let future: Legality? + public let timeless: Legality? + public let gladiator: Legality? + public let oathbreaker: Legality? + public let standardbrawl: Legality? + public let alchemy: Legality? + public let paupercommander: Legality? + public let duel: Legality? + public let oldschool: Legality? + public let premodern: Legality? + public let predh: Legality? public init( standard: Legality?, @@ -28,7 +39,18 @@ extension Card { vintage: Legality?, penny: Legality?, commander: Legality?, - brawl: Legality? + brawl: Legality?, + future: Legality?, + timeless: Legality?, + gladiator: Legality?, + oathbreaker: Legality?, + standardbrawl: Legality?, + alchemy: Legality?, + paupercommander: Legality?, + duel: Legality?, + oldschool: Legality?, + premodern: Legality?, + predh: Legality?, ) { self.standard = standard self.historic = historic @@ -40,6 +62,17 @@ extension Card { self.penny = penny self.commander = commander self.brawl = brawl + self.future = future + self.timeless = timeless + self.gladiator = gladiator + self.oathbreaker = oathbreaker + self.standardbrawl = standardbrawl + self.alchemy = alchemy + self.paupercommander = paupercommander + self.duel = duel + self.oldschool = oldschool + self.premodern = premodern + self.predh = predh } } } diff --git a/Sources/ScryfallKit/Models/Enums.swift b/Sources/ScryfallKit/Models/Enums.swift index b2b09c1..06fae80 100644 --- a/Sources/ScryfallKit/Models/Enums.swift +++ b/Sources/ScryfallKit/Models/Enums.swift @@ -32,7 +32,9 @@ public enum SortDirection: String, Codable, CaseIterable, Sendable { /// Formats for playing Magic: the Gathering public enum Format: String, CaseIterable, Sendable { - case standard, historic, pioneer, modern, legacy, pauper, vintage, penny, commander, brawl + case standard, future, historic, timeless, gladiator, pioneer, modern, legacy, pauper, vintage, + penny, commander, oathbreaker, standardbrawl, brawl, alchemy, paupercommander, duel, oldschool, + premodern, predh } /// Currency types that Scryfall provides prices for From 82c8e452fed821148d1b28f874feb3d9bacd3cac Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 11 Dec 2025 08:41:43 -0800 Subject: [PATCH 2/9] Add gameChanger. --- Sources/ScryfallKit/Models/Card/Card.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/ScryfallKit/Models/Card/Card.swift b/Sources/ScryfallKit/Models/Card/Card.swift index 306c1e1..e046058 100644 --- a/Sources/ScryfallKit/Models/Card/Card.swift +++ b/Sources/ScryfallKit/Models/Card/Card.swift @@ -61,6 +61,8 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { public var colors: [Color]? /// This card’s overall rank/popularity on EDHREC. Not all cards are ranked. public var edhrecRank: Int? + /// True if this card is on the [Commander Game Changer list](https://mtg.wiki/page/Game_Changers). + public var gameChanger: Bool? /// This card’s hand modifier, if it is Vanguard card. This value will contain a delta, such as -1. public var handModifier: String? /// An array of the keywords on this card (deathouch, first strike, etc) @@ -207,6 +209,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { colorIndicator: [Color]? = nil, colors: [Color]? = nil, edhrecRank: Int? = nil, + gameChanger: Bool? = nil, handModifier: String? = nil, keywords: [String], layout: Layout, @@ -285,6 +288,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { self.colorIndicator = colorIndicator self.colors = colors self.edhrecRank = edhrecRank + self.gameChanger = gameChanger self.handModifier = handModifier self.keywords = keywords self.layout = layout From 1ac6fe2656563d15cbe0d6db3b3e239dafbcebdd Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 11 Dec 2025 09:04:58 -0800 Subject: [PATCH 3/9] Add the missing MTGSet.Type.eternal enumeration value. --- Sources/ScryfallKit/Models/MTGSet.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/ScryfallKit/Models/MTGSet.swift b/Sources/ScryfallKit/Models/MTGSet.swift index 20e0a79..dff5d4c 100644 --- a/Sources/ScryfallKit/Models/MTGSet.swift +++ b/Sources/ScryfallKit/Models/MTGSet.swift @@ -34,7 +34,8 @@ public struct MTGSet: Codable, Identifiable, Hashable, Sendable { // While "masters" is in fact not inclusive, it's also a name that we can't control // swiftlint:disable:next inclusive_language case core, expansion, masters, masterpiece, spellbook, commander, planechase, archenemy, - vanguard, funny, starter, box, promo, token, memorabilia, arsenal, alchemy, minigame, unknown + vanguard, funny, starter, box, promo, token, memorabilia, arsenal, alchemy, minigame, eternal, + unknown case fromTheVault = "from_the_vault" case premiumDeck = "premium_deck" case duelDeck = "duel_deck" From c497d2b7da838c0f3fcd030dae4c4fb5508aa1ee Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Fri, 12 Dec 2025 12:10:08 -0800 Subject: [PATCH 4/9] Add defense. --- Sources/ScryfallKit/Models/Card/Card+Face.swift | 4 ++++ Sources/ScryfallKit/Models/Card/Card.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Sources/ScryfallKit/Models/Card/Card+Face.swift b/Sources/ScryfallKit/Models/Card/Card+Face.swift index b0f0f61..bc080a2 100644 --- a/Sources/ScryfallKit/Models/Card/Card+Face.swift +++ b/Sources/ScryfallKit/Models/Card/Card+Face.swift @@ -23,6 +23,8 @@ extension Card { public var colorIndicator: [Card.Color]? /// An array of the colors in this card's mana cost public var colors: [Card.Color]? + /// This face's defense, if any + public var defense: String? /// This card's flavor text if any public var flavorText: String? /// An ID for this card face's art that remains consistent across reprints @@ -61,6 +63,7 @@ extension Card { artist: String? = nil, colorIndicator: [Card.Color]? = nil, colors: [Card.Color]? = nil, + defense: String? = nil, flavorText: String? = nil, illustrationId: UUID? = nil, imageUris: ImageUris? = nil, @@ -79,6 +82,7 @@ extension Card { self.artist = artist self.colorIndicator = colorIndicator self.colors = colors + self.defense = defense self.flavorText = flavorText self.illustrationId = illustrationId self.imageUris = imageUris diff --git a/Sources/ScryfallKit/Models/Card/Card.swift b/Sources/ScryfallKit/Models/Card/Card.swift index e046058..b8f07f2 100644 --- a/Sources/ScryfallKit/Models/Card/Card.swift +++ b/Sources/ScryfallKit/Models/Card/Card.swift @@ -59,6 +59,8 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { public var colorIndicator: [Color]? /// An array of the colors in this card's mana cost public var colors: [Color]? + /// This card's defense, if any + public var defense: String? /// This card’s overall rank/popularity on EDHREC. Not all cards are ranked. public var edhrecRank: Int? /// True if this card is on the [Commander Game Changer list](https://mtg.wiki/page/Game_Changers). @@ -208,6 +210,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { colorIdentity: [Color], colorIndicator: [Color]? = nil, colors: [Color]? = nil, + defense: String? = nil, edhrecRank: Int? = nil, gameChanger: Bool? = nil, handModifier: String? = nil, @@ -287,6 +290,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { self.colorIdentity = colorIdentity self.colorIndicator = colorIndicator self.colors = colors + self.defense = defense self.edhrecRank = edhrecRank self.gameChanger = gameChanger self.handModifier = handModifier From d7190e946a6bdcf3785e67332f87d62c79b0f030 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Wed, 17 Dec 2025 13:28:43 -0800 Subject: [PATCH 5/9] Add missing fields to symbology. --- Sources/ScryfallKit/Models/Card/Card+Symbol.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/ScryfallKit/Models/Card/Card+Symbol.swift b/Sources/ScryfallKit/Models/Card/Card+Symbol.swift index 2ea0332..eca120f 100644 --- a/Sources/ScryfallKit/Models/Card/Card+Symbol.swift +++ b/Sources/ScryfallKit/Models/Card/Card+Symbol.swift @@ -29,10 +29,15 @@ extension Card { public var funny: Bool /// The colors that make up this symbol public var colors: [Color] + /// True if the symbol is a hybrid mana symbol. Note that monocolor Phyrexian symbols aren’t considered hybrid. + public var hybrid: Bool + /// True if the symbol is a Phyrexian mana symbol, i.e. it can be paid with 2 life. + public var phyrexian: Bool /// Alternate notations for this symbol that used on Wizards of the Coast's [Gatherer](https://gatherer.wizards.com/Pages/Default.aspx) public var gathererAlternates: [String]? /// A link to an SVG of this symbol public var svgUri: String? + /// A computed ID for this symbol which is just the `symbol` property public var id: String { symbol } @@ -47,6 +52,8 @@ extension Card { appearsInManaCosts: Bool, funny: Bool, colors: [Color], + hybrid: Bool, + phyrexian: Bool, gathererAlternates: [String]? = nil, svgUri: String? = nil ) { @@ -59,6 +66,8 @@ extension Card { self.appearsInManaCosts = appearsInManaCosts self.funny = funny self.colors = colors + self.hybrid = hybrid + self.phyrexian = phyrexian self.gathererAlternates = gathererAlternates self.svgUri = svgUri } From 0d9588281f49d5ca16295c7ec0c73350eebda83e Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 18 Dec 2025 12:24:20 -0800 Subject: [PATCH 6/9] Add undocumented sort order. --- Sources/ScryfallKit/Models/Enums.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ScryfallKit/Models/Enums.swift b/Sources/ScryfallKit/Models/Enums.swift index 06fae80..ec74b5e 100644 --- a/Sources/ScryfallKit/Models/Enums.swift +++ b/Sources/ScryfallKit/Models/Enums.swift @@ -20,7 +20,7 @@ public enum UniqueMode: String, Codable, CaseIterable, Sendable { /// /// [Scryfall documentation](https://scryfall.com/docs/api/cards/search#sorting-cards) public enum SortMode: String, Codable, CaseIterable, Sendable { - case name, set, released, rarity, color, usd, tix, eur, cmc, power, toughness, edhrec, artist + case name, set, released, rarity, color, usd, tix, eur, cmc, power, toughness, edhrec, artist, spoiled } /// Directions that Scryfall can order cards in From 34680489f2bc827c9b47079ac1170a87c9ff6483 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 18 Dec 2025 15:09:34 -0800 Subject: [PATCH 7/9] Make Catalog.Type sendable, add a few new ones, and sort them the way that Scryfall's docs do. --- Sources/ScryfallKit/Models/Catalog.swift | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Sources/ScryfallKit/Models/Catalog.swift b/Sources/ScryfallKit/Models/Catalog.swift index 8083c87..dafc828 100644 --- a/Sources/ScryfallKit/Models/Catalog.swift +++ b/Sources/ScryfallKit/Models/Catalog.swift @@ -9,20 +9,25 @@ import Foundation /// [Scryfall documentation](https://scryfall.com/docs/api/catalogs) public struct Catalog: Codable, Sendable { /// The catalog type. Each of these types represents a different `/catalogs` endpoint - public enum `Type`: String, Codable, CaseIterable { - case powers, toughnesses, loyalties, watermarks + public enum `Type`: String, Codable, CaseIterable, Sendable { case cardNames = "card-names" case artistNames = "artist-names" case wordBank = "word-bank" - case creatureTypes = "creature-types" - case planeswalkerTypes = "planeswalker-types" - case landTypes = "land-types" + case supertypes + case cardTypes = "card-types" case artifactTypes = "artifact-types" + case battleTypes = "battle-types" + case creatureTypes = "creature-types" case enchantmentTypes = "enchantment-types" + case landTypes = "land-types" + case planeswalkerTypes = "planeswalker-types" case spellTypes = "spell-types" + case powers, toughnesses, loyalties case keywordAbilities = "keyword-abilities" case keywordActions = "keyword-actions" case abilityWords = "ability-words" + case flavorWords = "flavor-words" + case watermarks } /// The number of items in the `data` array From 19372eaa11b25e14b6d995bd6309c41b895d669e Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Sun, 28 Dec 2025 18:16:08 -0800 Subject: [PATCH 8/9] Add missing Game types. --- Sources/ScryfallKit/Models/Enums.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ScryfallKit/Models/Enums.swift b/Sources/ScryfallKit/Models/Enums.swift index ec74b5e..dd2ad27 100644 --- a/Sources/ScryfallKit/Models/Enums.swift +++ b/Sources/ScryfallKit/Models/Enums.swift @@ -6,7 +6,7 @@ import Foundation /// Environments to play Magic: The Gathering in public enum Game: String, Codable, CaseIterable, Sendable { - case paper, mtgo, arena + case paper, mtgo, arena, astral, sega } /// Comparison strategies for determining what makes a card "unique" From 4be503bed42c9c594416ffd612484a6cffea9be1 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 8 Jan 2026 10:15:52 -0800 Subject: [PATCH 9/9] Fix newly-added tests for additional set type. --- Tests/ScryfallKitTests/CaseIterableTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/ScryfallKitTests/CaseIterableTests.swift b/Tests/ScryfallKitTests/CaseIterableTests.swift index e0b564b..cbe7422 100644 --- a/Tests/ScryfallKitTests/CaseIterableTests.swift +++ b/Tests/ScryfallKitTests/CaseIterableTests.swift @@ -131,6 +131,7 @@ final class CaseIterableTests: XCTestCase { case .arsenal: MTGSet.Kind.allCases.contains(.arsenal) case .alchemy: MTGSet.Kind.allCases.contains(.alchemy) case .minigame: MTGSet.Kind.allCases.contains(.minigame) + case .eternal: MTGSet.Kind.allCases.contains(.eternal) case .fromTheVault: MTGSet.Kind.allCases.contains(.fromTheVault) case .premiumDeck: MTGSet.Kind.allCases.contains(.premiumDeck) case .duelDeck: MTGSet.Kind.allCases.contains(.duelDeck)