Comparing version 6.3.6 to 6.4.0
36
api.md
# API | ||
- [SitemapStream](#sitemapstream) | ||
- [XMLToSitemapItemStream](#XMLToSitemapItemStream) | ||
- [sitemapAndIndexStream](#sitemapandindexstream) | ||
- [createSitemapsAndIndex](#createsitemapsandindex) | ||
- [SitemapIndexStream](#SitemapIndexStream) | ||
- [xmlLint](#xmllint) | ||
- [parseSitemap](#parsesitemap) | ||
- [lineSeparatedURLsToSitemapOptions](#lineseparatedurlstositemapoptions) | ||
- [streamToPromise](#streamtopromise) | ||
- [ObjectStreamToJSON](#objectstreamtojson) | ||
- [SitemapItemStream](#SitemapItemStream) | ||
- [Sitemap Item Options](#sitemap-item-options) | ||
- [SitemapImage](#sitemapimage) | ||
- [VideoItem](#videoitem) | ||
- [LinkItem](#linkitem) | ||
- [NewsItem](#newsitem) | ||
- [API](#api) | ||
- [SitemapStream](#sitemapstream) | ||
- [XMLToSitemapItemStream](#xmltositemapitemstream) | ||
- [sitemapAndIndexStream](#sitemapandindexstream) | ||
- [createSitemapsAndIndex](#createsitemapsandindex) | ||
- [SitemapIndexStream](#sitemapindexstream) | ||
- [xmlLint](#xmllint) | ||
- [parseSitemap](#parsesitemap) | ||
- [lineSeparatedURLsToSitemapOptions](#lineseparatedurlstositemapoptions) | ||
- [streamToPromise](#streamtopromise) | ||
- [ObjectStreamToJSON](#objectstreamtojson) | ||
- [SitemapItemStream](#sitemapitemstream) | ||
- [Sitemap Item Options](#sitemap-item-options) | ||
- [SitemapImage](#sitemapimage) | ||
- [VideoItem](#videoitem) | ||
- [ILinkItem](#ilinkitem) | ||
- [NewsItem](#newsitem) | ||
@@ -35,3 +36,4 @@ ## SitemapStream | ||
// custom: ['xmlns:custom="https://example.com"'] | ||
} | ||
}, | ||
errorHandler: undefined // defaults to a standard errorLogger that logs to console or throws if the errorLevel is set to throw | ||
}) | ||
@@ -38,0 +40,0 @@ const readable = // a readable stream of objects |
# Changelog | ||
## 6.4.0 | ||
- added support for content_loc parsing #347 and uploader info attr | ||
- added error handler option to sitemapstream #349 Thanks @marcoreni | ||
## 6.3.6 | ||
@@ -4,0 +9,0 @@ |
@@ -114,3 +114,3 @@ "use strict"; | ||
if (video.uploader) { | ||
this.push(sitemap_xml_1.element(types_1.TagNames['video:uploader'], video.uploader)); | ||
this.push(sitemap_xml_1.element(types_1.TagNames['video:uploader'], attrBuilder(video, 'uploader:info'), video.uploader)); | ||
} | ||
@@ -117,0 +117,0 @@ if (video.platform) { |
@@ -145,2 +145,5 @@ "use strict"; | ||
break; | ||
case types_1.TagNames['video:content_loc']: | ||
currentVideo.content_loc = text; | ||
break; | ||
case types_1.TagNames['video:requires_subscription']: | ||
@@ -374,2 +377,10 @@ if (types_1.isValidYesNo(text)) { | ||
break; | ||
case types_1.TagNames['video:uploader']: | ||
if (attr.name === 'info') { | ||
currentVideo['uploader:info'] = attr.value; | ||
} | ||
else { | ||
this.logger('log', 'unhandled attr for video:uploader', attr.name); | ||
} | ||
break; | ||
default: | ||
@@ -376,0 +387,0 @@ this.logger('log', 'unhandled attr', currentTag, attr.name); |
/// <reference types="node" /> | ||
import { Transform, TransformOptions, TransformCallback, Readable } from 'stream'; | ||
import { SitemapItemLoose, ErrorLevel } from './types'; | ||
import { SitemapItemLoose, ErrorLevel, ErrorHandler } from './types'; | ||
export declare const stylesheetInclude: (url: string) => string; | ||
@@ -19,2 +19,3 @@ export interface NSArgs { | ||
xslUrl?: string; | ||
errorHandler?: ErrorHandler; | ||
} | ||
@@ -34,2 +35,3 @@ /** | ||
xslUrl?: string; | ||
errorHandler?: ErrorHandler; | ||
private smiStream; | ||
@@ -36,0 +38,0 @@ lastmodDateOnly: boolean; |
@@ -65,2 +65,3 @@ "use strict"; | ||
this.level = opts.level || types_1.ErrorLevel.WARN; | ||
this.errorHandler = opts.errorHandler; | ||
this.smiStream = new sitemap_item_stream_1.SitemapItemStream({ level: opts.level }); | ||
@@ -77,3 +78,3 @@ this.smiStream.on('data', (data) => this.push(data)); | ||
} | ||
this.smiStream.write(utils_1.validateSMIOptions(utils_1.normalizeURL(item, this.hostname, this.lastmodDateOnly), this.level)); | ||
this.smiStream.write(utils_1.validateSMIOptions(utils_1.normalizeURL(item, this.hostname, this.lastmodDateOnly), this.level, this.errorHandler)); | ||
callback(); | ||
@@ -80,0 +81,0 @@ } |
@@ -181,2 +181,8 @@ /// <reference types="node" /> | ||
gallery_loc?: string; | ||
/** | ||
* [Optional] Specifies the URL of a webpage with additional information about this uploader. This URL must be in the same domain as the <loc> tag. | ||
* @see https://developers.google.com/search/docs/advanced/sitemaps/video-sitemaps | ||
* @example http://www.example.com/users/grillymcgrillerson | ||
*/ | ||
'uploader:info'?: string; | ||
'gallery_loc:title'?: string; | ||
@@ -332,2 +338,3 @@ /** | ||
} | ||
export declare type ErrorHandler = (error: Error, level: ErrorLevel) => void; | ||
export declare enum TagNames { | ||
@@ -334,0 +341,0 @@ url = "url", |
/// <reference types="node" /> | ||
import { Readable, ReadableOptions } from 'stream'; | ||
import { SitemapItem, ErrorLevel, SitemapItemLoose } from './types'; | ||
declare function handleError(error: Error, level: ErrorLevel): void; | ||
import { SitemapItem, ErrorLevel, SitemapItemLoose, ErrorHandler } from './types'; | ||
/** | ||
@@ -11,3 +10,3 @@ * Verifies all data passed in will comply with sitemap spec. | ||
*/ | ||
export declare function validateSMIOptions(conf: SitemapItem, level?: ErrorLevel, errorHandler?: typeof handleError): SitemapItem; | ||
export declare function validateSMIOptions(conf: SitemapItem, level?: ErrorLevel, errorHandler?: ErrorHandler): SitemapItem; | ||
/** | ||
@@ -58,2 +57,1 @@ * Combines multiple streams into one | ||
export declare function normalizeURL(elem: string | SitemapItemLoose, hostname?: string, lastmodDateOnly?: boolean): SitemapItem; | ||
export {}; |
{ | ||
"name": "sitemap", | ||
"version": "6.3.6", | ||
"version": "6.4.0", | ||
"description": "Sitemap-generating lib/cli", | ||
@@ -158,3 +158,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/node": "^14.14.25", | ||
"@types/node": "^14.14.28", | ||
"@types/sax": "^1.2.1", | ||
@@ -165,18 +165,18 @@ "arg": "^5.0.0", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.13", | ||
"@babel/core": "^7.12.16", | ||
"@babel/plugin-proposal-class-properties": "^7.12.13", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13", | ||
"@babel/plugin-proposal-optional-chaining": "^7.12.13", | ||
"@babel/plugin-transform-typescript": "^7.12.13", | ||
"@babel/preset-env": "^7.12.13", | ||
"@babel/preset-typescript": "^7.12.13", | ||
"@babel/plugin-proposal-optional-chaining": "^7.12.16", | ||
"@babel/plugin-transform-typescript": "^7.12.16", | ||
"@babel/preset-env": "^7.12.16", | ||
"@babel/preset-typescript": "^7.12.16", | ||
"@types/jest": "^26.0.20", | ||
"@typescript-eslint/eslint-plugin": "^4.15.0", | ||
"@typescript-eslint/parser": "^4.15.0", | ||
"@typescript-eslint/eslint-plugin": "^4.15.1", | ||
"@typescript-eslint/parser": "^4.15.1", | ||
"babel-eslint": "^10.1.0", | ||
"babel-polyfill": "^6.26.0", | ||
"concurrently": "^5.3.0", | ||
"eslint": "^7.19.0", | ||
"eslint": "^7.20.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-jest": "^24.1.5", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
@@ -183,0 +183,0 @@ "express": "^4.17.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160183
2824
Updated@types/node@^14.14.28