diff --git a/BaseThunderstoreService.html b/BaseThunderstoreService.html new file mode 100644 index 0000000000..3e464bd604 --- /dev/null +++ b/BaseThunderstoreService.html @@ -0,0 +1,640 @@ + + + + + JSDoc: Class: BaseThunderstoreService + + + + + + + + + + +
+ +

Class: BaseThunderstoreService

+ + + + + + +
+ +
+ +

(abstract) BaseThunderstoreService()

+ +

Services which query Thunderstore endpoints should extend BaseThunderstoreService

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

(abstract) new BaseThunderstoreService()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) fetchPackage(pkg) → {Promise.<object>}

+ + + + + + +
+

Fetches package metadata from the Thunderstore API.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pkg + + +object + + + +

Package specifier

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
namespace + + +string + + + +

the package namespace

packageName + + +string + + + +

the package name

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • Promise containing validated package information
  • +
+
+ + + +
+
+ Type +
+
+ +Promise.<object> + + +
+
+ + + + + + + + + + + + + +

(async) fetchPackageMetrics(pkg) → {Promise.<object>}

+ + + + + + +
+

Fetches package metrics from the Thunderstore API.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pkg + + +object + + + +

Package specifier

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
namespace + + +string + + + +

the package namespace

packageName + + +string + + + +

the package name

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • Promise containing validated package metrics
  • +
+
+ + + +
+
+ Type +
+
+ +Promise.<object> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/badge-maker_lib_index.js.html b/badge-maker_lib_index.js.html index 4275ba4ca9..31b368fcb4 100644 --- a/badge-maker_lib_index.js.html +++ b/badge-maker_lib_index.js.html @@ -117,13 +117,13 @@ module.exports = {
diff --git a/badge-maker_lib_xml.js.html b/badge-maker_lib_xml.js.html index 003f93ac47..b11547cfd8 100644 --- a/badge-maker_lib_xml.js.html +++ b/badge-maker_lib_xml.js.html @@ -132,13 +132,13 @@ module.exports = { escapeXml, stripXmlWhitespace, XmlElement, ElementList }
diff --git a/core_base-service_base-graphql.js.html b/core_base-service_base-graphql.js.html index e47fbf6a6f..625713724b 100644 --- a/core_base-service_base-graphql.js.html +++ b/core_base-service_base-graphql.js.html @@ -142,13 +142,13 @@ export default BaseGraphqlService
diff --git a/core_base-service_base-json.js.html b/core_base-service_base-json.js.html index 5eefa28e3c..bcc5bdd35d 100644 --- a/core_base-service_base-json.js.html +++ b/core_base-service_base-json.js.html @@ -108,13 +108,13 @@ export default BaseJsonService
diff --git a/core_base-service_base-svg-scraping.js.html b/core_base-service_base-svg-scraping.js.html index a97bb34df1..465b3d93ca 100644 --- a/core_base-service_base-svg-scraping.js.html +++ b/core_base-service_base-svg-scraping.js.html @@ -139,13 +139,13 @@ export default BaseSvgScrapingService
diff --git a/core_base-service_base-toml.js.html b/core_base-service_base-toml.js.html index 0dcafd2843..b489f7a819 100644 --- a/core_base-service_base-toml.js.html +++ b/core_base-service_base-toml.js.html @@ -122,13 +122,13 @@ export default BaseTomlService
diff --git a/core_base-service_base-xml.js.html b/core_base-service_base-xml.js.html index 045a3dc38f..818c9d8340 100644 --- a/core_base-service_base-xml.js.html +++ b/core_base-service_base-xml.js.html @@ -118,13 +118,13 @@ export default BaseXmlService
diff --git a/core_base-service_base-yaml.js.html b/core_base-service_base-yaml.js.html index 098048df0d..c62b2c527b 100644 --- a/core_base-service_base-yaml.js.html +++ b/core_base-service_base-yaml.js.html @@ -121,13 +121,13 @@ export default BaseYamlService
diff --git a/core_base-service_base.js.html b/core_base-service_base.js.html index 68f2383063..206c0b418d 100644 --- a/core_base-service_base.js.html +++ b/core_base-service_base.js.html @@ -679,13 +679,13 @@ export default BaseService
diff --git a/core_base-service_errors.js.html b/core_base-service_errors.js.html index 40a78c38f9..a94a5aa664 100644 --- a/core_base-service_errors.js.html +++ b/core_base-service_errors.js.html @@ -259,13 +259,13 @@ export {
diff --git a/core_base-service_graphql.js.html b/core_base-service_graphql.js.html index cbf319c537..f467610b8a 100644 --- a/core_base-service_graphql.js.html +++ b/core_base-service_graphql.js.html @@ -87,13 +87,13 @@ export { mergeQueries }
diff --git a/core_base-service_openapi.js.html b/core_base-service_openapi.js.html index e7b513b564..979795dfcf 100644 --- a/core_base-service_openapi.js.html +++ b/core_base-service_openapi.js.html @@ -512,13 +512,13 @@ export {
diff --git a/core_base-service_resource-cache.js.html b/core_base-service_resource-cache.js.html index 4a04a09eab..bc795a06bd 100644 --- a/core_base-service_resource-cache.js.html +++ b/core_base-service_resource-cache.js.html @@ -105,13 +105,13 @@ export { getCachedResource, clearResourceCache }
diff --git a/core_server_prometheus-metrics.js.html b/core_server_prometheus-metrics.js.html index 0c00fa5c94..9bfc2838c5 100644 --- a/core_server_prometheus-metrics.js.html +++ b/core_server_prometheus-metrics.js.html @@ -121,13 +121,13 @@ export default class PrometheusMetrics {
diff --git a/core_server_server.js.html b/core_server_server.js.html index 74247a0ad6..7d6f642d14 100644 --- a/core_server_server.js.html +++ b/core_server_server.js.html @@ -641,13 +641,13 @@ export default Server
diff --git a/core_service-test-runner_create-service-tester.js.html b/core_service-test-runner_create-service-tester.js.html index 7e0ecb8ecc..95a5722c09 100644 --- a/core_service-test-runner_create-service-tester.js.html +++ b/core_service-test-runner_create-service-tester.js.html @@ -68,13 +68,13 @@ export default createServiceTester
diff --git a/core_service-test-runner_icedfrisby-shields.js.html b/core_service-test-runner_icedfrisby-shields.js.html index 4c28667f58..3155d4da2a 100644 --- a/core_service-test-runner_icedfrisby-shields.js.html +++ b/core_service-test-runner_icedfrisby-shields.js.html @@ -140,13 +140,13 @@ export default factory
diff --git a/core_service-test-runner_runner.js.html b/core_service-test-runner_runner.js.html index 1360f447db..e1aaeca7f3 100644 --- a/core_service-test-runner_runner.js.html +++ b/core_service-test-runner_runner.js.html @@ -112,13 +112,13 @@ export default Runner
diff --git a/core_service-test-runner_service-tester.js.html b/core_service-test-runner_service-tester.js.html index ea784e9852..8be5b9fb96 100644 --- a/core_service-test-runner_service-tester.js.html +++ b/core_service-test-runner_service-tester.js.html @@ -178,13 +178,13 @@ export default ServiceTester
diff --git a/core_service-test-runner_services-for-title.js.html b/core_service-test-runner_services-for-title.js.html index 5affbee537..58a891618e 100644 --- a/core_service-test-runner_services-for-title.js.html +++ b/core_service-test-runner_services-for-title.js.html @@ -69,13 +69,13 @@ export default servicesForTitle
diff --git a/core_token-pooling_token-pool.js.html b/core_token-pooling_token-pool.js.html index b9169ccb9b..4d7ce8baa5 100644 --- a/core_token-pooling_token-pool.js.html +++ b/core_token-pooling_token-pool.js.html @@ -373,13 +373,13 @@ export { sanitizeToken, Token, TokenPool }
diff --git a/global.html b/global.html index 0fc4929acf..e46ebf8853 100644 --- a/global.html +++ b/global.html @@ -678,13 +678,13 @@
diff --git a/index.html b/index.html index 20be696756..7e612cf897 100644 --- a/index.html +++ b/index.html @@ -212,13 +212,13 @@ under their terms and license.


diff --git a/module-badge-maker.html b/module-badge-maker.html index 2d87ab3e6b..6129be5eb2 100644 --- a/module-badge-maker.html +++ b/module-badge-maker.html @@ -423,13 +423,13 @@
diff --git a/module-badge-maker_lib_xml-ElementList.html b/module-badge-maker_lib_xml-ElementList.html index c18d6e8397..ac05fe71af 100644 --- a/module-badge-maker_lib_xml-ElementList.html +++ b/module-badge-maker_lib_xml-ElementList.html @@ -157,13 +157,13 @@ like an XmlElement but renders multiple XML tags (not wrapped in a ).


diff --git a/module-badge-maker_lib_xml-XmlElement.html b/module-badge-maker_lib_xml-XmlElement.html index 9af1736a2d..53156c892b 100644 --- a/module-badge-maker_lib_xml-XmlElement.html +++ b/module-badge-maker_lib_xml-XmlElement.html @@ -468,13 +468,13 @@ element will be rendered as a self-closing element.


diff --git a/module-badge-maker_lib_xml.html b/module-badge-maker_lib_xml.html index 93fc22ef7b..be6fb2cc1b 100644 --- a/module-badge-maker_lib_xml.html +++ b/module-badge-maker_lib_xml.html @@ -122,13 +122,13 @@
diff --git a/module-core_base-service_base-BaseService.html b/module-core_base-service_base-BaseService.html index f7152a8671..a344964b1f 100644 --- a/module-core_base-service_base-BaseService.html +++ b/module-core_base-service_base-BaseService.html @@ -969,13 +969,13 @@ for a given route parameter


diff --git a/module-core_base-service_base-graphql-BaseGraphqlService.html b/module-core_base-service_base-graphql-BaseGraphqlService.html index c1485991c7..181b675bc6 100644 --- a/module-core_base-service_base-graphql-BaseGraphqlService.html +++ b/module-core_base-service_base-graphql-BaseGraphqlService.html @@ -907,13 +907,13 @@ an InvalidResponse.


diff --git a/module-core_base-service_base-graphql.html b/module-core_base-service_base-graphql.html index 062a38c29c..1c28684e4d 100644 --- a/module-core_base-service_base-graphql.html +++ b/module-core_base-service_base-graphql.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-json-BaseJsonService.html b/module-core_base-service_base-json-BaseJsonService.html index 5354124755..fa9b866372 100644 --- a/module-core_base-service_base-json-BaseJsonService.html +++ b/module-core_base-service_base-json-BaseJsonService.html @@ -752,13 +752,13 @@ that will be logged (to sentry, if configured).


diff --git a/module-core_base-service_base-json.html b/module-core_base-service_base-json.html index 7d09930f4c..aa35033a41 100644 --- a/module-core_base-service_base-json.html +++ b/module-core_base-service_base-json.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html b/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html index b0044b252e..393264de9d 100644 --- a/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html +++ b/module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html @@ -843,13 +843,13 @@ that will be logged (to sentry, if configured).


diff --git a/module-core_base-service_base-svg-scraping.html b/module-core_base-service_base-svg-scraping.html index aaa8324ef2..57bc33635b 100644 --- a/module-core_base-service_base-svg-scraping.html +++ b/module-core_base-service_base-svg-scraping.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-toml-BaseTomlService.html b/module-core_base-service_base-toml-BaseTomlService.html index 54a751c334..aeb69fc37b 100644 --- a/module-core_base-service_base-toml-BaseTomlService.html +++ b/module-core_base-service_base-toml-BaseTomlService.html @@ -593,13 +593,13 @@ that will be logged (to sentry, if configured).


diff --git a/module-core_base-service_base-toml.html b/module-core_base-service_base-toml.html index 9a3a8e30fe..d9e50779cc 100644 --- a/module-core_base-service_base-toml.html +++ b/module-core_base-service_base-toml.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-xml-BaseXmlService.html b/module-core_base-service_base-xml-BaseXmlService.html index c795263a38..561a3d7958 100644 --- a/module-core_base-service_base-xml-BaseXmlService.html +++ b/module-core_base-service_base-xml-BaseXmlService.html @@ -635,13 +635,13 @@ that will be logged (to sentry, if configured).


diff --git a/module-core_base-service_base-xml.html b/module-core_base-service_base-xml.html index 5ca592d19d..4a3c4faea6 100644 --- a/module-core_base-service_base-xml.html +++ b/module-core_base-service_base-xml.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base-yaml-BaseYamlService.html b/module-core_base-service_base-yaml-BaseYamlService.html index fa65ef1d51..99bc8735d0 100644 --- a/module-core_base-service_base-yaml-BaseYamlService.html +++ b/module-core_base-service_base-yaml-BaseYamlService.html @@ -632,13 +632,13 @@ that will be logged (to sentry, if configured).


diff --git a/module-core_base-service_base-yaml.html b/module-core_base-service_base-yaml.html index 437be01c46..93e0290753 100644 --- a/module-core_base-service_base-yaml.html +++ b/module-core_base-service_base-yaml.html @@ -119,13 +119,13 @@
diff --git a/module-core_base-service_base.html b/module-core_base-service_base.html index 04df0a9b97..7c2f103f32 100644 --- a/module-core_base-service_base.html +++ b/module-core_base-service_base.html @@ -1202,13 +1202,13 @@ when the parameter is absent. (Note that in,
diff --git a/module-core_base-service_errors-Deprecated.html b/module-core_base-service_errors-Deprecated.html index 73a095809c..8b50d686f5 100644 --- a/module-core_base-service_errors-Deprecated.html +++ b/module-core_base-service_errors-Deprecated.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-ImproperlyConfigured.html b/module-core_base-service_errors-ImproperlyConfigured.html index 35240e2f97..71fcea4210 100644 --- a/module-core_base-service_errors-ImproperlyConfigured.html +++ b/module-core_base-service_errors-ImproperlyConfigured.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-Inaccessible.html b/module-core_base-service_errors-Inaccessible.html index a3b9a27b80..f6c2556465 100644 --- a/module-core_base-service_errors-Inaccessible.html +++ b/module-core_base-service_errors-Inaccessible.html @@ -206,13 +206,13 @@ or to wrap a 5XX response


diff --git a/module-core_base-service_errors-InvalidParameter.html b/module-core_base-service_errors-InvalidParameter.html index fee3d709ff..bc7249b9bb 100644 --- a/module-core_base-service_errors-InvalidParameter.html +++ b/module-core_base-service_errors-InvalidParameter.html @@ -206,13 +206,13 @@ is invalid or unexpected


diff --git a/module-core_base-service_errors-InvalidResponse.html b/module-core_base-service_errors-InvalidResponse.html index 0526ebcb80..2fd5778e1f 100644 --- a/module-core_base-service_errors-InvalidResponse.html +++ b/module-core_base-service_errors-InvalidResponse.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-NotFound.html b/module-core_base-service_errors-NotFound.html index caea028606..44a5a411e3 100644 --- a/module-core_base-service_errors-NotFound.html +++ b/module-core_base-service_errors-NotFound.html @@ -205,13 +205,13 @@
diff --git a/module-core_base-service_errors-ShieldsRuntimeError.html b/module-core_base-service_errors-ShieldsRuntimeError.html index 024140c23c..d01ae1f1c2 100644 --- a/module-core_base-service_errors-ShieldsRuntimeError.html +++ b/module-core_base-service_errors-ShieldsRuntimeError.html @@ -378,13 +378,13 @@ should override this method.


diff --git a/module-core_base-service_errors.html b/module-core_base-service_errors.html index 0207c6e8e8..e831027efc 100644 --- a/module-core_base-service_errors.html +++ b/module-core_base-service_errors.html @@ -337,13 +337,13 @@ for. Defaults to the cacheLength of the service class throwing the error
diff --git a/module-core_base-service_graphql.html b/module-core_base-service_graphql.html index 821c7d9448..d046cc7b2a 100644 --- a/module-core_base-service_graphql.html +++ b/module-core_base-service_graphql.html @@ -290,13 +290,13 @@ but can't use that due to incorrect packaging.


diff --git a/module-core_base-service_openapi.html b/module-core_base-service_openapi.html index 3ee6d68a51..5d7788d595 100644 --- a/module-core_base-service_openapi.html +++ b/module-core_base-service_openapi.html @@ -1627,13 +1627,13 @@ Query params are usually strings. (Optional)


diff --git a/module-core_base-service_resource-cache.html b/module-core_base-service_resource-cache.html index ff312f7ed9..30fa1fadf4 100644 --- a/module-core_base-service_resource-cache.html +++ b/module-core_base-service_resource-cache.html @@ -562,13 +562,13 @@
diff --git a/module-core_server_server-Server.html b/module-core_server_server-Server.html index d6020261cb..8dbff7c29a 100644 --- a/module-core_server_server-Server.html +++ b/module-core_server_server-Server.html @@ -675,13 +675,13 @@ Start listening for requests on this.baseUrl()


diff --git a/module-core_server_server.html b/module-core_server_server.html index f48e0131f2..b1e13394db 100644 --- a/module-core_server_server.html +++ b/module-core_server_server.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_create-service-tester.html b/module-core_service-test-runner_create-service-tester.html index fd22f9d86b..b0df0fe9c3 100644 --- a/module-core_service-test-runner_create-service-tester.html +++ b/module-core_service-test-runner_create-service-tester.html @@ -230,13 +230,13 @@ service.


diff --git a/module-core_service-test-runner_icedfrisby-shields.html b/module-core_service-test-runner_icedfrisby-shields.html index 82ca57d50f..15de683886 100644 --- a/module-core_service-test-runner_icedfrisby-shields.html +++ b/module-core_service-test-runner_icedfrisby-shields.html @@ -286,13 +286,13 @@
diff --git a/module-core_service-test-runner_runner-Runner.html b/module-core_service-test-runner_runner-Runner.html index 5271c45d8d..9e8bb5e33d 100644 --- a/module-core_service-test-runner_runner-Runner.html +++ b/module-core_service-test-runner_runner-Runner.html @@ -562,13 +562,13 @@ overridden on instances.


diff --git a/module-core_service-test-runner_runner.html b/module-core_service-test-runner_runner.html index 0adf1ecb22..ff8ddf5b64 100644 --- a/module-core_service-test-runner_runner.html +++ b/module-core_service-test-runner_runner.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_service-tester-ServiceTester.html b/module-core_service-test-runner_service-tester-ServiceTester.html index 45abf4ff21..f5904b90da 100644 --- a/module-core_service-test-runner_service-tester-ServiceTester.html +++ b/module-core_service-test-runner_service-tester-ServiceTester.html @@ -1120,13 +1120,13 @@ the CLI, or directly on the tester.


diff --git a/module-core_service-test-runner_service-tester.html b/module-core_service-test-runner_service-tester.html index c05c59c3ec..a56a04f3ed 100644 --- a/module-core_service-test-runner_service-tester.html +++ b/module-core_service-test-runner_service-tester.html @@ -119,13 +119,13 @@
diff --git a/module-core_service-test-runner_services-for-title.html b/module-core_service-test-runner_services-for-title.html index b91be05668..063301d47d 100644 --- a/module-core_service-test-runner_services-for-title.html +++ b/module-core_service-test-runner_services-for-title.html @@ -278,13 +278,13 @@ as an array of strings.


diff --git a/module-core_token-pooling_token-pool-Token.html b/module-core_token-pooling_token-pool-Token.html index 17822b2aa3..a4ad421ff2 100644 --- a/module-core_token-pooling_token-pool-Token.html +++ b/module-core_token-pooling_token-pool-Token.html @@ -709,13 +709,13 @@ stable ordering for a valid priority queue.


diff --git a/module-core_token-pooling_token-pool-TokenPool.html b/module-core_token-pooling_token-pool-TokenPool.html index a01048a0c2..c47e4bc657 100644 --- a/module-core_token-pooling_token-pool-TokenPool.html +++ b/module-core_token-pooling_token-pool-TokenPool.html @@ -893,13 +893,13 @@ indicate it should not be reused.


diff --git a/module-core_token-pooling_token-pool.html b/module-core_token-pooling_token-pool.html index cd90fb6155..ea9fc62dec 100644 --- a/module-core_token-pooling_token-pool.html +++ b/module-core_token-pooling_token-pool.html @@ -285,13 +285,13 @@
diff --git a/module-services_build-status.html b/module-services_build-status.html index 341fd04ded..395f9cefe8 100644 --- a/module-services_build-status.html +++ b/module-services_build-status.html @@ -447,13 +447,13 @@ Determines the message and color of the badge according to the build status.


diff --git a/module-services_color-formatters.html b/module-services_color-formatters.html index d2031ec073..bf9652454d 100644 --- a/module-services_color-formatters.html +++ b/module-services_color-formatters.html @@ -1526,13 +1526,13 @@ The color defaults to red if the score does not matches with any of the grade va
diff --git a/module-services_contributor-count.html b/module-services_contributor-count.html index 78d38b30f2..9390d2e438 100644 --- a/module-services_contributor-count.html +++ b/module-services_contributor-count.html @@ -530,13 +530,13 @@ Determines the message and color of the badge according to the contributor count
diff --git a/module-services_downloads.html b/module-services_downloads.html index 4721fa452d..64ad0658cf 100644 --- a/module-services_downloads.html +++ b/module-services_downloads.html @@ -540,13 +540,13 @@ this value as the prefix for versioned badges, e.g. foobar@v1.23. D
diff --git a/module-services_dynamic-common.html b/module-services_dynamic-common.html index c5301910e8..6657434e82 100644 --- a/module-services_dynamic-common.html +++ b/module-services_dynamic-common.html @@ -954,13 +954,13 @@ Sets the color of the badge to blue.


diff --git a/module-services_dynamic_json-path.html b/module-services_dynamic_json-path.html index fae4024ffb..490a96b427 100644 --- a/module-services_dynamic_json-path.html +++ b/module-services_dynamic_json-path.html @@ -417,13 +417,13 @@ This can be used to extend or override the
diff --git a/module-services_endpoint-common.html b/module-services_endpoint-common.html index 2b778f506e..c7dd3793df 100644 --- a/module-services_endpoint-common.html +++ b/module-services_endpoint-common.html @@ -804,13 +804,13 @@ Optionally it prints those keys in the message to provide detailed feedback.


diff --git a/module-services_licenses.html b/module-services_licenses.html index b74554a160..3d6d2ea2e0 100644 --- a/module-services_licenses.html +++ b/module-services_licenses.html @@ -644,13 +644,13 @@ Sets the badge color to the provided value, if not provided then the color is us
diff --git a/module-services_package-json-helpers.html b/module-services_package-json-helpers.html index 6723bff42b..7e0ae76f16 100644 --- a/module-services_package-json-helpers.html +++ b/module-services_package-json-helpers.html @@ -650,13 +650,13 @@ Checks if the object has all the dependency types and the dependency types are v
diff --git a/module-services_php-version.html b/module-services_php-version.html index d3920a4d99..1c422ae1ae 100644 --- a/module-services_php-version.html +++ b/module-services_php-version.html @@ -1466,13 +1466,13 @@ Return { numbers: [1,0,something big], modifier: 2, modifierCount: 1 }


diff --git a/module-services_pipenv-helpers.html b/module-services_pipenv-helpers.html index 34d7324248..29aa85b8bf 100644 --- a/module-services_pipenv-helpers.html +++ b/module-services_pipenv-helpers.html @@ -610,13 +610,13 @@ Checks if the lock file object has required properties and the properties are va
diff --git a/module-services_route-builder.html b/module-services_route-builder.html index ecb3f6d7f6..b11e43b642 100644 --- a/module-services_route-builder.html +++ b/module-services_route-builder.html @@ -615,13 +615,13 @@
diff --git a/module-services_steam_steam-base-BaseSteamAPI.html b/module-services_steam_steam-base-BaseSteamAPI.html index 68c273de3e..6013ce9eb6 100644 --- a/module-services_steam_steam-base-BaseSteamAPI.html +++ b/module-services_steam_steam-base-BaseSteamAPI.html @@ -374,13 +374,13 @@
diff --git a/module-services_steam_steam-base.html b/module-services_steam_steam-base.html index 50e09609cb..071b1a9354 100644 --- a/module-services_steam_steam-base.html +++ b/module-services_steam_steam-base.html @@ -119,13 +119,13 @@
diff --git a/module-services_text-formatters.html b/module-services_text-formatters.html index 54119b4430..f5a928b848 100644 --- a/module-services_text-formatters.html +++ b/module-services_text-formatters.html @@ -1674,13 +1674,13 @@ The remaining stars are empty stars until the maximum number of stars is reached
diff --git a/module-services_validators.html b/module-services_validators.html index 971ec36d8e..beda09ee64 100644 --- a/module-services_validators.html +++ b/module-services_validators.html @@ -701,13 +701,13 @@ Some invalid values for this validator are: abc, 1.a, 1.0-, .1


diff --git a/module-services_version.html b/module-services_version.html index 31c5eefa45..02670974a7 100644 --- a/module-services_version.html +++ b/module-services_version.html @@ -1876,13 +1876,13 @@ slice('2.4', 'patch') // returns null because the version string is not valid ac
diff --git a/module-services_website-status.html b/module-services_website-status.html index c41766fbc1..62e3a72f7d 100644 --- a/module-services_website-status.html +++ b/module-services_website-status.html @@ -655,13 +655,13 @@ renderWebsiteStatus({ isUp: false }) // returns { message: 'down', color: 'red'
diff --git a/services_build-status.js.html b/services_build-status.js.html index b865127b95..d422ad8f76 100644 --- a/services_build-status.js.html +++ b/services_build-status.js.html @@ -134,13 +134,13 @@ export { isBuildStatus, renderBuildStatusBadge }
diff --git a/services_color-formatters.js.html b/services_color-formatters.js.html index 3a7703ec65..1c2c25d331 100644 --- a/services_color-formatters.js.html +++ b/services_color-formatters.js.html @@ -234,13 +234,13 @@ export {
diff --git a/services_contributor-count.js.html b/services_contributor-count.js.html index af596802bb..896f832e6f 100644 --- a/services_contributor-count.js.html +++ b/services_contributor-count.js.html @@ -79,13 +79,13 @@ export { contributorColor, renderContributorBadge }
diff --git a/services_downloads.js.html b/services_downloads.js.html index f4352c5340..3954255409 100644 --- a/services_downloads.js.html +++ b/services_downloads.js.html @@ -95,13 +95,13 @@ export { renderDownloadsBadge }
diff --git a/services_dynamic-common.js.html b/services_dynamic-common.js.html index 7a5af59058..3381eef8c0 100644 --- a/services_dynamic-common.js.html +++ b/services_dynamic-common.js.html @@ -136,13 +136,13 @@ export {
diff --git a/services_dynamic_json-path.js.html b/services_dynamic_json-path.js.html index efd438c4f4..f33563add6 100644 --- a/services_dynamic_json-path.js.html +++ b/services_dynamic_json-path.js.html @@ -114,13 +114,13 @@ export default superclass =>
diff --git a/services_endpoint-common.js.html b/services_endpoint-common.js.html index 5e2c677a5c..334f43a331 100644 --- a/services_endpoint-common.js.html +++ b/services_endpoint-common.js.html @@ -143,13 +143,13 @@ export { validateEndpointData, fetchEndpointData }
diff --git a/services_licenses.js.html b/services_licenses.js.html index 5f51752b32..690a2da447 100644 --- a/services_licenses.js.html +++ b/services_licenses.js.html @@ -195,13 +195,13 @@ export { licenseToColor, renderLicenseBadge }
diff --git a/services_package-json-helpers.js.html b/services_package-json-helpers.js.html index 156be1f919..cd5f4c42cd 100644 --- a/services_package-json-helpers.js.html +++ b/services_package-json-helpers.js.html @@ -114,13 +114,13 @@ export { isDependencyMap, isPackageJsonWithDependencies, getDependencyVersion }
diff --git a/services_packagist_packagist-base.js.html b/services_packagist_packagist-base.js.html index 0180ca2947..90ead637fd 100644 --- a/services_packagist_packagist-base.js.html +++ b/services_packagist_packagist-base.js.html @@ -221,13 +221,13 @@ export {
diff --git a/services_php-version.js.html b/services_php-version.js.html index 21e06d78c6..e8f0984b53 100644 --- a/services_php-version.js.html +++ b/services_php-version.js.html @@ -335,13 +335,13 @@ export {
diff --git a/services_pipenv-helpers.js.html b/services_pipenv-helpers.js.html index a4fadbf4aa..11ead5c08c 100644 --- a/services_pipenv-helpers.js.html +++ b/services_pipenv-helpers.js.html @@ -122,13 +122,13 @@ export { isLockfile, getDependencyVersion }
diff --git a/services_route-builder.js.html b/services_route-builder.js.html index 63f9c99fd4..094515da52 100644 --- a/services_route-builder.js.html +++ b/services_route-builder.js.html @@ -99,13 +99,13 @@ export default class RouteBuilder {
diff --git a/services_steam_steam-base.js.html b/services_steam_steam-base.js.html index 7ef6ae7abe..671d12da4a 100644 --- a/services_steam_steam-base.js.html +++ b/services_steam_steam-base.js.html @@ -92,13 +92,13 @@ export default BaseSteamAPI
diff --git a/services_test-validators.js.html b/services_test-validators.js.html index 72876ca358..5c5a2f0cb9 100644 --- a/services_test-validators.js.html +++ b/services_test-validators.js.html @@ -253,13 +253,13 @@ export {
diff --git a/services_text-formatters.js.html b/services_text-formatters.js.html index a3bc5e7a79..46699ec8dd 100644 --- a/services_text-formatters.js.html +++ b/services_text-formatters.js.html @@ -246,13 +246,13 @@ export {
diff --git a/services_thunderstore_thunderstore-base.js.html b/services_thunderstore_thunderstore-base.js.html new file mode 100644 index 0000000000..8cbb912e99 --- /dev/null +++ b/services_thunderstore_thunderstore-base.js.html @@ -0,0 +1,144 @@ + + + + + JSDoc: Source: services/thunderstore/thunderstore-base.js + + + + + + + + + + +
+ +

Source: services/thunderstore/thunderstore-base.js

+ + + + + + +
+
+
import Joi from 'joi'
+import { BaseJsonService } from '../index.js'
+import { nonNegativeInteger } from '../validators.js'
+
+const packageSchema = Joi.object({
+  latest: Joi.object({
+    version_number: Joi.string().required(),
+  }).required(),
+}).required()
+
+const packageMetricsSchema = Joi.object({
+  downloads: nonNegativeInteger,
+  rating_score: nonNegativeInteger,
+})
+
+const documentation = `
+<p>
+  The Thunderstore badges require a package's <code>namespace</code> and <code>name</code>.
+</p>
+<p>
+  Everything can be discerned from your package's URL. Thunderstore package URLs have a mostly consistent
+  format:
+</p>
+<p>
+    <code>https://thunderstore.io/c/[community]/p/[namespace]/[packageName]</code>
+</p>
+<p>
+  For example: <code>https://thunderstore.io/c/lethal-company/p/notnotnotswipez/MoreCompany/</code>.
+  <ul>
+    <li><code>namespace = "notnotnotswipez"</code></li>
+    <li><code>packageName = "MoreCompany"</code></li>
+  </ul>
+</p>
+<details>
+  <summary>Risk Of Rain 2</summary>
+  <p>
+    The 'default community', Risk of Rain 2, has an alternative URL:
+  </p>
+  <p>
+    <code>https://thunderstore.io/package/[namespace]/[packageName]</code>
+  </p>
+</details>
+<details>
+  <summary>Subdomain Communities</summary>
+  <p>
+    Some communities use a 'subdomain' alternative URL, for example, Valheim:
+  </p>
+  <p>
+    <code>https://valheim.thunderstore.io/package/[namespace]/[packageName]</code>
+  </p>
+</details>
+`
+
+/**
+ * Services which query Thunderstore endpoints should extend BaseThunderstoreService
+ *
+ * @abstract
+ */
+class BaseThunderstoreService extends BaseJsonService {
+  static thunderstoreGreen = '23FFB0'
+
+  /**
+   * Fetches package metadata from the Thunderstore API.
+   *
+   * @param {object} pkg - Package specifier
+   * @param {string} pkg.namespace - the package namespace
+   * @param {string} pkg.packageName - the package name
+   * @returns {Promise<object>} - Promise containing validated package information
+   */
+  async fetchPackage({ namespace, packageName }) {
+    return this._requestJson({
+      schema: packageSchema,
+      url: `https://thunderstore.io/api/experimental/package/${namespace}/${packageName}`,
+    })
+  }
+
+  /**
+   * Fetches package metrics from the Thunderstore API.
+   *
+   * @param {object} pkg - Package specifier
+   * @param {string} pkg.namespace - the package namespace
+   * @param {string} pkg.packageName - the package name
+   * @returns {Promise<object>} - Promise containing validated package metrics
+   */
+  async fetchPackageMetrics({ namespace, packageName }) {
+    return this._requestJson({
+      schema: packageMetricsSchema,
+      url: `https://thunderstore.io/api/v1/package-metrics/${namespace}/${packageName}`,
+    })
+  }
+}
+
+export { BaseThunderstoreService, documentation }
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/services_validators.js.html b/services_validators.js.html index 7fda17f65f..ad327f3a4b 100644 --- a/services_validators.js.html +++ b/services_validators.js.html @@ -117,13 +117,13 @@ export const fileSize = Joi.string()
diff --git a/services_version.js.html b/services_version.js.html index 487e3cfafe..cd35d74200 100644 --- a/services_version.js.html +++ b/services_version.js.html @@ -293,13 +293,13 @@ export { latest, listCompare, slice, rangeStart, renderVersionBadge }
diff --git a/services_website-status.js.html b/services_website-status.js.html index f5a10ffa39..e337a080d9 100644 --- a/services_website-status.js.html +++ b/services_website-status.js.html @@ -101,13 +101,13 @@ export { queryParamSchema, queryParams, renderWebsiteStatus }
diff --git a/tutorial-TUTORIAL.html b/tutorial-TUTORIAL.html index e30cb53e35..1781f80a5e 100644 --- a/tutorial-TUTORIAL.html +++ b/tutorial-TUTORIAL.html @@ -373,13 +373,13 @@ will review your contribution.
diff --git a/tutorial-adding-new-config-values.html b/tutorial-adding-new-config-values.html index a8675d011c..0e920beb16 100644 --- a/tutorial-adding-new-config-values.html +++ b/tutorial-adding-new-config-values.html @@ -54,13 +54,13 @@
diff --git a/tutorial-authentication.html b/tutorial-authentication.html index d98a9dc454..84a03af02f 100644 --- a/tutorial-authentication.html +++ b/tutorial-authentication.html @@ -42,13 +42,13 @@
diff --git a/tutorial-badge-urls.html b/tutorial-badge-urls.html index 6725344889..d06ccb36bf 100644 --- a/tutorial-badge-urls.html +++ b/tutorial-badge-urls.html @@ -77,13 +77,13 @@ badge is for issues, and the parameters are :user/:repo.
diff --git a/tutorial-code-walkthrough.html b/tutorial-code-walkthrough.html index 75cc16453c..554ddf1de4 100644 --- a/tutorial-code-walkthrough.html +++ b/tutorial-code-walkthrough.html @@ -229,13 +229,13 @@ result over the HTTPS connection.
diff --git a/tutorial-deprecating-badges.html b/tutorial-deprecating-badges.html index 927d350070..e63a07cb9a 100644 --- a/tutorial-deprecating-badges.html +++ b/tutorial-deprecating-badges.html @@ -143,13 +143,13 @@ t.create('no longer available (previously number of layers)')
diff --git a/tutorial-input-validation.html b/tutorial-input-validation.html index f1501cbe88..4e0936d334 100644 --- a/tutorial-input-validation.html +++ b/tutorial-input-validation.html @@ -97,13 +97,13 @@
diff --git a/tutorial-json-format.html b/tutorial-json-format.html index 57288fe61b..c72d02d871 100644 --- a/tutorial-json-format.html +++ b/tutorial-json-format.html @@ -54,13 +54,13 @@ if you have any queries regarding the JSON format.


diff --git a/tutorial-logos.html b/tutorial-logos.html index 7159a34bc6..2af7b9d19d 100644 --- a/tutorial-logos.html +++ b/tutorial-logos.html @@ -80,13 +80,13 @@
diff --git a/tutorial-performance-testing.html b/tutorial-performance-testing.html index fd5bb4ff90..a7942c162e 100644 --- a/tutorial-performance-testing.html +++ b/tutorial-performance-testing.html @@ -70,13 +70,13 @@ node --prof-process --preprocess -j isolate-00000244AB6ED3B0-11920-v8.log | flam
diff --git a/tutorial-production-hosting.html b/tutorial-production-hosting.html index c7ed94c0fd..3c9d6101bc 100644 --- a/tutorial-production-hosting.html +++ b/tutorial-production-hosting.html @@ -211,13 +211,13 @@ via local-shields-io-production.yml (see Home

Modules

Classes

Tutorials

Global

+

Home

Modules

Classes

Tutorials

Global


diff --git a/tutorial-releases.html b/tutorial-releases.html index 01bfe644c7..821dcdfb54 100644 --- a/tutorial-releases.html +++ b/tutorial-releases.html @@ -73,13 +73,13 @@
diff --git a/tutorial-self-hosting.html b/tutorial-self-hosting.html index 21c621294d..dcd0e818b5 100644 --- a/tutorial-self-hosting.html +++ b/tutorial-self-hosting.html @@ -174,13 +174,13 @@ Set public.requireCloudflare: true.


diff --git a/tutorial-server-secrets.html b/tutorial-server-secrets.html index 1abde7f2a0..29c5e3b1b7 100644 --- a/tutorial-server-secrets.html +++ b/tutorial-server-secrets.html @@ -316,13 +316,13 @@ and create an API key for the YouTube Data API v3.


diff --git a/tutorial-service-tests.html b/tutorial-service-tests.html index 5efb51df59..76e2e09ed2 100644 --- a/tutorial-service-tests.html +++ b/tutorial-service-tests.html @@ -240,13 +240,13 @@ comment there instead.


diff --git a/tutorial-static-badges.html b/tutorial-static-badges.html index a4c64d035b..ba68229ccf 100644 --- a/tutorial-static-badges.html +++ b/tutorial-static-badges.html @@ -36,13 +36,13 @@