@utilix-tech/sdk 0.60.0 → 0.62.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 +23 -3
- package/dist/{chunk-2WT347WO.js → chunk-43L7H3L2.js} +96 -1
- package/dist/{chunk-B7366PQJ.js → chunk-43WFN3CW.js} +35 -1
- package/dist/index.cjs +129 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{network-CXt69chQ.d.cts → network-DewFJy4E.d.cts} +62 -2
- package/dist/{network-CXt69chQ.d.ts → network-DewFJy4E.d.ts} +62 -2
- package/dist/tools/network.cjs +95 -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 +34 -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-ClKR6Jxz.d.cts → units-izyUpUAb.d.cts} +23 -2
- package/dist/{units-ClKR6Jxz.d.ts → units-izyUpUAb.d.ts} +23 -2
- package/package.json +1 -1
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* - accept-language-parser: parseAcceptLanguage, buildAcceptLanguage
|
|
26
26
|
* - prefer-header: buildPreferHeader, parsePreferHeader
|
|
27
27
|
* - retry-after-builder: buildRetryAfterHeader, parseRetryAfterHeader
|
|
28
|
+
* - priority-header: buildPriorityHeader, parsePriorityHeader
|
|
29
|
+
* - websocket-close-codes: lookupCloseCode, listCloseCodes
|
|
28
30
|
*/
|
|
29
31
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
30
32
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -847,6 +849,57 @@ declare function buildRetryAfterHeader(input: {
|
|
|
847
849
|
declare function parseRetryAfterHeader(raw: string): RetryAfterResult | {
|
|
848
850
|
error: string;
|
|
849
851
|
};
|
|
852
|
+
interface PriorityResult {
|
|
853
|
+
header: string;
|
|
854
|
+
headerValue: string;
|
|
855
|
+
urgency: number;
|
|
856
|
+
incremental: boolean;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Build a `Priority` request/response-header value from an urgency (0-7,
|
|
860
|
+
* default 3) and/or an incremental flag, per RFC 9218. At least one of the
|
|
861
|
+
* two must be given; the omitted one falls back to its spec default.
|
|
862
|
+
*/
|
|
863
|
+
declare function buildPriorityHeader(input: {
|
|
864
|
+
urgency?: number;
|
|
865
|
+
incremental?: boolean;
|
|
866
|
+
}): PriorityResult | {
|
|
867
|
+
error: string;
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* Parse an existing `Priority` header value (with or without a leading
|
|
871
|
+
* `Priority:` label) into its urgency and incremental fields, per RFC 9218.
|
|
872
|
+
* Any field not present in the input falls back to its spec default (u=3,
|
|
873
|
+
* i=false). Unrecognized dictionary members are ignored for forward
|
|
874
|
+
* compatibility, as the spec requires.
|
|
875
|
+
*/
|
|
876
|
+
declare function parsePriorityHeader(raw: string): PriorityResult | {
|
|
877
|
+
error: string;
|
|
878
|
+
};
|
|
879
|
+
type CloseCodeRange = 'standard' | 'reserved-future' | 'library-framework' | 'private-use';
|
|
880
|
+
interface CloseCodeInfo {
|
|
881
|
+
code: number;
|
|
882
|
+
name: string;
|
|
883
|
+
description: string;
|
|
884
|
+
range: CloseCodeRange;
|
|
885
|
+
sentOnWire: boolean;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* List every well-known WebSocket close code (1000-1015) defined directly
|
|
889
|
+
* by RFC 6455, in ascending order.
|
|
890
|
+
*/
|
|
891
|
+
declare function listCloseCodes(): CloseCodeInfo[];
|
|
892
|
+
/**
|
|
893
|
+
* Look up what a WebSocket close code means, per the RFC 6455 close code
|
|
894
|
+
* definitions and the IANA WebSocket Close Code Number Registry's reserved
|
|
895
|
+
* ranges. Codes 1000-1015 return their specific well-known meaning; codes
|
|
896
|
+
* 3000-3999 and 4000-4999 return the meaning of their reserved range, since
|
|
897
|
+
* those ranges are allocated to individual libraries/applications rather
|
|
898
|
+
* than having a single fixed meaning.
|
|
899
|
+
*/
|
|
900
|
+
declare function lookupCloseCode(code: number): CloseCodeInfo | {
|
|
901
|
+
error: string;
|
|
902
|
+
};
|
|
850
903
|
|
|
851
904
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
852
905
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -860,6 +913,8 @@ type network_ClientHintDef = ClientHintDef;
|
|
|
860
913
|
type network_ClientHintValueType = ClientHintValueType;
|
|
861
914
|
type network_ClientHintsBuildResult = ClientHintsBuildResult;
|
|
862
915
|
type network_ClientHintsParseResult = ClientHintsParseResult;
|
|
916
|
+
type network_CloseCodeInfo = CloseCodeInfo;
|
|
917
|
+
type network_CloseCodeRange = CloseCodeRange;
|
|
863
918
|
type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
|
|
864
919
|
type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
|
|
865
920
|
type network_ContentDispositionParseResult = ContentDispositionParseResult;
|
|
@@ -901,6 +956,7 @@ type network_PermissionsPolicyResult = PermissionsPolicyResult;
|
|
|
901
956
|
type network_PreferParameter = PreferParameter;
|
|
902
957
|
type network_PreferPreference = PreferPreference;
|
|
903
958
|
type network_PreferResult = PreferResult;
|
|
959
|
+
type network_PriorityResult = PriorityResult;
|
|
904
960
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
905
961
|
type network_RangeEntry = RangeEntry;
|
|
906
962
|
type network_RangeEntryInput = RangeEntryInput;
|
|
@@ -945,6 +1001,7 @@ declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
|
945
1001
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
946
1002
|
declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
947
1003
|
declare const network_buildPreferHeader: typeof buildPreferHeader;
|
|
1004
|
+
declare const network_buildPriorityHeader: typeof buildPriorityHeader;
|
|
948
1005
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
949
1006
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
950
1007
|
declare const network_buildRetryAfterHeader: typeof buildRetryAfterHeader;
|
|
@@ -965,6 +1022,8 @@ declare const network_isSuccess: typeof isSuccess;
|
|
|
965
1022
|
declare const network_isValidIp: typeof isValidIp;
|
|
966
1023
|
declare const network_isValidIpv4: typeof isValidIpv4;
|
|
967
1024
|
declare const network_isValidIpv6: typeof isValidIpv6;
|
|
1025
|
+
declare const network_listCloseCodes: typeof listCloseCodes;
|
|
1026
|
+
declare const network_lookupCloseCode: typeof lookupCloseCode;
|
|
968
1027
|
declare const network_parseAcceptLanguage: typeof parseAcceptLanguage;
|
|
969
1028
|
declare const network_parseClientHintHeaders: typeof parseClientHintHeaders;
|
|
970
1029
|
declare const network_parseContentDisposition: typeof parseContentDisposition;
|
|
@@ -975,6 +1034,7 @@ declare const network_parseHar: typeof parseHar;
|
|
|
975
1034
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
976
1035
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
977
1036
|
declare const network_parsePreferHeader: typeof parsePreferHeader;
|
|
1037
|
+
declare const network_parsePriorityHeader: typeof parsePriorityHeader;
|
|
978
1038
|
declare const network_parseRetryAfterHeader: typeof parseRetryAfterHeader;
|
|
979
1039
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
980
1040
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
@@ -991,7 +1051,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
991
1051
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
992
1052
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
993
1053
|
declare namespace network {
|
|
994
|
-
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_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, 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, 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_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, 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, 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_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, 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, 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_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, 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_parseAcceptLanguage as parseAcceptLanguage, 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_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, 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 };
|
|
1054
|
+
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_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, 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_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, 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_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, 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, 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_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, 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_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, 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_lookupCloseCode as lookupCloseCode, network_parseAcceptLanguage as parseAcceptLanguage, 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_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, 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 };
|
|
995
1055
|
}
|
|
996
1056
|
|
|
997
|
-
export { type
|
|
1057
|
+
export { type PreferParameter as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarSummary as F, type GeoResult as G, HTTP_HEADERS as H, type HeaderCategory as I, type HttpHeader as J, type Ipv6AddressType as K, type Ipv6ParseResult as L, LINK_REL_VALUES as M, type LinkHeaderEntry as N, type LinkHeaderEntryInput as O, type LinkHeaderResult as P, type LinkRel as Q, type ManifestIconInfo as R, type ManifestIssue as S, type ManifestValidationResult as T, PERMISSIONS_POLICY_FEATURES as U, type ParsedClientHint as V, type ParsedDnsResult as W, type ParsedGeoResult as X, type PermissionsPolicyDirective as Y, type PermissionsPolicyFeatureInput as Z, type PermissionsPolicyResult as _, type AcceptLanguageResult as a, isServerError as a$, type PreferPreference as a0, type PreferResult as a1, type PriorityResult as a2, REFERRER_POLICY_VALUES as a3, type RangeEntry as a4, type RangeEntryInput as a5, type RangeHeaderResult as a6, type ReceivedHop as a7, type ReferrerPolicyEntry as a8, type ReferrerPolicyResult as a9, assessContentTypeRisk as aA, buildAcceptLanguage as aB, buildCacheControl as aC, buildClientHints as aD, buildContentDisposition as aE, buildDnsQueryUrl as aF, buildGeoUrl as aG, buildLinkHeader as aH, buildMapUrl as aI, buildPermissionsPolicy as aJ, buildPreferHeader as aK, buildPriorityHeader as aL, buildRangeHeader as aM, buildReferrerPolicy as aN, buildRetryAfterHeader as aO, buildVaryHeader as aP, buildXContentTypeOptionsHeader as aQ, checkSetCookieHeader as aR, countryCodeToFlag as aS, formatCoordinates as aT, formatTtl as aU, getByCategory as aV, getHeader as aW, getHeadersByCategory as aX, getStatusByCategory as aY, getStatusCode as aZ, isClientError as a_, type ReferrerPolicyValue as aa, type RetryAfterDateResult as ab, type RetryAfterResult as ac, type RetryAfterSecondsResult as ad, type RobotsGroup as ae, type RobotsIssue as af, type RobotsRule as ag, type RobotsValidationResult as ah, STATUS_CODES as ai, type SameSiteValue as aj, type SitemapIndexEntry as ak, type SitemapIssue as al, type SitemapSplitFile as am, type SitemapUrlEntry as an, type SitemapValidationResult as ao, type SplitSitemapOptions as ap, type SplitSitemapResult as aq, type StatusCode as ar, type UaDeviceType as as, type UserAgentInfo as at, type VaryHeaderEntry as au, type VaryHeaderResult as av, type XContentTypeOptionsHeader as aw, type XContentTypeOptionsParseResult as ax, X_CONTENT_TYPE_OPTIONS_HEADER as ay, analyzeEmailHeaders as az, type AuthResultEntry as b, isSuccess as b0, isValidIp as b1, isValidIpv4 as b2, isValidIpv6 as b3, listCloseCodes as b4, lookupCloseCode as b5, parseAcceptLanguage as b6, parseClientHintHeaders as b7, parseContentDisposition as b8, parseContentRangeHeader as b9, parseDnsResponse as ba, parseGeoResponse as bb, parseHar as bc, parseIpv6Address as bd, parsePermissionsPolicy as be, parsePreferHeader as bf, parsePriorityHeader as bg, parseRetryAfterHeader as bh, parseUserAgent as bi, parseVaryHeader as bj, parseXContentTypeOptionsHeader as bk, searchHeaders as bl, searchStatusCodes as bm, splitSitemap as bn, statusCodeToText as bo, typeNumberToLabel as bp, validateDomain as bq, validateHeaderName as br, validateHeaderValue as bs, validateManifest as bt, validateRobotsTxt as bu, validateSitemap as bv, type CacheControlDirective as c, type CacheControlOptions as d, type CacheControlResult as e, type ClientHintDef as f, type ClientHintValueType as g, type ClientHintsBuildResult as h, type ClientHintsParseResult as i, type CloseCodeInfo as j, type CloseCodeRange as k, type ContentDispositionBuildOptions as l, type ContentDispositionBuildResult as m, network as n, type ContentDispositionParseResult as o, type ContentRangeResult as p, type ContentTypeRiskResult as q, type ContentTypeSniffRisk as r, type CookieAttributes as s, type CookieCheckResult as t, type DnsRecord as u, type DnsRecordType as v, type DnsResponse as w, type EmailHeaderField as x, type HarEntry as y, type HarParseResult as z };
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* - accept-language-parser: parseAcceptLanguage, buildAcceptLanguage
|
|
26
26
|
* - prefer-header: buildPreferHeader, parsePreferHeader
|
|
27
27
|
* - retry-after-builder: buildRetryAfterHeader, parseRetryAfterHeader
|
|
28
|
+
* - priority-header: buildPriorityHeader, parsePriorityHeader
|
|
29
|
+
* - websocket-close-codes: lookupCloseCode, listCloseCodes
|
|
28
30
|
*/
|
|
29
31
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
30
32
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -847,6 +849,57 @@ declare function buildRetryAfterHeader(input: {
|
|
|
847
849
|
declare function parseRetryAfterHeader(raw: string): RetryAfterResult | {
|
|
848
850
|
error: string;
|
|
849
851
|
};
|
|
852
|
+
interface PriorityResult {
|
|
853
|
+
header: string;
|
|
854
|
+
headerValue: string;
|
|
855
|
+
urgency: number;
|
|
856
|
+
incremental: boolean;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Build a `Priority` request/response-header value from an urgency (0-7,
|
|
860
|
+
* default 3) and/or an incremental flag, per RFC 9218. At least one of the
|
|
861
|
+
* two must be given; the omitted one falls back to its spec default.
|
|
862
|
+
*/
|
|
863
|
+
declare function buildPriorityHeader(input: {
|
|
864
|
+
urgency?: number;
|
|
865
|
+
incremental?: boolean;
|
|
866
|
+
}): PriorityResult | {
|
|
867
|
+
error: string;
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* Parse an existing `Priority` header value (with or without a leading
|
|
871
|
+
* `Priority:` label) into its urgency and incremental fields, per RFC 9218.
|
|
872
|
+
* Any field not present in the input falls back to its spec default (u=3,
|
|
873
|
+
* i=false). Unrecognized dictionary members are ignored for forward
|
|
874
|
+
* compatibility, as the spec requires.
|
|
875
|
+
*/
|
|
876
|
+
declare function parsePriorityHeader(raw: string): PriorityResult | {
|
|
877
|
+
error: string;
|
|
878
|
+
};
|
|
879
|
+
type CloseCodeRange = 'standard' | 'reserved-future' | 'library-framework' | 'private-use';
|
|
880
|
+
interface CloseCodeInfo {
|
|
881
|
+
code: number;
|
|
882
|
+
name: string;
|
|
883
|
+
description: string;
|
|
884
|
+
range: CloseCodeRange;
|
|
885
|
+
sentOnWire: boolean;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* List every well-known WebSocket close code (1000-1015) defined directly
|
|
889
|
+
* by RFC 6455, in ascending order.
|
|
890
|
+
*/
|
|
891
|
+
declare function listCloseCodes(): CloseCodeInfo[];
|
|
892
|
+
/**
|
|
893
|
+
* Look up what a WebSocket close code means, per the RFC 6455 close code
|
|
894
|
+
* definitions and the IANA WebSocket Close Code Number Registry's reserved
|
|
895
|
+
* ranges. Codes 1000-1015 return their specific well-known meaning; codes
|
|
896
|
+
* 3000-3999 and 4000-4999 return the meaning of their reserved range, since
|
|
897
|
+
* those ranges are allocated to individual libraries/applications rather
|
|
898
|
+
* than having a single fixed meaning.
|
|
899
|
+
*/
|
|
900
|
+
declare function lookupCloseCode(code: number): CloseCodeInfo | {
|
|
901
|
+
error: string;
|
|
902
|
+
};
|
|
850
903
|
|
|
851
904
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
852
905
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -860,6 +913,8 @@ type network_ClientHintDef = ClientHintDef;
|
|
|
860
913
|
type network_ClientHintValueType = ClientHintValueType;
|
|
861
914
|
type network_ClientHintsBuildResult = ClientHintsBuildResult;
|
|
862
915
|
type network_ClientHintsParseResult = ClientHintsParseResult;
|
|
916
|
+
type network_CloseCodeInfo = CloseCodeInfo;
|
|
917
|
+
type network_CloseCodeRange = CloseCodeRange;
|
|
863
918
|
type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
|
|
864
919
|
type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
|
|
865
920
|
type network_ContentDispositionParseResult = ContentDispositionParseResult;
|
|
@@ -901,6 +956,7 @@ type network_PermissionsPolicyResult = PermissionsPolicyResult;
|
|
|
901
956
|
type network_PreferParameter = PreferParameter;
|
|
902
957
|
type network_PreferPreference = PreferPreference;
|
|
903
958
|
type network_PreferResult = PreferResult;
|
|
959
|
+
type network_PriorityResult = PriorityResult;
|
|
904
960
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
905
961
|
type network_RangeEntry = RangeEntry;
|
|
906
962
|
type network_RangeEntryInput = RangeEntryInput;
|
|
@@ -945,6 +1001,7 @@ declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
|
945
1001
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
946
1002
|
declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
947
1003
|
declare const network_buildPreferHeader: typeof buildPreferHeader;
|
|
1004
|
+
declare const network_buildPriorityHeader: typeof buildPriorityHeader;
|
|
948
1005
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
949
1006
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
950
1007
|
declare const network_buildRetryAfterHeader: typeof buildRetryAfterHeader;
|
|
@@ -965,6 +1022,8 @@ declare const network_isSuccess: typeof isSuccess;
|
|
|
965
1022
|
declare const network_isValidIp: typeof isValidIp;
|
|
966
1023
|
declare const network_isValidIpv4: typeof isValidIpv4;
|
|
967
1024
|
declare const network_isValidIpv6: typeof isValidIpv6;
|
|
1025
|
+
declare const network_listCloseCodes: typeof listCloseCodes;
|
|
1026
|
+
declare const network_lookupCloseCode: typeof lookupCloseCode;
|
|
968
1027
|
declare const network_parseAcceptLanguage: typeof parseAcceptLanguage;
|
|
969
1028
|
declare const network_parseClientHintHeaders: typeof parseClientHintHeaders;
|
|
970
1029
|
declare const network_parseContentDisposition: typeof parseContentDisposition;
|
|
@@ -975,6 +1034,7 @@ declare const network_parseHar: typeof parseHar;
|
|
|
975
1034
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
976
1035
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
977
1036
|
declare const network_parsePreferHeader: typeof parsePreferHeader;
|
|
1037
|
+
declare const network_parsePriorityHeader: typeof parsePriorityHeader;
|
|
978
1038
|
declare const network_parseRetryAfterHeader: typeof parseRetryAfterHeader;
|
|
979
1039
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
980
1040
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
@@ -991,7 +1051,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
991
1051
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
992
1052
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
993
1053
|
declare namespace network {
|
|
994
|
-
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_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, 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, 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_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, 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, 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_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, 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, 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_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, 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_parseAcceptLanguage as parseAcceptLanguage, 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_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, 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 };
|
|
1054
|
+
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_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, 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_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, 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_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, 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, 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_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, 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_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, 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_lookupCloseCode as lookupCloseCode, network_parseAcceptLanguage as parseAcceptLanguage, 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_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, 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 };
|
|
995
1055
|
}
|
|
996
1056
|
|
|
997
|
-
export { type
|
|
1057
|
+
export { type PreferParameter as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarSummary as F, type GeoResult as G, HTTP_HEADERS as H, type HeaderCategory as I, type HttpHeader as J, type Ipv6AddressType as K, type Ipv6ParseResult as L, LINK_REL_VALUES as M, type LinkHeaderEntry as N, type LinkHeaderEntryInput as O, type LinkHeaderResult as P, type LinkRel as Q, type ManifestIconInfo as R, type ManifestIssue as S, type ManifestValidationResult as T, PERMISSIONS_POLICY_FEATURES as U, type ParsedClientHint as V, type ParsedDnsResult as W, type ParsedGeoResult as X, type PermissionsPolicyDirective as Y, type PermissionsPolicyFeatureInput as Z, type PermissionsPolicyResult as _, type AcceptLanguageResult as a, isServerError as a$, type PreferPreference as a0, type PreferResult as a1, type PriorityResult as a2, REFERRER_POLICY_VALUES as a3, type RangeEntry as a4, type RangeEntryInput as a5, type RangeHeaderResult as a6, type ReceivedHop as a7, type ReferrerPolicyEntry as a8, type ReferrerPolicyResult as a9, assessContentTypeRisk as aA, buildAcceptLanguage as aB, buildCacheControl as aC, buildClientHints as aD, buildContentDisposition as aE, buildDnsQueryUrl as aF, buildGeoUrl as aG, buildLinkHeader as aH, buildMapUrl as aI, buildPermissionsPolicy as aJ, buildPreferHeader as aK, buildPriorityHeader as aL, buildRangeHeader as aM, buildReferrerPolicy as aN, buildRetryAfterHeader as aO, buildVaryHeader as aP, buildXContentTypeOptionsHeader as aQ, checkSetCookieHeader as aR, countryCodeToFlag as aS, formatCoordinates as aT, formatTtl as aU, getByCategory as aV, getHeader as aW, getHeadersByCategory as aX, getStatusByCategory as aY, getStatusCode as aZ, isClientError as a_, type ReferrerPolicyValue as aa, type RetryAfterDateResult as ab, type RetryAfterResult as ac, type RetryAfterSecondsResult as ad, type RobotsGroup as ae, type RobotsIssue as af, type RobotsRule as ag, type RobotsValidationResult as ah, STATUS_CODES as ai, type SameSiteValue as aj, type SitemapIndexEntry as ak, type SitemapIssue as al, type SitemapSplitFile as am, type SitemapUrlEntry as an, type SitemapValidationResult as ao, type SplitSitemapOptions as ap, type SplitSitemapResult as aq, type StatusCode as ar, type UaDeviceType as as, type UserAgentInfo as at, type VaryHeaderEntry as au, type VaryHeaderResult as av, type XContentTypeOptionsHeader as aw, type XContentTypeOptionsParseResult as ax, X_CONTENT_TYPE_OPTIONS_HEADER as ay, analyzeEmailHeaders as az, type AuthResultEntry as b, isSuccess as b0, isValidIp as b1, isValidIpv4 as b2, isValidIpv6 as b3, listCloseCodes as b4, lookupCloseCode as b5, parseAcceptLanguage as b6, parseClientHintHeaders as b7, parseContentDisposition as b8, parseContentRangeHeader as b9, parseDnsResponse as ba, parseGeoResponse as bb, parseHar as bc, parseIpv6Address as bd, parsePermissionsPolicy as be, parsePreferHeader as bf, parsePriorityHeader as bg, parseRetryAfterHeader as bh, parseUserAgent as bi, parseVaryHeader as bj, parseXContentTypeOptionsHeader as bk, searchHeaders as bl, searchStatusCodes as bm, splitSitemap as bn, statusCodeToText as bo, typeNumberToLabel as bp, validateDomain as bq, validateHeaderName as br, validateHeaderValue as bs, validateManifest as bt, validateRobotsTxt as bu, validateSitemap as bv, type CacheControlDirective as c, type CacheControlOptions as d, type CacheControlResult as e, type ClientHintDef as f, type ClientHintValueType as g, type ClientHintsBuildResult as h, type ClientHintsParseResult as i, type CloseCodeInfo as j, type CloseCodeRange as k, type ContentDispositionBuildOptions as l, type ContentDispositionBuildResult as m, network as n, type ContentDispositionParseResult as o, type ContentRangeResult as p, type ContentTypeRiskResult as q, type ContentTypeSniffRisk as r, type CookieAttributes as s, type CookieCheckResult as t, type DnsRecord as u, type DnsRecordType as v, type DnsResponse as w, type EmailHeaderField as x, type HarEntry as y, type HarParseResult as z };
|
package/dist/tools/network.cjs
CHANGED
|
@@ -2951,6 +2951,97 @@ function parseRetryAfterHeader(raw) {
|
|
|
2951
2951
|
const httpDate = parsed.toUTCString();
|
|
2952
2952
|
return { header: `Retry-After: ${httpDate}`, headerValue: httpDate, type: "http-date", httpDate, iso: parsed.toISOString() };
|
|
2953
2953
|
}
|
|
2954
|
+
function isValidUrgency(n) {
|
|
2955
|
+
return typeof n === "number" && Number.isInteger(n) && n >= 0 && n <= 7;
|
|
2956
|
+
}
|
|
2957
|
+
function buildPriorityHeader(input) {
|
|
2958
|
+
const { urgency, incremental } = input ?? {};
|
|
2959
|
+
if (urgency === void 0 && incremental === void 0) {
|
|
2960
|
+
return { error: "Provide at least one of urgency or incremental" };
|
|
2961
|
+
}
|
|
2962
|
+
if (urgency !== void 0 && !isValidUrgency(urgency)) {
|
|
2963
|
+
return { error: "urgency must be an integer between 0 and 7" };
|
|
2964
|
+
}
|
|
2965
|
+
const parts = [];
|
|
2966
|
+
if (urgency !== void 0) parts.push(`u=${urgency}`);
|
|
2967
|
+
if (incremental === true) parts.push("i");
|
|
2968
|
+
else if (incremental === false) parts.push("i=?0");
|
|
2969
|
+
const headerValue = parts.join(", ");
|
|
2970
|
+
return {
|
|
2971
|
+
header: `Priority: ${headerValue}`,
|
|
2972
|
+
headerValue,
|
|
2973
|
+
urgency: urgency ?? 3,
|
|
2974
|
+
incremental: incremental ?? false
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
function parsePriorityHeader(raw) {
|
|
2978
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
2979
|
+
const withoutLabel = raw.trim().replace(/^priority:\s*/i, "");
|
|
2980
|
+
const parts = withoutLabel.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
|
|
2981
|
+
if (parts.length === 0) return { error: "Input is empty" };
|
|
2982
|
+
let urgency = 3;
|
|
2983
|
+
let incremental = false;
|
|
2984
|
+
for (const part of parts) {
|
|
2985
|
+
const eq = part.indexOf("=");
|
|
2986
|
+
const key = (eq === -1 ? part : part.slice(0, eq)).trim();
|
|
2987
|
+
const rawValue = eq === -1 ? void 0 : part.slice(eq + 1).trim();
|
|
2988
|
+
if (key === "u") {
|
|
2989
|
+
if (rawValue === void 0 || !/^\d+$/.test(rawValue)) return { error: `Invalid urgency value in "${part}"` };
|
|
2990
|
+
const n = Number(rawValue);
|
|
2991
|
+
if (n < 0 || n > 7) return { error: `urgency must be between 0 and 7, got ${n}` };
|
|
2992
|
+
urgency = n;
|
|
2993
|
+
} else if (key === "i") {
|
|
2994
|
+
if (rawValue === void 0 || rawValue === "?1") incremental = true;
|
|
2995
|
+
else if (rawValue === "?0") incremental = false;
|
|
2996
|
+
else return { error: `Invalid incremental value in "${part}"` };
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
const headerValue = incremental ? `u=${urgency}, i` : `u=${urgency}, i=?0`;
|
|
3000
|
+
return { header: `Priority: ${headerValue}`, headerValue, urgency, incremental };
|
|
3001
|
+
}
|
|
3002
|
+
var WELL_KNOWN_CLOSE_CODES = {
|
|
3003
|
+
1e3: { name: "Normal Closure", description: "The connection successfully completed the purpose for which it was created.", sentOnWire: true },
|
|
3004
|
+
1001: { name: "Going Away", description: "An endpoint is going away, such as a server shutting down or a browser navigating away from the page.", sentOnWire: true },
|
|
3005
|
+
1002: { name: "Protocol Error", description: "An endpoint is terminating the connection due to a protocol error.", sentOnWire: true },
|
|
3006
|
+
1003: { name: "Unsupported Data", description: "An endpoint received a data type it cannot accept, such as a binary-only endpoint receiving a text message.", sentOnWire: true },
|
|
3007
|
+
1004: { name: "Reserved", description: "Reserved. A meaning might be defined in the future.", sentOnWire: true },
|
|
3008
|
+
1005: { name: "No Status Received", description: "A reserved value used internally by libraries to indicate no status code was actually present in the close frame. Must not be sent on the wire.", sentOnWire: false },
|
|
3009
|
+
1006: { name: "Abnormal Closure", description: "A reserved value used internally by libraries to indicate the connection closed without a close frame, e.g. the TCP connection dropped. Must not be sent on the wire.", sentOnWire: false },
|
|
3010
|
+
1007: { name: "Invalid frame payload data", description: "An endpoint is terminating the connection because it received data inconsistent with the message type, such as non-UTF-8 data in a text message.", sentOnWire: true },
|
|
3011
|
+
1008: { name: "Policy Violation", description: "A generic status code used when no other code fits and the endpoint does not want to reveal further details, or a message violated its policy.", sentOnWire: true },
|
|
3012
|
+
1009: { name: "Message Too Big", description: "An endpoint is terminating the connection because it received a message too large to process.", sentOnWire: true },
|
|
3013
|
+
1010: { name: "Mandatory Extension", description: "A client is terminating the connection because the server did not negotiate one or more extensions the client required.", sentOnWire: true },
|
|
3014
|
+
1011: { name: "Internal Error", description: "A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.", sentOnWire: true },
|
|
3015
|
+
1012: { name: "Service Restart", description: "The server is terminating the connection because it is restarting.", sentOnWire: true },
|
|
3016
|
+
1013: { name: "Try Again Later", description: "The server is terminating the connection due to a temporary condition, such as being overloaded, and the client should reconnect later.", sentOnWire: true },
|
|
3017
|
+
1014: { name: "Bad Gateway", description: "The server, acting as a gateway or proxy, received an invalid response from an upstream server it connected to while processing the request.", sentOnWire: true },
|
|
3018
|
+
1015: { name: "TLS Handshake", description: "A reserved value used internally by libraries to indicate the TLS handshake failed. Must not be sent on the wire.", sentOnWire: false }
|
|
3019
|
+
};
|
|
3020
|
+
function listCloseCodes() {
|
|
3021
|
+
return Object.entries(WELL_KNOWN_CLOSE_CODES).map(([code, info]) => ({ code: Number(code), name: info.name, description: info.description, range: "standard", sentOnWire: info.sentOnWire })).sort((a, b) => a.code - b.code);
|
|
3022
|
+
}
|
|
3023
|
+
function lookupCloseCode(code) {
|
|
3024
|
+
if (typeof code !== "number" || !Number.isInteger(code) || code < 0 || code > 65535) {
|
|
3025
|
+
return { error: "code must be an integer between 0 and 65535" };
|
|
3026
|
+
}
|
|
3027
|
+
const known = WELL_KNOWN_CLOSE_CODES[code];
|
|
3028
|
+
if (known) {
|
|
3029
|
+
return { code, name: known.name, description: known.description, range: "standard", sentOnWire: known.sentOnWire };
|
|
3030
|
+
}
|
|
3031
|
+
if (code < 1e3) {
|
|
3032
|
+
return { error: `${code} is not a valid WebSocket close code; codes below 1000 are not permitted on the wire` };
|
|
3033
|
+
}
|
|
3034
|
+
if (code <= 2999) {
|
|
3035
|
+
return { code, name: "Unassigned", description: "Reserved for future use by the WebSocket protocol specification. No meaning is defined yet.", range: "reserved-future", sentOnWire: true };
|
|
3036
|
+
}
|
|
3037
|
+
if (code <= 3999) {
|
|
3038
|
+
return { code, name: "Library/Framework Use", description: "Reserved for use by libraries, frameworks, and applications. Codes in this range are meant to be registered directly with IANA in the WebSocket Close Code Number Registry, so their meaning depends on which library or application defined them.", range: "library-framework", sentOnWire: true };
|
|
3039
|
+
}
|
|
3040
|
+
if (code <= 4999) {
|
|
3041
|
+
return { code, name: "Private Use", description: "Reserved for private use between a specific client and server implementation. These codes cannot be registered with IANA, so their meaning is defined entirely by the application using them.", range: "private-use", sentOnWire: true };
|
|
3042
|
+
}
|
|
3043
|
+
return { error: `${code} is outside the defined close code ranges (0-4999); codes 5000 and above have no assigned meaning` };
|
|
3044
|
+
}
|
|
2954
3045
|
|
|
2955
3046
|
exports.CLIENT_HINTS = CLIENT_HINTS;
|
|
2956
3047
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
@@ -2972,6 +3063,7 @@ exports.buildLinkHeader = buildLinkHeader;
|
|
|
2972
3063
|
exports.buildMapUrl = buildMapUrl;
|
|
2973
3064
|
exports.buildPermissionsPolicy = buildPermissionsPolicy;
|
|
2974
3065
|
exports.buildPreferHeader = buildPreferHeader;
|
|
3066
|
+
exports.buildPriorityHeader = buildPriorityHeader;
|
|
2975
3067
|
exports.buildRangeHeader = buildRangeHeader;
|
|
2976
3068
|
exports.buildReferrerPolicy = buildReferrerPolicy;
|
|
2977
3069
|
exports.buildRetryAfterHeader = buildRetryAfterHeader;
|
|
@@ -2992,6 +3084,8 @@ exports.isSuccess = isSuccess;
|
|
|
2992
3084
|
exports.isValidIp = isValidIp;
|
|
2993
3085
|
exports.isValidIpv4 = isValidIpv4;
|
|
2994
3086
|
exports.isValidIpv6 = isValidIpv6;
|
|
3087
|
+
exports.listCloseCodes = listCloseCodes;
|
|
3088
|
+
exports.lookupCloseCode = lookupCloseCode;
|
|
2995
3089
|
exports.parseAcceptLanguage = parseAcceptLanguage;
|
|
2996
3090
|
exports.parseClientHintHeaders = parseClientHintHeaders;
|
|
2997
3091
|
exports.parseContentDisposition = parseContentDisposition;
|
|
@@ -3002,6 +3096,7 @@ exports.parseHar = parseHar;
|
|
|
3002
3096
|
exports.parseIpv6Address = parseIpv6Address;
|
|
3003
3097
|
exports.parsePermissionsPolicy = parsePermissionsPolicy;
|
|
3004
3098
|
exports.parsePreferHeader = parsePreferHeader;
|
|
3099
|
+
exports.parsePriorityHeader = parsePriorityHeader;
|
|
3005
3100
|
exports.parseRetryAfterHeader = parseRetryAfterHeader;
|
|
3006
3101
|
exports.parseUserAgent = parseUserAgent;
|
|
3007
3102
|
exports.parseVaryHeader = parseVaryHeader;
|
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, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as
|
|
1
|
+
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as PERMISSIONS_POLICY_FEATURES, V as ParsedClientHint, W as ParsedDnsResult, X as ParsedGeoResult, Y as PermissionsPolicyDirective, Z as PermissionsPolicyFeatureInput, _ as PermissionsPolicyResult, $ as PreferParameter, a0 as PreferPreference, a1 as PreferResult, a2 as PriorityResult, a3 as REFERRER_POLICY_VALUES, a4 as RangeEntry, a5 as RangeEntryInput, a6 as RangeHeaderResult, a7 as ReceivedHop, a8 as ReferrerPolicyEntry, a9 as ReferrerPolicyResult, aa as ReferrerPolicyValue, ab as RetryAfterDateResult, ac as RetryAfterResult, ad as RetryAfterSecondsResult, ae as RobotsGroup, af as RobotsIssue, ag as RobotsRule, ah as RobotsValidationResult, ai as STATUS_CODES, aj as SameSiteValue, ak as SitemapIndexEntry, al as SitemapIssue, am as SitemapSplitFile, an as SitemapUrlEntry, ao as SitemapValidationResult, ap as SplitSitemapOptions, aq as SplitSitemapResult, ar as StatusCode, as as UaDeviceType, at as UserAgentInfo, au as VaryHeaderEntry, av as VaryHeaderResult, aw as XContentTypeOptionsHeader, ax as XContentTypeOptionsParseResult, ay as X_CONTENT_TYPE_OPTIONS_HEADER, az as analyzeEmailHeaders, aA as assessContentTypeRisk, aB as buildAcceptLanguage, aC as buildCacheControl, aD as buildClientHints, aE as buildContentDisposition, aF as buildDnsQueryUrl, aG as buildGeoUrl, aH as buildLinkHeader, aI as buildMapUrl, aJ as buildPermissionsPolicy, aK as buildPreferHeader, aL as buildPriorityHeader, aM as buildRangeHeader, aN as buildReferrerPolicy, aO as buildRetryAfterHeader, aP as buildVaryHeader, aQ as buildXContentTypeOptionsHeader, aR as checkSetCookieHeader, aS as countryCodeToFlag, aT as formatCoordinates, aU as formatTtl, aV as getByCategory, aW as getHeader, aX as getHeadersByCategory, aY as getStatusByCategory, aZ as getStatusCode, a_ as isClientError, a$ as isServerError, b0 as isSuccess, b1 as isValidIp, b2 as isValidIpv4, b3 as isValidIpv6, b4 as listCloseCodes, b5 as lookupCloseCode, b6 as parseAcceptLanguage, b7 as parseClientHintHeaders, b8 as parseContentDisposition, b9 as parseContentRangeHeader, ba as parseDnsResponse, bb as parseGeoResponse, bc as parseHar, bd as parseIpv6Address, be as parsePermissionsPolicy, bf as parsePreferHeader, bg as parsePriorityHeader, bh as parseRetryAfterHeader, bi as parseUserAgent, bj as parseVaryHeader, bk as parseXContentTypeOptionsHeader, bl as searchHeaders, bm as searchStatusCodes, bn as splitSitemap, bo as statusCodeToText, bp as typeNumberToLabel, bq as validateDomain, br as validateHeaderName, bs as validateHeaderValue, bt as validateManifest, bu as validateRobotsTxt, bv as validateSitemap } from '../network-DewFJy4E.cjs';
|
package/dist/tools/network.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as
|
|
1
|
+
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as PERMISSIONS_POLICY_FEATURES, V as ParsedClientHint, W as ParsedDnsResult, X as ParsedGeoResult, Y as PermissionsPolicyDirective, Z as PermissionsPolicyFeatureInput, _ as PermissionsPolicyResult, $ as PreferParameter, a0 as PreferPreference, a1 as PreferResult, a2 as PriorityResult, a3 as REFERRER_POLICY_VALUES, a4 as RangeEntry, a5 as RangeEntryInput, a6 as RangeHeaderResult, a7 as ReceivedHop, a8 as ReferrerPolicyEntry, a9 as ReferrerPolicyResult, aa as ReferrerPolicyValue, ab as RetryAfterDateResult, ac as RetryAfterResult, ad as RetryAfterSecondsResult, ae as RobotsGroup, af as RobotsIssue, ag as RobotsRule, ah as RobotsValidationResult, ai as STATUS_CODES, aj as SameSiteValue, ak as SitemapIndexEntry, al as SitemapIssue, am as SitemapSplitFile, an as SitemapUrlEntry, ao as SitemapValidationResult, ap as SplitSitemapOptions, aq as SplitSitemapResult, ar as StatusCode, as as UaDeviceType, at as UserAgentInfo, au as VaryHeaderEntry, av as VaryHeaderResult, aw as XContentTypeOptionsHeader, ax as XContentTypeOptionsParseResult, ay as X_CONTENT_TYPE_OPTIONS_HEADER, az as analyzeEmailHeaders, aA as assessContentTypeRisk, aB as buildAcceptLanguage, aC as buildCacheControl, aD as buildClientHints, aE as buildContentDisposition, aF as buildDnsQueryUrl, aG as buildGeoUrl, aH as buildLinkHeader, aI as buildMapUrl, aJ as buildPermissionsPolicy, aK as buildPreferHeader, aL as buildPriorityHeader, aM as buildRangeHeader, aN as buildReferrerPolicy, aO as buildRetryAfterHeader, aP as buildVaryHeader, aQ as buildXContentTypeOptionsHeader, aR as checkSetCookieHeader, aS as countryCodeToFlag, aT as formatCoordinates, aU as formatTtl, aV as getByCategory, aW as getHeader, aX as getHeadersByCategory, aY as getStatusByCategory, aZ as getStatusCode, a_ as isClientError, a$ as isServerError, b0 as isSuccess, b1 as isValidIp, b2 as isValidIpv4, b3 as isValidIpv6, b4 as listCloseCodes, b5 as lookupCloseCode, b6 as parseAcceptLanguage, b7 as parseClientHintHeaders, b8 as parseContentDisposition, b9 as parseContentRangeHeader, ba as parseDnsResponse, bb as parseGeoResponse, bc as parseHar, bd as parseIpv6Address, be as parsePermissionsPolicy, bf as parsePreferHeader, bg as parsePriorityHeader, bh as parseRetryAfterHeader, bi as parseUserAgent, bj as parseVaryHeader, bk as parseXContentTypeOptionsHeader, bl as searchHeaders, bm as searchStatusCodes, bn as splitSitemap, bo as statusCodeToText, bp as typeNumberToLabel, bq as validateDomain, br as validateHeaderName, bs as validateHeaderValue, bt as validateManifest, bu as validateRobotsTxt, bv as validateSitemap } from '../network-DewFJy4E.js';
|
package/dist/tools/network.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, X_CONTENT_TYPE_OPTIONS_HEADER, analyzeEmailHeaders, assessContentTypeRisk, buildAcceptLanguage, buildCacheControl, buildClientHints, buildContentDisposition, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildPreferHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parsePreferHeader, parseRetryAfterHeader, parseUserAgent, parseVaryHeader, parseXContentTypeOptionsHeader, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-
|
|
1
|
+
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, X_CONTENT_TYPE_OPTIONS_HEADER, analyzeEmailHeaders, assessContentTypeRisk, buildAcceptLanguage, buildCacheControl, buildClientHints, buildContentDisposition, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildPreferHeader, buildPriorityHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, listCloseCodes, lookupCloseCode, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parsePreferHeader, parsePriorityHeader, parseRetryAfterHeader, parseUserAgent, parseVaryHeader, parseXContentTypeOptionsHeader, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-43L7H3L2.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -1051,6 +1051,39 @@ function calculateLoan(principal, annualRatePercent, termMonths) {
|
|
|
1051
1051
|
schedule
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
|
+
function calculateExtraPaymentPayoff(principal, annualRatePercent, termMonths, extraMonthlyPayment) {
|
|
1055
|
+
const baseline = calculateLoan(principal, annualRatePercent, termMonths);
|
|
1056
|
+
if ("error" in baseline) return baseline;
|
|
1057
|
+
if (!Number.isFinite(extraMonthlyPayment) || extraMonthlyPayment < 0) {
|
|
1058
|
+
return { error: "Extra monthly payment must be zero or a positive number" };
|
|
1059
|
+
}
|
|
1060
|
+
const monthlyRate = annualRatePercent / 100 / 12;
|
|
1061
|
+
const payment = round2(baseline.monthlyPayment) + round2(extraMonthlyPayment);
|
|
1062
|
+
let balance = round2(principal);
|
|
1063
|
+
let totalInterestPaid = 0;
|
|
1064
|
+
let payoffMonths = termMonths;
|
|
1065
|
+
for (let month = 1; month <= termMonths; month++) {
|
|
1066
|
+
const interest = monthlyRate === 0 ? 0 : round2(balance * monthlyRate);
|
|
1067
|
+
let principalPortion = payment - interest;
|
|
1068
|
+
if (principalPortion > balance) principalPortion = balance;
|
|
1069
|
+
totalInterestPaid += interest;
|
|
1070
|
+
balance = round2(balance - principalPortion);
|
|
1071
|
+
if (balance <= 0) {
|
|
1072
|
+
payoffMonths = month;
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
return {
|
|
1077
|
+
monthlyPayment: round2(baseline.monthlyPayment),
|
|
1078
|
+
extraMonthlyPayment: round2(extraMonthlyPayment),
|
|
1079
|
+
baselinePayoffMonths: termMonths,
|
|
1080
|
+
baselineTotalInterest: baseline.totalInterest,
|
|
1081
|
+
newPayoffMonths: payoffMonths,
|
|
1082
|
+
newTotalInterest: round2(totalInterestPaid),
|
|
1083
|
+
monthsSaved: termMonths - payoffMonths,
|
|
1084
|
+
interestSaved: round2(baseline.totalInterest - totalInterestPaid)
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1054
1087
|
var BARCODE_FORMAT_BY_LENGTH = { 8: "EAN-8", 12: "UPC-A", 13: "EAN-13" };
|
|
1055
1088
|
function computeBarcodeCheckDigit(dataDigits) {
|
|
1056
1089
|
let sum = 0;
|
|
@@ -2277,6 +2310,7 @@ exports.calculateDebtToIncomeRatio = calculateDebtToIncomeRatio;
|
|
|
2277
2310
|
exports.calculateDepreciationSchedule = calculateDepreciationSchedule;
|
|
2278
2311
|
exports.calculateDiscount = calculateDiscount;
|
|
2279
2312
|
exports.calculateEmi = calculateEmi;
|
|
2313
|
+
exports.calculateExtraPaymentPayoff = calculateExtraPaymentPayoff;
|
|
2280
2314
|
exports.calculateFreelancerRate = calculateFreelancerRate;
|
|
2281
2315
|
exports.calculateGpa = calculateGpa;
|
|
2282
2316
|
exports.calculateLoan = calculateLoan;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtToIncomeRatioResult, O as DepreciationMethod, P as DepreciationResult, Q as DepreciationYear, R as Dimensions, S as DiscountField, T as DiscountInput, U as DiscountResult, V as DtiTier, W as EmiResult, X as EmiTenureUnit, Y as EmiYearlyBreakdownRow, Z as
|
|
1
|
+
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtToIncomeRatioResult, O as DepreciationMethod, P as DepreciationResult, Q as DepreciationYear, R as Dimensions, S as DiscountField, T as DiscountInput, U as DiscountResult, V as DtiTier, W as EmiResult, X as EmiTenureUnit, Y as EmiYearlyBreakdownRow, Z as ExtraPaymentPayoffResult, _ as FilePermissions, $ as FormatOptions, a0 as FreelancerRateInput, a1 as FreelancerRateResult, a2 as GPA_GRADE_POINTS, a3 as GpaCourse, a4 as GpaCourseResult, a5 as GpaResult, a6 as IbanValidationResult, a7 as IpConversion, a8 as IsbnFormat, a9 as IsbnResult, aa as LoanBalanceInput, ab as LoanBalanceResult, ac as LoanResult, ad as MarginMarkupField, ae as MarginMarkupInput, af as MarginMarkupResult, ag as MovingAveragePoint, ah as MovingAverageResult, ai as NotationStyle, aj as NumberBase, ak as PaybackPeriodInput, al as PaybackPeriodResult, am as PercentChangeDirection, an as PercentageChangeResult, ao as Permission, ap as PxConvertResult, aq as RoiInput, ar as RoiResult, as as RuleOf72Direction, at as RuleOf72Result, au as SavingsGoalInput, av as SavingsGoalMode, aw as SavingsGoalResult, ax as SemverVersion, ay as SimpleInterestResult, az as SubnetInfo, aA as SuccessiveDiscountResult, aB as SuccessiveDiscountStep, aC as TaxDirection, aD as TaxResult, aE as TimeValueDirection, aF as TimeValueResult, aG as TipSplitResult, aH as USD_DENOMINATIONS, aI as UnitPriceItem, aJ as UnitPriceResult, aK as UtilizationTier, aL as VideoBitrateInput, aM as VideoBitrateMode, aN as VideoBitrateResult, aO as ViewportConvertResult, aP as applySuccessiveDiscounts, aQ as autoFormat, aR as bumpVersion, aS as calcAspectRatio, aT as calcSubnet, aU as calculateBlendedLoanRate, aV as calculateBreakEven, aW as calculateCashBreakdown, aX as calculateCashRounding, aY as calculateCdMaturity, aZ as calculateChange, a_ as calculateCompoundInterest, a$ as calculateCreditUtilization, b0 as calculateDebtToIncomeRatio, b1 as calculateDepreciationSchedule, b2 as calculateDiscount, b3 as calculateEmi, b4 as calculateExtraPaymentPayoff, b5 as calculateFreelancerRate, b6 as calculateGpa, b7 as calculateLoan, b8 as calculateMarginMarkup, b9 as calculateMovingAverages, ba as calculatePaybackPeriod, bb as calculatePercentageChange, bc as calculateRoi, bd as calculateRuleOf72, be as calculateSavingsGoal, bf as calculateSimpleInterest, bg as calculateTax, bh as calculateTimeValue, bi as calculateTipSplit, bj as calculateVideoBitrate, bk as compareSemver, bl as compareUnitPrices, bm as convert, bn as convertAprApy, bo as convertBytes, bp as convertIp, bq as coverBox, br as decimalToIp, bs as decimalToIpCidr, bt as describePermissions, bu as fitIntoBox, bv as formatNumber, bw as formatValue, bx as formatVwValue, by as formatWithSeparator, bz as gcd, bA as ipFromBinary, bB as ipFromDecimal, bC as ipFromHex, bD as ipToBinary, bE as ipToDecimal, bF as ipToDecimalCidr, bG as ipToHex, bH as ipToOctal, bI as isValid, bJ as isValidCidr, bK as isValidIp, bL as isValidIpv4, bM as marginToMarkup, bN as markupToMargin, bO as octalToPermissions, bP as parseFileSize, bQ as parseInput, bR as parseNumberString, bS as parseSemver, bT as permissionsToChmod, bU as permissionsToOctal, bV as permissionsToSymbolic, bW as ptToPx, bX as pxToAll, bY as pxToViewport, bZ as remToPx, b_ as satisfiesRange, b$ as scaleByHeight, c0 as scaleByWidth, c1 as sortVersions, c2 as splitSubnet, c3 as symbolicToPermissions, c4 as validateBarcode, c5 as validateCardNumber, c6 as validateIban, c7 as validateIsbn, c8 as viewportToPx } from '../units-izyUpUAb.cjs';
|