From 05541c11a72735d79d98cf3ae14d592e70bd8f54 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 24 Dec 2017 23:28:07 -0500 Subject: decouple API clients from mods API (#411) --- .../Framework/ConfigModels/ApiClientsConfig.cs | 56 ++++++++++++++++++++++ .../Framework/ConfigModels/ModUpdateCheckConfig.cs | 49 ------------------- 2 files changed, 56 insertions(+), 49 deletions(-) create mode 100644 src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs (limited to 'src/SMAPI.Web/Framework/ConfigModels') diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs new file mode 100644 index 00000000..19794920 --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs @@ -0,0 +1,56 @@ +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// The config settings for the API clients. + internal class ApiClientsConfig + { + /********* + ** Accessors + *********/ + /**** + ** Generic + ****/ + /// The user agent for API clients, where {0} is the SMAPI version. + public string UserAgent { get; set; } + + + /**** + ** Chucklefish + ****/ + /// The base URL for the Chucklefish mod site. + public string ChucklefishBaseUrl { get; set; } + + /// The URL for a mod page on the Chucklefish mod site excluding the , where {0} is the mod ID. + public string ChucklefishModPageUrlFormat { get; set; } + + + /**** + ** GitHub + ****/ + /// The base URL for the GitHub API. + public string GitHubBaseUrl { get; set; } + + /// The URL for a GitHub API latest-release query excluding the , where {0} is the organisation and project name. + public string GitHubReleaseUrlFormat { get; set; } + + /// The Accept header value expected by the GitHub API. + public string GitHubAcceptHeader { get; set; } + + /// The username with which to authenticate to the GitHub API (if any). + public string GitHubUsername { get; set; } + + /// The password with which to authenticate to the GitHub API (if any). + public string GitHubPassword { get; set; } + + /**** + ** Nexus Mods + ****/ + /// The user agent for the Nexus Mods API client. + public string NexusUserAgent { get; set; } + + /// The base URL for the Nexus Mods API. + public string NexusBaseUrl { get; set; } + + /// The URL for a Nexus Mods API query excluding the , where {0} is the mod ID. + public string NexusModUrlFormat { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs index 2fb5b97e..58c3a100 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs @@ -6,9 +6,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /********* ** Accessors *********/ - /**** - ** General - ****/ /// The number of minutes update checks should be cached before refetching them. public int CacheMinutes { get; set; } @@ -16,59 +13,13 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// Derived from SMAPI's SemanticVersion implementation. public string SemanticVersionRegex { get; set; } - /**** - ** Chucklefish mod site - ****/ /// The repository key for the Chucklefish mod site. public string ChucklefishKey { get; set; } - /// The user agent for the Chucklefish API client, where {0} is the SMAPI version. - public string ChucklefishUserAgent { get; set; } - - /// The base URL for the Chucklefish mod site. - public string ChucklefishBaseUrl { get; set; } - - /// The URL for a mod page on the Chucklefish mod site excluding the , where {0} is the mod ID. - public string ChucklefishModPageUrlFormat { get; set; } - - - /**** - ** GitHub - ****/ /// The repository key for Nexus Mods. public string GitHubKey { get; set; } - /// The user agent for the GitHub API client, where {0} is the SMAPI version. - public string GitHubUserAgent { get; set; } - - /// The base URL for the GitHub API. - public string GitHubBaseUrl { get; set; } - - /// The URL for a GitHub API latest-release query excluding the , where {0} is the organisation and project name. - public string GitHubReleaseUrlFormat { get; set; } - - /// The Accept header value expected by the GitHub API. - public string GitHubAcceptHeader { get; set; } - - /// The username with which to authenticate to the GitHub API (if any). - public string GitHubUsername { get; set; } - - /// The password with which to authenticate to the GitHub API (if any). - public string GitHubPassword { get; set; } - - /**** - ** Nexus Mods - ****/ /// The repository key for Nexus Mods. public string NexusKey { get; set; } - - /// The user agent for the Nexus Mods API client. - public string NexusUserAgent { get; set; } - - /// The base URL for the Nexus Mods API. - public string NexusBaseUrl { get; set; } - - /// The URL for a Nexus Mods API query excluding the , where {0} is the mod ID. - public string NexusModUrlFormat { get; set; } } } -- cgit