@utilix-tech/sdk 0.93.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +19 -4
- package/dist/{chunk-XAPHAUPI.js → chunk-G5NUC5MV.js} +52 -1
- package/dist/{chunk-K3B4JTHN.js → chunk-K242OOF4.js} +111 -1
- package/dist/{chunk-ZWFZRDQ4.js → chunk-YSS4VVZU.js} +112 -1
- package/dist/index.cjs +272 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{media-DF8BS-iA.d.ts → media-C8Y67lUI.d.cts} +62 -2
- package/dist/{media-DF8BS-iA.d.cts → media-C8Y67lUI.d.ts} +62 -2
- package/dist/{network-9j5aKpoR.d.cts → network-B6fQrsCc.d.cts} +47 -2
- package/dist/{network-9j5aKpoR.d.ts → network-B6fQrsCc.d.ts} +47 -2
- package/dist/tools/media.cjs +111 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/network.cjs +110 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/units.cjs +51 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-DnWrOTSV.d.ts → units-BBzv0VIt.d.cts} +51 -2
- package/dist/{units-DnWrOTSV.d.cts → units-BBzv0VIt.d.ts} +51 -2
- package/package.json +2 -2
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* - robots-meta-tag-builder: buildRobotsMetaTag, parseRobotsMetaTag
|
|
35
35
|
* - cookie-size-budget-calculator: calculateCookieSizeBudget
|
|
36
36
|
* - clear-site-data-header-builder: buildClearSiteData, parseClearSiteData
|
|
37
|
+
* - alt-svc-header-builder: buildAltSvcHeader, parseAltSvcHeader
|
|
37
38
|
*/
|
|
38
39
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
39
40
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -1173,9 +1174,51 @@ declare function buildClearSiteData(directives: string[]): ClearSiteDataResult |
|
|
|
1173
1174
|
declare function parseClearSiteData(raw: string): ClearSiteDataResult | {
|
|
1174
1175
|
error: string;
|
|
1175
1176
|
};
|
|
1177
|
+
interface AltSvcAlternative {
|
|
1178
|
+
protocolId: string;
|
|
1179
|
+
host?: string;
|
|
1180
|
+
port: number;
|
|
1181
|
+
maxAge?: number;
|
|
1182
|
+
persist?: boolean;
|
|
1183
|
+
}
|
|
1184
|
+
interface AltSvcEntry {
|
|
1185
|
+
protocolId: string;
|
|
1186
|
+
authority: string;
|
|
1187
|
+
maxAge: number;
|
|
1188
|
+
persist: boolean;
|
|
1189
|
+
note: string;
|
|
1190
|
+
}
|
|
1191
|
+
interface AltSvcResult {
|
|
1192
|
+
header: string;
|
|
1193
|
+
headerValue: string;
|
|
1194
|
+
entries: AltSvcEntry[];
|
|
1195
|
+
cleared: boolean;
|
|
1196
|
+
warnings: string[];
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Build an `Alt-Svc` response-header value (RFC 7838) from one or more
|
|
1200
|
+
* alternative services, de-duplicating identical protocol-id/authority
|
|
1201
|
+
* pairs and attaching a plain-English note for each well-known protocol-id
|
|
1202
|
+
* (h3, h2, h2c, etc.).
|
|
1203
|
+
*/
|
|
1204
|
+
declare function buildAltSvcHeader(alternatives: AltSvcAlternative[]): AltSvcResult | {
|
|
1205
|
+
error: string;
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Parse an existing `Alt-Svc` header value (with or without a leading
|
|
1209
|
+
* `Alt-Svc:` label) into the same shape `buildAltSvcHeader` returns,
|
|
1210
|
+
* including the special "clear" value that cancels all previously cached
|
|
1211
|
+
* alternatives for the origin.
|
|
1212
|
+
*/
|
|
1213
|
+
declare function parseAltSvcHeader(raw: string): AltSvcResult | {
|
|
1214
|
+
error: string;
|
|
1215
|
+
};
|
|
1176
1216
|
|
|
1177
1217
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
1178
1218
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
1219
|
+
type network_AltSvcAlternative = AltSvcAlternative;
|
|
1220
|
+
type network_AltSvcEntry = AltSvcEntry;
|
|
1221
|
+
type network_AltSvcResult = AltSvcResult;
|
|
1179
1222
|
type network_AuthResultEntry = AuthResultEntry;
|
|
1180
1223
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
1181
1224
|
declare const network_CLIENT_HINTS: typeof CLIENT_HINTS;
|
|
@@ -1286,6 +1329,7 @@ declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIO
|
|
|
1286
1329
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
1287
1330
|
declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
|
|
1288
1331
|
declare const network_buildAcceptLanguage: typeof buildAcceptLanguage;
|
|
1332
|
+
declare const network_buildAltSvcHeader: typeof buildAltSvcHeader;
|
|
1289
1333
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
1290
1334
|
declare const network_buildClearSiteData: typeof buildClearSiteData;
|
|
1291
1335
|
declare const network_buildClientHints: typeof buildClientHints;
|
|
@@ -1328,6 +1372,7 @@ declare const network_listOpcodes: typeof listOpcodes;
|
|
|
1328
1372
|
declare const network_lookupCloseCode: typeof lookupCloseCode;
|
|
1329
1373
|
declare const network_lookupOpcode: typeof lookupOpcode;
|
|
1330
1374
|
declare const network_parseAcceptLanguage: typeof parseAcceptLanguage;
|
|
1375
|
+
declare const network_parseAltSvcHeader: typeof parseAltSvcHeader;
|
|
1331
1376
|
declare const network_parseClearSiteData: typeof parseClearSiteData;
|
|
1332
1377
|
declare const network_parseClientHintHeaders: typeof parseClientHintHeaders;
|
|
1333
1378
|
declare const network_parseContentDisposition: typeof parseContentDisposition;
|
|
@@ -1360,7 +1405,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
1360
1405
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
1361
1406
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
1362
1407
|
declare namespace network {
|
|
1363
|
-
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClearSiteDataDirective as ClearSiteDataDirective, type network_ClearSiteDataResult as ClearSiteDataResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGenerateGroup as RobotsGenerateGroup, type network_RobotsGenerateOptions as RobotsGenerateOptions, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClearSiteData as buildClearSiteData, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_generateRobotsTxt as generateRobotsTxt, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClearSiteData as parseClearSiteData, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1408
|
+
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AltSvcAlternative as AltSvcAlternative, type network_AltSvcEntry as AltSvcEntry, type network_AltSvcResult as AltSvcResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClearSiteDataDirective as ClearSiteDataDirective, type network_ClearSiteDataResult as ClearSiteDataResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGenerateGroup as RobotsGenerateGroup, type network_RobotsGenerateOptions as RobotsGenerateOptions, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildAltSvcHeader as buildAltSvcHeader, network_buildCacheControl as buildCacheControl, network_buildClearSiteData as buildClearSiteData, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_generateRobotsTxt as generateRobotsTxt, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseAltSvcHeader as parseAltSvcHeader, network_parseClearSiteData as parseClearSiteData, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1364
1409
|
}
|
|
1365
1410
|
|
|
1366
|
-
export { type
|
|
1411
|
+
export { type ManifestIssue as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, type CookieSizeEntry as D, DNS_RECORD_TYPES as E, type DnsRecord as F, type DnsRecordType as G, type DnsResponse as H, type EmailHeaderAnalysis as I, type EmailHeaderField as J, type GeoResult as K, HTTP_HEADERS as L, type HarEntry as M, type HarParseResult as N, type HarSummary as O, type HeaderCategory as P, type HstsOptions as Q, type HstsResult as R, type HttpHeader as S, type Ipv6AddressType as T, type Ipv6ParseResult as U, LINK_REL_VALUES as V, type LinkHeaderEntry as W, type LinkHeaderEntryInput as X, type LinkHeaderResult as Y, type LinkRel as Z, type ManifestIconInfo as _, type AcceptLanguageResult as a, buildCacheControl as a$, type ManifestValidationResult as a0, type MultipartParseResult as a1, type MultipartPart as a2, type OpcodeCategory as a3, type OpcodeInfo as a4, PERMISSIONS_POLICY_FEATURES as a5, type ParsedClientHint as a6, type ParsedDnsResult as a7, type ParsedGeoResult as a8, type PermissionsPolicyDirective as a9, STATUS_CODES as aA, type SameSiteValue as aB, type SecurityHeaderCheck as aC, type SecurityHeaderStatus as aD, type SecurityHeadersScorecard as aE, type SitemapIndexEntry as aF, type SitemapIssue as aG, type SitemapSplitFile as aH, type SitemapUrlEntry as aI, type SitemapValidationResult as aJ, type SplitSitemapOptions as aK, type SplitSitemapResult as aL, type StatusCode as aM, type UaDeviceType as aN, type UserAgentInfo as aO, type VaryHeaderEntry as aP, type VaryHeaderResult as aQ, type XContentTypeOptionsHeader as aR, type XContentTypeOptionsParseResult as aS, type XRobotsTagFlag as aT, type XRobotsTagOptions as aU, type XRobotsTagResult as aV, X_CONTENT_TYPE_OPTIONS_HEADER as aW, analyzeEmailHeaders as aX, assessContentTypeRisk as aY, buildAcceptLanguage as aZ, buildAltSvcHeader as a_, type PermissionsPolicyFeatureInput as aa, type PermissionsPolicyResult as ab, type PreferParameter as ac, type PreferPreference as ad, type PreferResult as ae, type PriorityResult as af, REFERRER_POLICY_VALUES as ag, type RangeEntry as ah, type RangeEntryInput as ai, type RangeHeaderResult as aj, type ReceivedHop as ak, type ReferrerPolicyEntry as al, type ReferrerPolicyResult as am, type ReferrerPolicyValue as an, type RetryAfterDateResult as ao, type RetryAfterResult as ap, type RetryAfterSecondsResult as aq, type RobotsGenerateGroup as ar, type RobotsGenerateOptions as as, type RobotsGroup as at, type RobotsIssue as au, type RobotsMetaTagFlag as av, type RobotsMetaTagOptions as aw, type RobotsMetaTagResult as ax, type RobotsRule as ay, type RobotsValidationResult as az, type AltSvcAlternative as b, searchStatusCodes as b$, buildClearSiteData as b0, buildClientHints as b1, buildContentDisposition as b2, buildDnsQueryUrl as b3, buildGeoUrl as b4, buildHsts as b5, buildLinkHeader as b6, buildMapUrl as b7, buildPermissionsPolicy as b8, buildPreferHeader as b9, listCloseCodes as bA, listOpcodes as bB, lookupCloseCode as bC, lookupOpcode as bD, parseAcceptLanguage as bE, parseAltSvcHeader as bF, parseClearSiteData as bG, parseClientHintHeaders as bH, parseContentDisposition as bI, parseContentRangeHeader as bJ, parseDnsResponse as bK, parseGeoResponse as bL, parseHar as bM, parseHsts as bN, parseIpv6Address as bO, parseMultipartFormData as bP, parsePermissionsPolicy as bQ, parsePreferHeader as bR, parsePriorityHeader as bS, parseRetryAfterHeader as bT, parseRobotsMetaTag as bU, parseUserAgent as bV, parseVaryHeader as bW, parseXContentTypeOptionsHeader as bX, parseXRobotsTag as bY, scoreSecurityHeaders as bZ, searchHeaders as b_, buildPriorityHeader as ba, buildRangeHeader as bb, buildReferrerPolicy as bc, buildRetryAfterHeader as bd, buildRobotsMetaTag as be, buildVaryHeader as bf, buildXContentTypeOptionsHeader as bg, buildXRobotsTag as bh, calculateCookieSizeBudget as bi, checkSetCookieHeader as bj, countryCodeToFlag as bk, extractMultipartBoundary as bl, formatCoordinates as bm, formatTtl as bn, generateRobotsTxt as bo, getByCategory as bp, getHeader as bq, getHeadersByCategory as br, getStatusByCategory as bs, getStatusCode as bt, isClientError as bu, isServerError as bv, isSuccess as bw, isValidIp as bx, isValidIpv4 as by, isValidIpv6 as bz, type AltSvcEntry as c, splitSitemap as c0, statusCodeToText as c1, typeNumberToLabel as c2, validateDomain as c3, validateHeaderName as c4, validateHeaderValue as c5, validateManifest as c6, validateRobotsTxt as c7, validateSitemap as c8, type AltSvcResult as d, type AuthResultEntry as e, type CacheControlDirective as f, type CacheControlOptions as g, type CacheControlResult as h, type ClearSiteDataDirective as i, type ClearSiteDataResult as j, type ClientHintDef as k, type ClientHintValueType as l, type ClientHintsBuildResult as m, network as n, type ClientHintsParseResult as o, type CloseCodeInfo as p, type CloseCodeRange as q, type ContentDispositionBuildOptions as r, type ContentDispositionBuildResult as s, type ContentDispositionParseResult as t, type ContentRangeResult as u, type ContentTypeRiskResult as v, type ContentTypeSniffRisk as w, type CookieAttributes as x, type CookieCheckResult as y, type CookieSizeBudgetResult as z };
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* - robots-meta-tag-builder: buildRobotsMetaTag, parseRobotsMetaTag
|
|
35
35
|
* - cookie-size-budget-calculator: calculateCookieSizeBudget
|
|
36
36
|
* - clear-site-data-header-builder: buildClearSiteData, parseClearSiteData
|
|
37
|
+
* - alt-svc-header-builder: buildAltSvcHeader, parseAltSvcHeader
|
|
37
38
|
*/
|
|
38
39
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
39
40
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -1173,9 +1174,51 @@ declare function buildClearSiteData(directives: string[]): ClearSiteDataResult |
|
|
|
1173
1174
|
declare function parseClearSiteData(raw: string): ClearSiteDataResult | {
|
|
1174
1175
|
error: string;
|
|
1175
1176
|
};
|
|
1177
|
+
interface AltSvcAlternative {
|
|
1178
|
+
protocolId: string;
|
|
1179
|
+
host?: string;
|
|
1180
|
+
port: number;
|
|
1181
|
+
maxAge?: number;
|
|
1182
|
+
persist?: boolean;
|
|
1183
|
+
}
|
|
1184
|
+
interface AltSvcEntry {
|
|
1185
|
+
protocolId: string;
|
|
1186
|
+
authority: string;
|
|
1187
|
+
maxAge: number;
|
|
1188
|
+
persist: boolean;
|
|
1189
|
+
note: string;
|
|
1190
|
+
}
|
|
1191
|
+
interface AltSvcResult {
|
|
1192
|
+
header: string;
|
|
1193
|
+
headerValue: string;
|
|
1194
|
+
entries: AltSvcEntry[];
|
|
1195
|
+
cleared: boolean;
|
|
1196
|
+
warnings: string[];
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Build an `Alt-Svc` response-header value (RFC 7838) from one or more
|
|
1200
|
+
* alternative services, de-duplicating identical protocol-id/authority
|
|
1201
|
+
* pairs and attaching a plain-English note for each well-known protocol-id
|
|
1202
|
+
* (h3, h2, h2c, etc.).
|
|
1203
|
+
*/
|
|
1204
|
+
declare function buildAltSvcHeader(alternatives: AltSvcAlternative[]): AltSvcResult | {
|
|
1205
|
+
error: string;
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Parse an existing `Alt-Svc` header value (with or without a leading
|
|
1209
|
+
* `Alt-Svc:` label) into the same shape `buildAltSvcHeader` returns,
|
|
1210
|
+
* including the special "clear" value that cancels all previously cached
|
|
1211
|
+
* alternatives for the origin.
|
|
1212
|
+
*/
|
|
1213
|
+
declare function parseAltSvcHeader(raw: string): AltSvcResult | {
|
|
1214
|
+
error: string;
|
|
1215
|
+
};
|
|
1176
1216
|
|
|
1177
1217
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
1178
1218
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
1219
|
+
type network_AltSvcAlternative = AltSvcAlternative;
|
|
1220
|
+
type network_AltSvcEntry = AltSvcEntry;
|
|
1221
|
+
type network_AltSvcResult = AltSvcResult;
|
|
1179
1222
|
type network_AuthResultEntry = AuthResultEntry;
|
|
1180
1223
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
1181
1224
|
declare const network_CLIENT_HINTS: typeof CLIENT_HINTS;
|
|
@@ -1286,6 +1329,7 @@ declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIO
|
|
|
1286
1329
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
1287
1330
|
declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
|
|
1288
1331
|
declare const network_buildAcceptLanguage: typeof buildAcceptLanguage;
|
|
1332
|
+
declare const network_buildAltSvcHeader: typeof buildAltSvcHeader;
|
|
1289
1333
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
1290
1334
|
declare const network_buildClearSiteData: typeof buildClearSiteData;
|
|
1291
1335
|
declare const network_buildClientHints: typeof buildClientHints;
|
|
@@ -1328,6 +1372,7 @@ declare const network_listOpcodes: typeof listOpcodes;
|
|
|
1328
1372
|
declare const network_lookupCloseCode: typeof lookupCloseCode;
|
|
1329
1373
|
declare const network_lookupOpcode: typeof lookupOpcode;
|
|
1330
1374
|
declare const network_parseAcceptLanguage: typeof parseAcceptLanguage;
|
|
1375
|
+
declare const network_parseAltSvcHeader: typeof parseAltSvcHeader;
|
|
1331
1376
|
declare const network_parseClearSiteData: typeof parseClearSiteData;
|
|
1332
1377
|
declare const network_parseClientHintHeaders: typeof parseClientHintHeaders;
|
|
1333
1378
|
declare const network_parseContentDisposition: typeof parseContentDisposition;
|
|
@@ -1360,7 +1405,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
1360
1405
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
1361
1406
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
1362
1407
|
declare namespace network {
|
|
1363
|
-
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClearSiteDataDirective as ClearSiteDataDirective, type network_ClearSiteDataResult as ClearSiteDataResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGenerateGroup as RobotsGenerateGroup, type network_RobotsGenerateOptions as RobotsGenerateOptions, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClearSiteData as buildClearSiteData, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_generateRobotsTxt as generateRobotsTxt, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClearSiteData as parseClearSiteData, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1408
|
+
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AltSvcAlternative as AltSvcAlternative, type network_AltSvcEntry as AltSvcEntry, type network_AltSvcResult as AltSvcResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClearSiteDataDirective as ClearSiteDataDirective, type network_ClearSiteDataResult as ClearSiteDataResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGenerateGroup as RobotsGenerateGroup, type network_RobotsGenerateOptions as RobotsGenerateOptions, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildAltSvcHeader as buildAltSvcHeader, network_buildCacheControl as buildCacheControl, network_buildClearSiteData as buildClearSiteData, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_generateRobotsTxt as generateRobotsTxt, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseAltSvcHeader as parseAltSvcHeader, network_parseClearSiteData as parseClearSiteData, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1364
1409
|
}
|
|
1365
1410
|
|
|
1366
|
-
export { type
|
|
1411
|
+
export { type ManifestIssue as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, type CookieSizeEntry as D, DNS_RECORD_TYPES as E, type DnsRecord as F, type DnsRecordType as G, type DnsResponse as H, type EmailHeaderAnalysis as I, type EmailHeaderField as J, type GeoResult as K, HTTP_HEADERS as L, type HarEntry as M, type HarParseResult as N, type HarSummary as O, type HeaderCategory as P, type HstsOptions as Q, type HstsResult as R, type HttpHeader as S, type Ipv6AddressType as T, type Ipv6ParseResult as U, LINK_REL_VALUES as V, type LinkHeaderEntry as W, type LinkHeaderEntryInput as X, type LinkHeaderResult as Y, type LinkRel as Z, type ManifestIconInfo as _, type AcceptLanguageResult as a, buildCacheControl as a$, type ManifestValidationResult as a0, type MultipartParseResult as a1, type MultipartPart as a2, type OpcodeCategory as a3, type OpcodeInfo as a4, PERMISSIONS_POLICY_FEATURES as a5, type ParsedClientHint as a6, type ParsedDnsResult as a7, type ParsedGeoResult as a8, type PermissionsPolicyDirective as a9, STATUS_CODES as aA, type SameSiteValue as aB, type SecurityHeaderCheck as aC, type SecurityHeaderStatus as aD, type SecurityHeadersScorecard as aE, type SitemapIndexEntry as aF, type SitemapIssue as aG, type SitemapSplitFile as aH, type SitemapUrlEntry as aI, type SitemapValidationResult as aJ, type SplitSitemapOptions as aK, type SplitSitemapResult as aL, type StatusCode as aM, type UaDeviceType as aN, type UserAgentInfo as aO, type VaryHeaderEntry as aP, type VaryHeaderResult as aQ, type XContentTypeOptionsHeader as aR, type XContentTypeOptionsParseResult as aS, type XRobotsTagFlag as aT, type XRobotsTagOptions as aU, type XRobotsTagResult as aV, X_CONTENT_TYPE_OPTIONS_HEADER as aW, analyzeEmailHeaders as aX, assessContentTypeRisk as aY, buildAcceptLanguage as aZ, buildAltSvcHeader as a_, type PermissionsPolicyFeatureInput as aa, type PermissionsPolicyResult as ab, type PreferParameter as ac, type PreferPreference as ad, type PreferResult as ae, type PriorityResult as af, REFERRER_POLICY_VALUES as ag, type RangeEntry as ah, type RangeEntryInput as ai, type RangeHeaderResult as aj, type ReceivedHop as ak, type ReferrerPolicyEntry as al, type ReferrerPolicyResult as am, type ReferrerPolicyValue as an, type RetryAfterDateResult as ao, type RetryAfterResult as ap, type RetryAfterSecondsResult as aq, type RobotsGenerateGroup as ar, type RobotsGenerateOptions as as, type RobotsGroup as at, type RobotsIssue as au, type RobotsMetaTagFlag as av, type RobotsMetaTagOptions as aw, type RobotsMetaTagResult as ax, type RobotsRule as ay, type RobotsValidationResult as az, type AltSvcAlternative as b, searchStatusCodes as b$, buildClearSiteData as b0, buildClientHints as b1, buildContentDisposition as b2, buildDnsQueryUrl as b3, buildGeoUrl as b4, buildHsts as b5, buildLinkHeader as b6, buildMapUrl as b7, buildPermissionsPolicy as b8, buildPreferHeader as b9, listCloseCodes as bA, listOpcodes as bB, lookupCloseCode as bC, lookupOpcode as bD, parseAcceptLanguage as bE, parseAltSvcHeader as bF, parseClearSiteData as bG, parseClientHintHeaders as bH, parseContentDisposition as bI, parseContentRangeHeader as bJ, parseDnsResponse as bK, parseGeoResponse as bL, parseHar as bM, parseHsts as bN, parseIpv6Address as bO, parseMultipartFormData as bP, parsePermissionsPolicy as bQ, parsePreferHeader as bR, parsePriorityHeader as bS, parseRetryAfterHeader as bT, parseRobotsMetaTag as bU, parseUserAgent as bV, parseVaryHeader as bW, parseXContentTypeOptionsHeader as bX, parseXRobotsTag as bY, scoreSecurityHeaders as bZ, searchHeaders as b_, buildPriorityHeader as ba, buildRangeHeader as bb, buildReferrerPolicy as bc, buildRetryAfterHeader as bd, buildRobotsMetaTag as be, buildVaryHeader as bf, buildXContentTypeOptionsHeader as bg, buildXRobotsTag as bh, calculateCookieSizeBudget as bi, checkSetCookieHeader as bj, countryCodeToFlag as bk, extractMultipartBoundary as bl, formatCoordinates as bm, formatTtl as bn, generateRobotsTxt as bo, getByCategory as bp, getHeader as bq, getHeadersByCategory as br, getStatusByCategory as bs, getStatusCode as bt, isClientError as bu, isServerError as bv, isSuccess as bw, isValidIp as bx, isValidIpv4 as by, isValidIpv6 as bz, type AltSvcEntry as c, splitSitemap as c0, statusCodeToText as c1, typeNumberToLabel as c2, validateDomain as c3, validateHeaderName as c4, validateHeaderValue as c5, validateManifest as c6, validateRobotsTxt as c7, validateSitemap as c8, type AltSvcResult as d, type AuthResultEntry as e, type CacheControlDirective as f, type CacheControlOptions as g, type CacheControlResult as h, type ClearSiteDataDirective as i, type ClearSiteDataResult as j, type ClientHintDef as k, type ClientHintValueType as l, type ClientHintsBuildResult as m, network as n, type ClientHintsParseResult as o, type CloseCodeInfo as p, type CloseCodeRange as q, type ContentDispositionBuildOptions as r, type ContentDispositionBuildResult as s, type ContentDispositionParseResult as t, type ContentRangeResult as u, type ContentTypeRiskResult as v, type ContentTypeSniffRisk as w, type CookieAttributes as x, type CookieCheckResult as y, type CookieSizeBudgetResult as z };
|
package/dist/tools/media.cjs
CHANGED
|
@@ -1491,6 +1491,116 @@ function readMidiInfo(bytes) {
|
|
|
1491
1491
|
tracks
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
|
+
var PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
1495
|
+
var PNG_CRC_TABLE = null;
|
|
1496
|
+
function getPngCrcTable() {
|
|
1497
|
+
if (PNG_CRC_TABLE) return PNG_CRC_TABLE;
|
|
1498
|
+
const table = new Uint32Array(256);
|
|
1499
|
+
for (let n = 0; n < 256; n++) {
|
|
1500
|
+
let c = n;
|
|
1501
|
+
for (let k = 0; k < 8; k++) {
|
|
1502
|
+
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
1503
|
+
}
|
|
1504
|
+
table[n] = c;
|
|
1505
|
+
}
|
|
1506
|
+
PNG_CRC_TABLE = table;
|
|
1507
|
+
return table;
|
|
1508
|
+
}
|
|
1509
|
+
function pngCrc32(bytes) {
|
|
1510
|
+
const table = getPngCrcTable();
|
|
1511
|
+
let crc = 4294967295;
|
|
1512
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1513
|
+
crc = table[(crc ^ bytes[i]) & 255] ^ crc >>> 8;
|
|
1514
|
+
}
|
|
1515
|
+
return (crc ^ 4294967295) >>> 0;
|
|
1516
|
+
}
|
|
1517
|
+
function pad2(n) {
|
|
1518
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
1519
|
+
}
|
|
1520
|
+
function readPngChunks(bytes) {
|
|
1521
|
+
if (bytes.length < 8) return { error: "File too small to be a valid PNG file" };
|
|
1522
|
+
for (let i = 0; i < 8; i++) {
|
|
1523
|
+
if (bytes[i] !== PNG_SIGNATURE[i]) return { error: "Not a valid PNG file (bad 8-byte signature)" };
|
|
1524
|
+
}
|
|
1525
|
+
const chunks = [];
|
|
1526
|
+
const textChunks = [];
|
|
1527
|
+
let header = null;
|
|
1528
|
+
let physicalDimensions = null;
|
|
1529
|
+
let gamma = null;
|
|
1530
|
+
let lastModified = null;
|
|
1531
|
+
let isAnimated = false;
|
|
1532
|
+
let offset = 8;
|
|
1533
|
+
while (offset + 8 <= bytes.length) {
|
|
1534
|
+
const dataLength = readU32BE(bytes, offset);
|
|
1535
|
+
const type = String.fromCharCode(bytes[offset + 4], bytes[offset + 5], bytes[offset + 6], bytes[offset + 7]);
|
|
1536
|
+
const dataStart = offset + 8;
|
|
1537
|
+
const dataEnd = dataStart + dataLength;
|
|
1538
|
+
const crcOffset = dataEnd;
|
|
1539
|
+
if (crcOffset + 4 > bytes.length) {
|
|
1540
|
+
return { error: `Truncated chunk "${type}" at offset ${offset}` };
|
|
1541
|
+
}
|
|
1542
|
+
const data = bytes.subarray(dataStart, dataEnd);
|
|
1543
|
+
const expectedCrc = readU32BE(bytes, crcOffset);
|
|
1544
|
+
const actualCrc = pngCrc32(bytes.subarray(offset + 4, dataEnd));
|
|
1545
|
+
const firstChar = type.charCodeAt(0);
|
|
1546
|
+
const critical = firstChar >= 65 && firstChar <= 90;
|
|
1547
|
+
chunks.push({ type, offset, dataLength, crcValid: actualCrc === expectedCrc, critical });
|
|
1548
|
+
if (type === "IHDR" && data.length >= 13) {
|
|
1549
|
+
const colorTypeNum = data[9];
|
|
1550
|
+
header = {
|
|
1551
|
+
width: readU32BE(data, 0),
|
|
1552
|
+
height: readU32BE(data, 4),
|
|
1553
|
+
bitDepth: data[8],
|
|
1554
|
+
colorType: PNG_COLOR_TYPES[colorTypeNum] ?? "unknown",
|
|
1555
|
+
hasAlpha: colorTypeNum === 4 || colorTypeNum === 6,
|
|
1556
|
+
interlace: data[12] === 1
|
|
1557
|
+
};
|
|
1558
|
+
} else if (type === "tEXt") {
|
|
1559
|
+
const nullIdx = data.indexOf(0);
|
|
1560
|
+
if (nullIdx !== -1) {
|
|
1561
|
+
textChunks.push({
|
|
1562
|
+
keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"),
|
|
1563
|
+
text: Buffer.from(data.subarray(nullIdx + 1)).toString("latin1"),
|
|
1564
|
+
compressed: false
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
} else if (type === "zTXt" || type === "iTXt") {
|
|
1568
|
+
const nullIdx = data.indexOf(0);
|
|
1569
|
+
if (nullIdx !== -1) {
|
|
1570
|
+
textChunks.push({ keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"), text: null, compressed: true });
|
|
1571
|
+
}
|
|
1572
|
+
} else if (type === "pHYs" && data.length >= 9) {
|
|
1573
|
+
physicalDimensions = {
|
|
1574
|
+
pixelsPerUnitX: readU32BE(data, 0),
|
|
1575
|
+
pixelsPerUnitY: readU32BE(data, 4),
|
|
1576
|
+
unit: data[8] === 1 ? "meter" : "unknown"
|
|
1577
|
+
};
|
|
1578
|
+
} else if (type === "gAMA" && data.length >= 4) {
|
|
1579
|
+
gamma = readU32BE(data, 0) / 1e5;
|
|
1580
|
+
} else if (type === "tIME" && data.length >= 7) {
|
|
1581
|
+
const year = data[0] << 8 | data[1];
|
|
1582
|
+
lastModified = `${year}-${pad2(data[2])}-${pad2(data[3])}T${pad2(data[4])}:${pad2(data[5])}:${pad2(data[6])}Z`;
|
|
1583
|
+
} else if (type === "acTL") {
|
|
1584
|
+
isAnimated = true;
|
|
1585
|
+
}
|
|
1586
|
+
offset = crcOffset + 4;
|
|
1587
|
+
if (type === "IEND") break;
|
|
1588
|
+
}
|
|
1589
|
+
if (chunks.length === 0) return { error: "No chunks found after the PNG signature" };
|
|
1590
|
+
if (!header) return { error: "Missing required IHDR chunk" };
|
|
1591
|
+
return {
|
|
1592
|
+
valid: true,
|
|
1593
|
+
fileSize: bytes.length,
|
|
1594
|
+
chunkCount: chunks.length,
|
|
1595
|
+
chunks,
|
|
1596
|
+
header,
|
|
1597
|
+
textChunks,
|
|
1598
|
+
physicalDimensions,
|
|
1599
|
+
gamma,
|
|
1600
|
+
lastModified,
|
|
1601
|
+
isAnimated
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1494
1604
|
|
|
1495
1605
|
exports.inspectGifFrames = inspectGifFrames;
|
|
1496
1606
|
exports.readExifData = readExifData;
|
|
@@ -1502,5 +1612,6 @@ exports.readMidiInfo = readMidiInfo;
|
|
|
1502
1612
|
exports.readPdfMetadata = readPdfMetadata;
|
|
1503
1613
|
exports.readPdfOutline = readPdfOutline;
|
|
1504
1614
|
exports.readPdfPageDimensions = readPdfPageDimensions;
|
|
1615
|
+
exports.readPngChunks = readPngChunks;
|
|
1505
1616
|
exports.readVideoInfo = readVideoInfo;
|
|
1506
1617
|
exports.readWavInfo = readWavInfo;
|
package/dist/tools/media.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, x as PngChunkEntry, y as PngChunkInfo, z as PngChunkInfoError, A as PngHeaderInfo, B as PngPhysicalDimensions, C as PngTextChunk, V as VideoInfo, D as VideoInfoError, W as WavInfo, H as WavInfoError, J as inspectGifFrames, K as readExifData, L as readFlacInfo, N as readIcoInfo, O as readId3Tags, Q as readImageInfo, R as readMidiInfo, S as readPdfMetadata, T as readPdfOutline, U as readPdfPageDimensions, X as readPngChunks, Y as readVideoInfo, Z as readWavInfo } from '../media-C8Y67lUI.cjs';
|
package/dist/tools/media.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, x as PngChunkEntry, y as PngChunkInfo, z as PngChunkInfoError, A as PngHeaderInfo, B as PngPhysicalDimensions, C as PngTextChunk, V as VideoInfo, D as VideoInfoError, W as WavInfo, H as WavInfoError, J as inspectGifFrames, K as readExifData, L as readFlacInfo, N as readIcoInfo, O as readId3Tags, Q as readImageInfo, R as readMidiInfo, S as readPdfMetadata, T as readPdfOutline, U as readPdfPageDimensions, X as readPngChunks, Y as readVideoInfo, Z as readWavInfo } from '../media-C8Y67lUI.js';
|
package/dist/tools/media.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfOutline, readPdfPageDimensions, readVideoInfo, readWavInfo } from '../chunk-
|
|
1
|
+
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfOutline, readPdfPageDimensions, readPngChunks, readVideoInfo, readWavInfo } from '../chunk-YSS4VVZU.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -3624,6 +3624,114 @@ function parseClearSiteData(raw) {
|
|
|
3624
3624
|
}
|
|
3625
3625
|
return buildClearSiteData(directives);
|
|
3626
3626
|
}
|
|
3627
|
+
var ALT_SVC_DEFAULT_MAX_AGE = 86400;
|
|
3628
|
+
var ALT_SVC_DEPRECATED_H3_DRAFTS = /* @__PURE__ */ new Set(["h3-29", "h3-27", "h3-25", "h3-24", "h3-23", "h3-22"]);
|
|
3629
|
+
var ALT_SVC_PROTOCOL_NOTES = {
|
|
3630
|
+
"h3": "HTTP/3 over QUIC, the current protocol ID clients should be offered.",
|
|
3631
|
+
"h3-29": 'An outdated HTTP/3 draft version (draft-29); modern clients only match "h3".',
|
|
3632
|
+
"h3-27": 'An outdated HTTP/3 draft version (draft-27); modern clients only match "h3".',
|
|
3633
|
+
"h3-25": 'An outdated HTTP/3 draft version (draft-25); modern clients only match "h3".',
|
|
3634
|
+
"h2": "HTTP/2 over TLS.",
|
|
3635
|
+
"h2c": "HTTP/2 over cleartext TCP; rarely advertised via Alt-Svc since it needs an out-of-band upgrade rather than ALPN negotiation.",
|
|
3636
|
+
"http/1.1": "Plain HTTP/1.1; advertising it via Alt-Svc is unusual since it is already the universal fallback."
|
|
3637
|
+
};
|
|
3638
|
+
function buildAltSvcHeader(alternatives) {
|
|
3639
|
+
if (!Array.isArray(alternatives) || alternatives.length === 0) {
|
|
3640
|
+
return { error: "At least one alternative service is required" };
|
|
3641
|
+
}
|
|
3642
|
+
const warnings = [];
|
|
3643
|
+
const entries = [];
|
|
3644
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3645
|
+
for (const alt of alternatives) {
|
|
3646
|
+
const protocolId = typeof alt.protocolId === "string" ? alt.protocolId.trim() : "";
|
|
3647
|
+
if (!protocolId) return { error: 'Each alternative needs a protocol-id (e.g. "h3")' };
|
|
3648
|
+
if (!Number.isInteger(alt.port) || alt.port < 1 || alt.port > 65535) {
|
|
3649
|
+
return { error: `Each alternative needs a valid port (1-65535), got ${JSON.stringify(alt.port)}` };
|
|
3650
|
+
}
|
|
3651
|
+
const host = alt.host?.trim();
|
|
3652
|
+
const authority = `${host ?? ""}:${alt.port}`;
|
|
3653
|
+
const maxAge = alt.maxAge !== void 0 ? alt.maxAge : ALT_SVC_DEFAULT_MAX_AGE;
|
|
3654
|
+
if (!Number.isFinite(maxAge) || maxAge < 0) return { error: "maxAge must be a non-negative number of seconds" };
|
|
3655
|
+
const persist = alt.persist === true;
|
|
3656
|
+
const dedupeKey = `${protocolId.toLowerCase()}|${authority.toLowerCase()}`;
|
|
3657
|
+
if (seen.has(dedupeKey)) {
|
|
3658
|
+
warnings.push(`duplicate alternative "${protocolId}=${JSON.stringify(authority)}" was removed`);
|
|
3659
|
+
continue;
|
|
3660
|
+
}
|
|
3661
|
+
seen.add(dedupeKey);
|
|
3662
|
+
if (maxAge === 0) warnings.push(`"${protocolId}" has ma=0, so clients should treat it as already expired`);
|
|
3663
|
+
if (persist && maxAge === 0) warnings.push(`"${protocolId}" sets persist=1 with ma=0, which is contradictory: the entry expires immediately`);
|
|
3664
|
+
if (ALT_SVC_DEPRECATED_H3_DRAFTS.has(protocolId.toLowerCase())) {
|
|
3665
|
+
warnings.push(`"${protocolId}" is an outdated HTTP/3 draft protocol-id; modern clients only match "h3"`);
|
|
3666
|
+
}
|
|
3667
|
+
const note = ALT_SVC_PROTOCOL_NOTES[protocolId.toLowerCase()] ?? `Advertises "${protocolId}" as an alternative protocol clients may switch to for this authority.`;
|
|
3668
|
+
entries.push({ protocolId, authority, maxAge, persist, note });
|
|
3669
|
+
}
|
|
3670
|
+
if (entries.length === 0) return { error: "At least one alternative service is required" };
|
|
3671
|
+
const headerValue = entries.map((e) => {
|
|
3672
|
+
let s = `${e.protocolId}="${e.authority}"; ma=${e.maxAge}`;
|
|
3673
|
+
if (e.persist) s += "; persist=1";
|
|
3674
|
+
return s;
|
|
3675
|
+
}).join(", ");
|
|
3676
|
+
return { header: `Alt-Svc: ${headerValue}`, headerValue, entries, cleared: false, warnings };
|
|
3677
|
+
}
|
|
3678
|
+
function altSvcSplitTopLevel(s, sep) {
|
|
3679
|
+
const out = [];
|
|
3680
|
+
let inQuotes = false;
|
|
3681
|
+
let current = "";
|
|
3682
|
+
for (const ch of s) {
|
|
3683
|
+
if (ch === '"') inQuotes = !inQuotes;
|
|
3684
|
+
if (ch === sep && !inQuotes) {
|
|
3685
|
+
out.push(current);
|
|
3686
|
+
current = "";
|
|
3687
|
+
} else {
|
|
3688
|
+
current += ch;
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
out.push(current);
|
|
3692
|
+
return out;
|
|
3693
|
+
}
|
|
3694
|
+
function parseAltSvcHeader(raw) {
|
|
3695
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
3696
|
+
const withoutLabel = raw.trim().replace(/^alt-svc:\s*/i, "");
|
|
3697
|
+
if (withoutLabel.toLowerCase() === "clear") {
|
|
3698
|
+
return { header: "Alt-Svc: clear", headerValue: "clear", entries: [], cleared: true, warnings: [] };
|
|
3699
|
+
}
|
|
3700
|
+
const parts = altSvcSplitTopLevel(withoutLabel, ",");
|
|
3701
|
+
const alternatives = [];
|
|
3702
|
+
for (const part of parts) {
|
|
3703
|
+
const trimmedPart = part.trim();
|
|
3704
|
+
if (!trimmedPart) continue;
|
|
3705
|
+
const eq = trimmedPart.indexOf("=");
|
|
3706
|
+
if (eq === -1) return { error: `Could not parse alternative: "${trimmedPart}"` };
|
|
3707
|
+
const protocolId = trimmedPart.slice(0, eq).trim();
|
|
3708
|
+
const rest = trimmedPart.slice(eq + 1).trim();
|
|
3709
|
+
const segments = altSvcSplitTopLevel(rest, ";").map((s) => s.trim());
|
|
3710
|
+
const authorityMatch = segments[0]?.match(/^"(.*)"$/);
|
|
3711
|
+
if (!authorityMatch) return { error: `Alternative "${protocolId}" is missing a quoted authority (e.g. ":443")` };
|
|
3712
|
+
const authority = authorityMatch[1];
|
|
3713
|
+
const colonIdx = authority.lastIndexOf(":");
|
|
3714
|
+
if (colonIdx === -1) return { error: `Alternative "${protocolId}" has an authority with no port: "${authority}"` };
|
|
3715
|
+
const host = authority.slice(0, colonIdx) || void 0;
|
|
3716
|
+
const portStr = authority.slice(colonIdx + 1);
|
|
3717
|
+
const port = Number(portStr);
|
|
3718
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) return { error: `Alternative "${protocolId}" has an invalid port: "${portStr}"` };
|
|
3719
|
+
let maxAge;
|
|
3720
|
+
let persist = false;
|
|
3721
|
+
for (const seg of segments.slice(1)) {
|
|
3722
|
+
const sepIdx = seg.indexOf("=");
|
|
3723
|
+
if (sepIdx === -1) continue;
|
|
3724
|
+
const key = seg.slice(0, sepIdx).trim().toLowerCase();
|
|
3725
|
+
const value = seg.slice(sepIdx + 1).trim();
|
|
3726
|
+
if (key === "ma") maxAge = Number(value);
|
|
3727
|
+
if (key === "persist") persist = value === "1";
|
|
3728
|
+
}
|
|
3729
|
+
if (maxAge !== void 0 && !Number.isFinite(maxAge)) return { error: `Alternative "${protocolId}" has a non-numeric ma value` };
|
|
3730
|
+
alternatives.push({ protocolId, host, port, maxAge, persist });
|
|
3731
|
+
}
|
|
3732
|
+
if (alternatives.length === 0) return { error: "No alternative services found" };
|
|
3733
|
+
return buildAltSvcHeader(alternatives);
|
|
3734
|
+
}
|
|
3627
3735
|
|
|
3628
3736
|
exports.CLIENT_HINTS = CLIENT_HINTS;
|
|
3629
3737
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
@@ -3636,6 +3744,7 @@ exports.X_CONTENT_TYPE_OPTIONS_HEADER = X_CONTENT_TYPE_OPTIONS_HEADER;
|
|
|
3636
3744
|
exports.analyzeEmailHeaders = analyzeEmailHeaders;
|
|
3637
3745
|
exports.assessContentTypeRisk = assessContentTypeRisk;
|
|
3638
3746
|
exports.buildAcceptLanguage = buildAcceptLanguage;
|
|
3747
|
+
exports.buildAltSvcHeader = buildAltSvcHeader;
|
|
3639
3748
|
exports.buildCacheControl = buildCacheControl;
|
|
3640
3749
|
exports.buildClearSiteData = buildClearSiteData;
|
|
3641
3750
|
exports.buildClientHints = buildClientHints;
|
|
@@ -3678,6 +3787,7 @@ exports.listOpcodes = listOpcodes;
|
|
|
3678
3787
|
exports.lookupCloseCode = lookupCloseCode;
|
|
3679
3788
|
exports.lookupOpcode = lookupOpcode;
|
|
3680
3789
|
exports.parseAcceptLanguage = parseAcceptLanguage;
|
|
3790
|
+
exports.parseAltSvcHeader = parseAltSvcHeader;
|
|
3681
3791
|
exports.parseClearSiteData = parseClearSiteData;
|
|
3682
3792
|
exports.parseClientHintHeaders = parseClientHintHeaders;
|
|
3683
3793
|
exports.parseContentDisposition = parseContentDisposition;
|
package/dist/tools/network.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS,
|
|
1
|
+
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AltSvcAlternative, c as AltSvcEntry, d as AltSvcResult, e as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, f as CacheControlDirective, g as CacheControlOptions, h as CacheControlResult, i as ClearSiteDataDirective, j as ClearSiteDataResult, k as ClientHintDef, l as ClientHintValueType, m as ClientHintsBuildResult, o as ClientHintsParseResult, p as CloseCodeInfo, q as CloseCodeRange, r as ContentDispositionBuildOptions, s as ContentDispositionBuildResult, t as ContentDispositionParseResult, u as ContentRangeResult, v as ContentTypeRiskResult, w as ContentTypeSniffRisk, x as CookieAttributes, y as CookieCheckResult, z as CookieSizeBudgetResult, D as CookieSizeEntry, E as DNS_RECORD_TYPES, F as DnsRecord, G as DnsRecordType, H as DnsResponse, I as EmailHeaderAnalysis, J as EmailHeaderField, K as GeoResult, L as HTTP_HEADERS, M as HarEntry, N as HarParseResult, O as HarSummary, P as HeaderCategory, Q as HstsOptions, R as HstsResult, S as HttpHeader, T as Ipv6AddressType, U as Ipv6ParseResult, V as LINK_REL_VALUES, W as LinkHeaderEntry, X as LinkHeaderEntryInput, Y as LinkHeaderResult, Z as LinkRel, _ as ManifestIconInfo, $ as ManifestIssue, a0 as ManifestValidationResult, a1 as MultipartParseResult, a2 as MultipartPart, a3 as OpcodeCategory, a4 as OpcodeInfo, a5 as PERMISSIONS_POLICY_FEATURES, a6 as ParsedClientHint, a7 as ParsedDnsResult, a8 as ParsedGeoResult, a9 as PermissionsPolicyDirective, aa as PermissionsPolicyFeatureInput, ab as PermissionsPolicyResult, ac as PreferParameter, ad as PreferPreference, ae as PreferResult, af as PriorityResult, ag as REFERRER_POLICY_VALUES, ah as RangeEntry, ai as RangeEntryInput, aj as RangeHeaderResult, ak as ReceivedHop, al as ReferrerPolicyEntry, am as ReferrerPolicyResult, an as ReferrerPolicyValue, ao as RetryAfterDateResult, ap as RetryAfterResult, aq as RetryAfterSecondsResult, ar as RobotsGenerateGroup, as as RobotsGenerateOptions, at as RobotsGroup, au as RobotsIssue, av as RobotsMetaTagFlag, aw as RobotsMetaTagOptions, ax as RobotsMetaTagResult, ay as RobotsRule, az as RobotsValidationResult, aA as STATUS_CODES, aB as SameSiteValue, aC as SecurityHeaderCheck, aD as SecurityHeaderStatus, aE as SecurityHeadersScorecard, aF as SitemapIndexEntry, aG as SitemapIssue, aH as SitemapSplitFile, aI as SitemapUrlEntry, aJ as SitemapValidationResult, aK as SplitSitemapOptions, aL as SplitSitemapResult, aM as StatusCode, aN as UaDeviceType, aO as UserAgentInfo, aP as VaryHeaderEntry, aQ as VaryHeaderResult, aR as XContentTypeOptionsHeader, aS as XContentTypeOptionsParseResult, aT as XRobotsTagFlag, aU as XRobotsTagOptions, aV as XRobotsTagResult, aW as X_CONTENT_TYPE_OPTIONS_HEADER, aX as analyzeEmailHeaders, aY as assessContentTypeRisk, aZ as buildAcceptLanguage, a_ as buildAltSvcHeader, a$ as buildCacheControl, b0 as buildClearSiteData, b1 as buildClientHints, b2 as buildContentDisposition, b3 as buildDnsQueryUrl, b4 as buildGeoUrl, b5 as buildHsts, b6 as buildLinkHeader, b7 as buildMapUrl, b8 as buildPermissionsPolicy, b9 as buildPreferHeader, ba as buildPriorityHeader, bb as buildRangeHeader, bc as buildReferrerPolicy, bd as buildRetryAfterHeader, be as buildRobotsMetaTag, bf as buildVaryHeader, bg as buildXContentTypeOptionsHeader, bh as buildXRobotsTag, bi as calculateCookieSizeBudget, bj as checkSetCookieHeader, bk as countryCodeToFlag, bl as extractMultipartBoundary, bm as formatCoordinates, bn as formatTtl, bo as generateRobotsTxt, bp as getByCategory, bq as getHeader, br as getHeadersByCategory, bs as getStatusByCategory, bt as getStatusCode, bu as isClientError, bv as isServerError, bw as isSuccess, bx as isValidIp, by as isValidIpv4, bz as isValidIpv6, bA as listCloseCodes, bB as listOpcodes, bC as lookupCloseCode, bD as lookupOpcode, bE as parseAcceptLanguage, bF as parseAltSvcHeader, bG as parseClearSiteData, bH as parseClientHintHeaders, bI as parseContentDisposition, bJ as parseContentRangeHeader, bK as parseDnsResponse, bL as parseGeoResponse, bM as parseHar, bN as parseHsts, bO as parseIpv6Address, bP as parseMultipartFormData, bQ as parsePermissionsPolicy, bR as parsePreferHeader, bS as parsePriorityHeader, bT as parseRetryAfterHeader, bU as parseRobotsMetaTag, bV as parseUserAgent, bW as parseVaryHeader, bX as parseXContentTypeOptionsHeader, bY as parseXRobotsTag, bZ as scoreSecurityHeaders, b_ as searchHeaders, b$ as searchStatusCodes, c0 as splitSitemap, c1 as statusCodeToText, c2 as typeNumberToLabel, c3 as validateDomain, c4 as validateHeaderName, c5 as validateHeaderValue, c6 as validateManifest, c7 as validateRobotsTxt, c8 as validateSitemap } from '../network-B6fQrsCc.cjs';
|