diff --git a/docs/integrations/url-reader.md b/docs/plugins/url-reader.md similarity index 96% rename from docs/integrations/url-reader.md rename to docs/plugins/url-reader.md index a2108d5c71..41aba98a66 100644 --- a/docs/integrations/url-reader.md +++ b/docs/plugins/url-reader.md @@ -24,8 +24,8 @@ package provides a dedicated API for reading from such URL based remote locations like GitHub, GitLab, Bitbucket, Google Cloud Storage, etc. This is commonly referred to as "URL Reader". It takes care of making authenticated requests to the remote host so that private files can be read securely. If users -have [GitHub App based authentication](../plugins/github-apps.md) set up, URL -Reader even refreshes the token, to avoid reaching the GitHub API rate limit. +have [GitHub App based authentication](github-apps.md) set up, URL Reader even +refreshes the token, to avoid reaching the GitHub API rate limit. As a result, plugin authors do not have to worry about any of these problems when trying to read files. @@ -61,6 +61,14 @@ The generic interface of a URL Reader instance looks like this. export type UrlReader = { /* Used to read a single file and return its content. */ read(url: string): Promise; + /** + * A replacement for the read method that supports options and complex responses. + * + * Use this whenever it is available, as the read method will be deprecated and + * eventually removed in the future. + */ + readUrl?(url: string, options?: ReadUrlOptions): Promise; + /* Used to read a file tree and download as a directory. */ readTree(url: string, options?: ReadTreeOptions): Promise; /* Used to search a file in a tree. */ diff --git a/microsite/sidebars.json b/microsite/sidebars.json index 5530fc6f61..5999524073 100644 --- a/microsite/sidebars.json +++ b/microsite/sidebars.json @@ -149,8 +149,7 @@ "type": "subcategory", "label": "LDAP", "ids": ["integrations/ldap/org"] - }, - "integrations/url-reader" + } ], "Plugins": [ "plugins/index", @@ -167,7 +166,8 @@ "plugins/proxying", "plugins/backend-plugin", "plugins/call-existing-api", - "plugins/github-apps" + "plugins/github-apps", + "plugins/url-reader" ] }, { diff --git a/mkdocs.yml b/mkdocs.yml index 47b7084146..4d984e63e3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -98,7 +98,6 @@ nav: - Locations: 'integrations/google-cloud-storage/locations.md' - LDAP: - Org Data: 'integrations/ldap/org.md' - - URL Reader: 'integrations/url-reader.md' - Plugins: - Intro to plugins: 'plugins/index.md' - Existing plugins: 'plugins/existing-plugins.md' @@ -113,6 +112,7 @@ nav: - Backend plugin: 'plugins/backend-plugin.md' - Call existing API: 'plugins/call-existing-api.md' - GitHub Apps for Backend Authentication: 'plugins/github-apps.md' + - URL Reader: 'plugins/url-reader.md' - Testing: - Testing with Jest: 'plugins/testing.md' - Publishing: