Skip to content

Commit

Permalink
Merge pull request #11 from kinkofer/Package
Browse files Browse the repository at this point in the history
Added Swift Package
  • Loading branch information
kinkofer authored Jun 28, 2020
2 parents 41d949d + 5c3d1ff commit 85e896a
Show file tree
Hide file tree
Showing 22 changed files with 156 additions and 175 deletions.
25 changes: 25 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version:5.2
import PackageDescription

let package = Package(
name: "PokemomAPI",
platforms: [
.macOS(.v10_11),
.iOS(.v11),
.watchOS(.v2),
.tvOS(.v9),
],
products: [
.library(name: "PokemomAPI",
targets: ["PokemonAPI"]),
],
targets: [
.target(name: "PokemonAPI",
path: "PokemonAPI",
exclude: ["Example", "Tests"]),
.testTarget(name: "PokemonAPITests",
dependencies: ["PokemonAPI"],
path: "Tests",
exclude: ["Example"])
]
)
6 changes: 3 additions & 3 deletions PokemonAPI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,15 @@
path = Resources;
sourceTree = "<group>";
};
596476422497338E004C7E93 /* Unit Tests */ = {
596476422497338E004C7E93 /* Tests */ = {
isa = PBXGroup;
children = (
74B038111D56714D00F48B92 /* PokemonAPITests */,
74B038411D56788200F48B92 /* PokemonAPI tvOSTests */,
74B0385D1D5678AE00F48B92 /* PokemonAPI OSXTests */,
59647643249733CB004C7E93 /* PokemonAPI iOSTests */,
);
path = "Unit Tests";
path = Tests;
sourceTree = "<group>";
};
59647643249733CB004C7E93 /* PokemonAPI iOSTests */ = {
Expand Down Expand Up @@ -497,7 +497,7 @@
isa = PBXGroup;
children = (
74B038051D56714D00F48B92 /* PokemonAPI */,
596476422497338E004C7E93 /* Unit Tests */,
596476422497338E004C7E93 /* Tests */,
59647641249732E1004C7E93 /* Resources */,
74B038041D56714D00F48B92 /* Products */,
5964764424975122004C7E93 /* Frameworks */,
Expand Down
44 changes: 0 additions & 44 deletions PokemonAPI/6.0.0/PokemonAPI.podspec

This file was deleted.

14 changes: 7 additions & 7 deletions PokemonAPI/WebServices/ContestService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,43 +154,43 @@ public struct ContestService: PKMContestService {

extension ContestService {
@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchContestList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMContestType {
public func fetchContestList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMContestType {
callPaginated(endpoint: API.fetchContestList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchContestType(_ contestTypeID: Int) -> AnyPublisher<PKMContestType, Error> {
public func fetchContestType(_ contestTypeID: Int) -> AnyPublisher<PKMContestType, Error> {
call(endpoint: API.fetchContestTypeByID(contestTypeID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchContestType(_ contestTypeName: String) -> AnyPublisher<PKMContestType, Error> {
public func fetchContestType(_ contestTypeName: String) -> AnyPublisher<PKMContestType, Error> {
call(endpoint: API.fetchContestTypeByName(contestTypeName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchContestEffectList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMContestEffect {
public func fetchContestEffectList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMContestEffect {
callPaginated(endpoint: API.fetchContestEffectList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchContestEffect(_ contestEffectID: Int) -> AnyPublisher<PKMContestEffect, Error> {
public func fetchContestEffect(_ contestEffectID: Int) -> AnyPublisher<PKMContestEffect, Error> {
call(endpoint: API.fetchContestEffect(contestEffectID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchSuperContestEffectList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMSuperContestEffect {
public func fetchSuperContestEffectList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMSuperContestEffect {
callPaginated(endpoint: API.fetchSuperContestEffectList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchSuperContestEffect(_ superContestEffectID: Int) -> AnyPublisher<PKMSuperContestEffect, Error> {
public func fetchSuperContestEffect(_ superContestEffectID: Int) -> AnyPublisher<PKMSuperContestEffect, Error> {
call(endpoint: API.fetchSuperContestEffect(superContestEffectID))
}
}
18 changes: 9 additions & 9 deletions PokemonAPI/WebServices/EncounterService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,55 +191,55 @@ public struct EncounterService: PKMEncounterService {

extension EncounterService {
@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterMethodList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterMethod {
public func fetchEncounterMethodList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterMethod {
callPaginated(endpoint: API.fetchEncounterMethodList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterMethod(_ encounterMethodID: Int) -> AnyPublisher<PKMEncounterMethod, Error> {
public func fetchEncounterMethod(_ encounterMethodID: Int) -> AnyPublisher<PKMEncounterMethod, Error> {
call(endpoint: API.fetchEncounterMethodByID(encounterMethodID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterMethod(_ encounterMethodName: String) -> AnyPublisher<PKMEncounterMethod, Error> {
public func fetchEncounterMethod(_ encounterMethodName: String) -> AnyPublisher<PKMEncounterMethod, Error> {
call(endpoint: API.fetchEncounterMethodByName(encounterMethodName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterConditionList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterCondition {
public func fetchEncounterConditionList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterCondition {
callPaginated(endpoint: API.fetchEncounterConditionList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterCondition(_ encounterConditionID: Int) -> AnyPublisher<PKMEncounterCondition, Error> {
public func fetchEncounterCondition(_ encounterConditionID: Int) -> AnyPublisher<PKMEncounterCondition, Error> {
call(endpoint: API.fetchEncounterConditionByID(encounterConditionID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterCondition(_ encounterConditionName: String) -> AnyPublisher<PKMEncounterCondition, Error> {
public func fetchEncounterCondition(_ encounterConditionName: String) -> AnyPublisher<PKMEncounterCondition, Error> {
call(endpoint: API.fetchEncounterConditionByName(encounterConditionName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterConditionValueList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterConditionValue {
public func fetchEncounterConditionValueList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEncounterConditionValue {
callPaginated(endpoint: API.fetchEncounterConditionValueList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterConditionValue(_ encounterConditionValueID: Int) -> AnyPublisher<PKMEncounterConditionValue, Error> {
public func fetchEncounterConditionValue(_ encounterConditionValueID: Int) -> AnyPublisher<PKMEncounterConditionValue, Error> {
call(endpoint: API.fetchEncounterConditionValueByID(encounterConditionValueID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEncounterConditionValue(_ encounterConditionValueName: String) -> AnyPublisher<PKMEncounterConditionValue, Error> {
public func fetchEncounterConditionValue(_ encounterConditionValueName: String) -> AnyPublisher<PKMEncounterConditionValue, Error> {
call(endpoint: API.fetchEncounterConditionValueByName(encounterConditionValueName))
}
}
10 changes: 5 additions & 5 deletions PokemonAPI/WebServices/EvolutionService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,31 @@ public struct EvolutionService: PKMEvolutionService {

extension EvolutionService {
@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEvolutionChainList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEvolutionChain {
public func fetchEvolutionChainList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEvolutionChain {
callPaginated(endpoint: API.fetchEvolutionChainList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEvolutionChain(_ evolutionChainID: Int) -> AnyPublisher<PKMEvolutionChain, Error> {
public func fetchEvolutionChain(_ evolutionChainID: Int) -> AnyPublisher<PKMEvolutionChain, Error> {
call(endpoint: API.fetchEvolutionChain(evolutionChainID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEvolutionTriggerList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEvolutionTrigger {
public func fetchEvolutionTriggerList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMEvolutionTrigger {
callPaginated(endpoint: API.fetchEvolutionTriggerList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEvolutionTrigger(_ evolutionTriggerID: Int) -> AnyPublisher<PKMEvolutionTrigger, Error> {
public func fetchEvolutionTrigger(_ evolutionTriggerID: Int) -> AnyPublisher<PKMEvolutionTrigger, Error> {
call(endpoint: API.fetchEvolutionTriggerByID(evolutionTriggerID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchEvolutionTrigger(_ evolutionTriggerName: String) -> AnyPublisher<PKMEvolutionTrigger, Error> {
public func fetchEvolutionTrigger(_ evolutionTriggerName: String) -> AnyPublisher<PKMEvolutionTrigger, Error> {
call(endpoint: API.fetchEvolutionTriggerByName(evolutionTriggerName))
}
}
24 changes: 12 additions & 12 deletions PokemonAPI/WebServices/GameService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,72 +239,72 @@ public struct GameService: PKMGameService {

extension GameService {
@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchGenerationList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMGeneration {
public func fetchGenerationList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMGeneration {
callPaginated(endpoint: API.fetchGenerationList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchGeneration(_ generationID: Int) -> AnyPublisher<PKMGeneration, Error> {
public func fetchGeneration(_ generationID: Int) -> AnyPublisher<PKMGeneration, Error> {
call(endpoint: API.fetchGenerationByID(generationID))
}

@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchGeneration(_ generationName: String) -> AnyPublisher<PKMGeneration, Error> {
public func fetchGeneration(_ generationName: String) -> AnyPublisher<PKMGeneration, Error> {
call(endpoint: API.fetchGenerationByName(generationName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchPokedexList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMPokedex {
public func fetchPokedexList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMPokedex {
callPaginated(endpoint: API.fetchPokedexList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchPokedex(_ pokedexID: Int) -> AnyPublisher<PKMPokedex, Error> {
public func fetchPokedex(_ pokedexID: Int) -> AnyPublisher<PKMPokedex, Error> {
call(endpoint: API.fetchPokedexByID(pokedexID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchPokedex(_ pokedexName: String) -> AnyPublisher<PKMPokedex, Error> {
public func fetchPokedex(_ pokedexName: String) -> AnyPublisher<PKMPokedex, Error> {
call(endpoint: API.fetchPokedexByName(pokedexName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersionList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMVersion {
public func fetchVersionList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMVersion {
callPaginated(endpoint: API.fetchVersionList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersion(_ versionID: Int) -> AnyPublisher<PKMVersion, Error> {
public func fetchVersion(_ versionID: Int) -> AnyPublisher<PKMVersion, Error> {
call(endpoint: API.fetchVersionByID(versionID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersion(_ versionName: String) -> AnyPublisher<PKMVersion, Error> {
public func fetchVersion(_ versionName: String) -> AnyPublisher<PKMVersion, Error> {
call(endpoint: API.fetchVersionByName(versionName))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersionGroupList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMVersionGroup {
public func fetchVersionGroupList<T>(paginationState: PaginationState<T> = .initial(pageLimit: 20)) -> AnyPublisher<PKMPagedObject<T>, Error> where T: PKMVersionGroup {
callPaginated(endpoint: API.fetchVersionGroupList, paginationState: paginationState)
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersionGroup(_ versionGroupID: Int) -> AnyPublisher<PKMVersionGroup, Error> {
public func fetchVersionGroup(_ versionGroupID: Int) -> AnyPublisher<PKMVersionGroup, Error> {
call(endpoint: API.fetchVersionGroupByID(versionGroupID))
}


@available(OSX 10.15, iOS 13, tvOS 13.0, watchOS 6.0, *)
func fetchVersionGroup(_ versionGroupName: String) -> AnyPublisher<PKMVersionGroup, Error> {
public func fetchVersionGroup(_ versionGroupName: String) -> AnyPublisher<PKMVersionGroup, Error> {
call(endpoint: API.fetchVersionGroupByName(versionGroupName))
}
}
Loading

0 comments on commit 85e896a

Please sign in to comment.