-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features & updated documentation (#78)
* New features & updated documentation # New features added * Ability to report on sitemap crawl errors in returned results. Added a new "errors" property in the `SitesData` object * Added an option to set a concurrency limit to rate limit sitemap crawling. Useful when crawling sitemaps with multiple children to avoid getting blocked by firewalls. #77 * Added an option to have retry requests upon failure and to set the number of maximum retries per crawl. # Documentation changes * Updated documentation to include all the new features described above. Co-Authored-By: Panagiotis Tzamtzis <[email protected]> Co-Authored-By: PanagiotisTzamtzis <[email protected]> * Fix for error on the main sitemap In this case the errors object in the results was not an ErrorsDataArray but a single ErrorsData * Bug fixes * Error logging improvements with more details for `UnknownStateErrors` & errors when parsing the parent sitemap * Retries option was not working when `debug` was set to false * Bug fix * Console.log statement was getting triggered when `debug` option was set to false * Update src/examples/index.js * 3.2.0 * Cleaning up, changing error to errors, updating Typescript, removing returnErrors option * Removing returnErrors option * quotes fix * Updates * Fixing errors array * updating tests Co-authored-by: PanagiotisTzamtzis <[email protected]> Co-authored-by: Sean Thomas Burke <[email protected]> Co-authored-by: Sean Thomas Burke <[email protected]>
- Loading branch information
1 parent
d20782d
commit 19f9e12
Showing
11 changed files
with
304 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
export interface SitemapperResponse { | ||
url: string; | ||
sites: string[]; | ||
url: string; | ||
sites: string[]; | ||
errors: SitemapperErrorData[]; | ||
} | ||
|
||
export interface SitemapperErrorData { | ||
type: string; | ||
url: string; | ||
retries: number; | ||
} | ||
|
||
export interface SitemapperOptions { | ||
url?: string; | ||
timeout?: number; | ||
requestHeaders?: {[name: string]: string}; | ||
url?: string; | ||
timeout?: number; | ||
requestHeaders?: {[name: string]: string}; | ||
debug?: boolean; | ||
concurrency?: number; | ||
retries?: number; | ||
} | ||
|
||
declare class Sitemapper { | ||
|
||
timeout: number; | ||
timeout: number; | ||
|
||
constructor(options: SitemapperOptions) | ||
constructor(options: SitemapperOptions) | ||
|
||
/** | ||
* Gets the sites from a sitemap.xml with a given URL | ||
* | ||
* @param url URL to the sitemap.xml file | ||
*/ | ||
fetch(url?: string): Promise<SitemapperResponse>; | ||
/** | ||
* Gets the sites from a sitemap.xml with a given URL | ||
* | ||
* @param url URL to the sitemap.xml file | ||
*/ | ||
fetch(url?: string): Promise<SitemapperResponse>; | ||
} | ||
|
||
export default Sitemapper; |
Oops, something went wrong.