diff options
Diffstat (limited to 'src/SMAPI.Web/Framework/ConfigModels')
6 files changed, 66 insertions, 13 deletions
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs index c27cadab..121690c5 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs @@ -24,17 +24,18 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /**** + ** CurseForge + ****/ + /// <summary>The base URL for the CurseForge API.</summary> + public string CurseForgeBaseUrl { get; set; } + + + /**** ** GitHub ****/ /// <summary>The base URL for the GitHub API.</summary> public string GitHubBaseUrl { get; set; } - /// <summary>The URL for a GitHub API query for the latest stable release, excluding the <see cref="GitHubBaseUrl"/>, where {0} is the organisation and project name.</summary> - public string GitHubStableReleaseUrlFormat { get; set; } - - /// <summary>The URL for a GitHub API query for the latest release (including prerelease), excluding the <see cref="GitHubBaseUrl"/>, where {0} is the organisation and project name.</summary> - public string GitHubAnyReleaseUrlFormat { get; set; } - /// <summary>The Accept header value expected by the GitHub API.</summary> public string GitHubAcceptHeader { get; set; } @@ -65,6 +66,9 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// <summary>The URL for a Nexus mod page to scrape for versions, excluding the <see cref="NexusBaseUrl"/>, where {0} is the mod ID.</summary> public string NexusModScrapeUrlFormat { get; set; } + /// <summary>The Nexus API authentication key.</summary> + public string NexusApiKey { get; set; } + /**** ** Pastebin ****/ diff --git a/src/SMAPI.Web/Framework/ConfigModels/BackgroundServicesConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/BackgroundServicesConfig.cs new file mode 100644 index 00000000..de871c9a --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/BackgroundServicesConfig.cs @@ -0,0 +1,12 @@ +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// <summary>The config settings for background services.</summary> + internal class BackgroundServicesConfig + { + /********* + ** Accessors + *********/ + /// <summary>Whether to enable background update services.</summary> + public bool Enabled { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/ConfigModels/ModCompatibilityListConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ModCompatibilityListConfig.cs index d9ac9f02..24b540cd 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/ModCompatibilityListConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/ModCompatibilityListConfig.cs @@ -1,12 +1,12 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels { - /// <summary>The config settings for mod compatibility list.</summary> + /// <summary>The config settings for the mod compatibility list.</summary> internal class ModCompatibilityListConfig { /********* ** Accessors *********/ - /// <summary>The number of minutes data from the wiki should be cached before refetching it.</summary> - public int CacheMinutes { get; set; } + /// <summary>The number of minutes before which wiki data should be considered old.</summary> + public int StaleMinutes { get; set; } } } diff --git a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs index bde566c0..ab935bb3 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs @@ -12,10 +12,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// <summary>The number of minutes failed update checks should be cached before refetching them.</summary> public int ErrorCacheMinutes { get; set; } - /// <summary>A regex which matches SMAPI-style semantic version.</summary> - /// <remarks>Derived from SMAPI's SemanticVersion implementation.</remarks> - public string SemanticVersionRegex { get; set; } - /// <summary>The web URL for the wiki compatibility list.</summary> public string CompatibilityPageUrl { get; set; } } diff --git a/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs new file mode 100644 index 00000000..3c508300 --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs @@ -0,0 +1,38 @@ +using System; + +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// <summary>The config settings for mod compatibility list.</summary> + internal class MongoDbConfig + { + /********* + ** Accessors + *********/ + /// <summary>The MongoDB hostname.</summary> + public string Host { get; set; } + + /// <summary>The MongoDB username (if any).</summary> + public string Username { get; set; } + + /// <summary>The MongoDB password (if any).</summary> + public string Password { get; set; } + + /// <summary>The database name.</summary> + public string Database { get; set; } + + + /********* + ** Public method + *********/ + /// <summary>Get the MongoDB connection string.</summary> + public string GetConnectionString() + { + bool isLocal = this.Host == "localhost"; + bool hasLogin = !string.IsNullOrWhiteSpace(this.Username) && !string.IsNullOrWhiteSpace(this.Password); + + return $"mongodb{(isLocal ? "" : "+srv")}://" + + (hasLogin ? $"{Uri.EscapeDataString(this.Username)}:{Uri.EscapeDataString(this.Password)}@" : "") + + $"{this.Host}/{this.Database}?retryWrites=true&w=majority"; + } + } +} diff --git a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs index d89a4260..bc6e868a 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs @@ -12,6 +12,9 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// <summary>The root URL for the log parser.</summary> public string LogParserUrl { get; set; } + /// <summary>The root URL for the JSON validator.</summary> + public string JsonValidatorUrl { get; set; } + /// <summary>The root URL for the mod list.</summary> public string ModListUrl { get; set; } |