@utilix-tech/sdk 0.56.0 → 0.59.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 +9 -0
- package/README.md +30 -9
- package/dist/{chunk-WVEKRKGU.js → chunk-34C6GXCC.js} +34 -1
- package/dist/{chunk-TVSQ53TZ.js → chunk-3QU46YFP.js} +100 -1
- package/dist/{chunk-3TYWIX3B.js → chunk-422ICOZX.js} +16 -1
- package/dist/{chunk-56VFNHVO.js → chunk-QY2M2UHJ.js} +34 -1
- package/dist/{data-Cvyg8ZXo.d.cts → data-vxXrBlWh.d.cts} +22 -2
- package/dist/{data-Cvyg8ZXo.d.ts → data-vxXrBlWh.d.ts} +22 -2
- package/dist/{generators-Du8cBesn.d.cts → generators-DAXXrMvG.d.cts} +23 -2
- package/dist/{generators-Du8cBesn.d.ts → generators-DAXXrMvG.d.ts} +23 -2
- package/dist/index.cjs +180 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{json-Ta9JykSB.d.ts → json-CaiYsGDQ.d.cts} +24 -2
- package/dist/{json-Ta9JykSB.d.cts → json-CaiYsGDQ.d.ts} +24 -2
- package/dist/{network-CoGf7_Op.d.ts → network-fDfM1_L6.d.cts} +45 -2
- package/dist/{network-CoGf7_Op.d.cts → network-fDfM1_L6.d.ts} +45 -2
- package/dist/tools/data.cjs +33 -0
- package/dist/tools/data.d.cts +1 -1
- package/dist/tools/data.d.ts +1 -1
- package/dist/tools/data.js +1 -1
- package/dist/tools/generators.cjs +15 -0
- package/dist/tools/generators.d.cts +1 -1
- package/dist/tools/generators.d.ts +1 -1
- package/dist/tools/generators.js +1 -1
- package/dist/tools/json.cjs +33 -0
- package/dist/tools/json.d.cts +1 -1
- package/dist/tools/json.d.ts +1 -1
- package/dist/tools/json.js +1 -1
- package/dist/tools/network.cjs +99 -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/package.json +1 -1
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
|
|
24
24
|
* - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
|
|
25
25
|
* - accept-language-parser: parseAcceptLanguage, buildAcceptLanguage
|
|
26
|
+
* - prefer-header: buildPreferHeader, parsePreferHeader
|
|
26
27
|
*/
|
|
27
28
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
28
29
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -774,6 +775,43 @@ declare function buildAcceptLanguage(locales: {
|
|
|
774
775
|
declare function parseAcceptLanguage(raw: string): AcceptLanguageResult | {
|
|
775
776
|
error: string;
|
|
776
777
|
};
|
|
778
|
+
interface PreferParameter {
|
|
779
|
+
name: string;
|
|
780
|
+
value?: string;
|
|
781
|
+
}
|
|
782
|
+
interface PreferPreference {
|
|
783
|
+
token: string;
|
|
784
|
+
value?: string;
|
|
785
|
+
params?: PreferParameter[];
|
|
786
|
+
}
|
|
787
|
+
interface PreferResult {
|
|
788
|
+
header: string;
|
|
789
|
+
headerValue: string;
|
|
790
|
+
preferences: PreferPreference[];
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Build a `Prefer` request-header value from a list of preferences, each
|
|
794
|
+
* with an optional value and optional parameters, per RFC 7240. A value or
|
|
795
|
+
* parameter value that isn't a valid HTTP token is quoted automatically.
|
|
796
|
+
*/
|
|
797
|
+
declare function buildPreferHeader(preferences: {
|
|
798
|
+
token: string;
|
|
799
|
+
value?: string;
|
|
800
|
+
params?: {
|
|
801
|
+
name: string;
|
|
802
|
+
value?: string;
|
|
803
|
+
}[];
|
|
804
|
+
}[]): PreferResult | {
|
|
805
|
+
error: string;
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Parse an existing `Prefer` header value (with or without a leading
|
|
809
|
+
* `Prefer:` label) into its list of preferences, each with an optional
|
|
810
|
+
* value and optional parameters, per RFC 7240.
|
|
811
|
+
*/
|
|
812
|
+
declare function parsePreferHeader(raw: string): PreferResult | {
|
|
813
|
+
error: string;
|
|
814
|
+
};
|
|
777
815
|
|
|
778
816
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
779
817
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -825,6 +863,9 @@ type network_ParsedGeoResult = ParsedGeoResult;
|
|
|
825
863
|
type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
|
|
826
864
|
type network_PermissionsPolicyFeatureInput = PermissionsPolicyFeatureInput;
|
|
827
865
|
type network_PermissionsPolicyResult = PermissionsPolicyResult;
|
|
866
|
+
type network_PreferParameter = PreferParameter;
|
|
867
|
+
type network_PreferPreference = PreferPreference;
|
|
868
|
+
type network_PreferResult = PreferResult;
|
|
828
869
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
829
870
|
type network_RangeEntry = RangeEntry;
|
|
830
871
|
type network_RangeEntryInput = RangeEntryInput;
|
|
@@ -865,6 +906,7 @@ declare const network_buildGeoUrl: typeof buildGeoUrl;
|
|
|
865
906
|
declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
866
907
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
867
908
|
declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
909
|
+
declare const network_buildPreferHeader: typeof buildPreferHeader;
|
|
868
910
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
869
911
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
870
912
|
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
@@ -893,6 +935,7 @@ declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
|
893
935
|
declare const network_parseHar: typeof parseHar;
|
|
894
936
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
895
937
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
938
|
+
declare const network_parsePreferHeader: typeof parsePreferHeader;
|
|
896
939
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
897
940
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
898
941
|
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
@@ -908,7 +951,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
908
951
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
909
952
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
910
953
|
declare namespace network {
|
|
911
|
-
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, 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_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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_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 };
|
|
954
|
+
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_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_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_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 };
|
|
912
955
|
}
|
|
913
956
|
|
|
914
|
-
export { type
|
|
957
|
+
export { type PreferResult as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HttpHeader as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type Ipv6ParseResult as J, type LinkHeaderEntry as K, LINK_REL_VALUES as L, type LinkHeaderEntryInput as M, type LinkHeaderResult as N, type LinkRel as O, type ManifestIconInfo as P, type ManifestIssue as Q, type ManifestValidationResult as R, PERMISSIONS_POLICY_FEATURES as S, type ParsedClientHint as T, type ParsedDnsResult as U, type ParsedGeoResult as V, type PermissionsPolicyDirective as W, type PermissionsPolicyFeatureInput as X, type PermissionsPolicyResult as Y, type PreferParameter as Z, type PreferPreference as _, type AcceptLanguageResult as a, parseContentRangeHeader as a$, REFERRER_POLICY_VALUES as a0, type RangeEntry as a1, type RangeEntryInput as a2, type RangeHeaderResult as a3, type ReceivedHop as a4, type ReferrerPolicyEntry as a5, type ReferrerPolicyResult as a6, type ReferrerPolicyValue as a7, type RobotsGroup as a8, type RobotsIssue as a9, buildGeoUrl as aA, buildLinkHeader as aB, buildMapUrl as aC, buildPermissionsPolicy as aD, buildPreferHeader as aE, buildRangeHeader as aF, buildReferrerPolicy as aG, buildVaryHeader as aH, buildXContentTypeOptionsHeader as aI, checkSetCookieHeader as aJ, countryCodeToFlag as aK, formatCoordinates as aL, formatTtl as aM, getByCategory as aN, getHeader as aO, getHeadersByCategory as aP, getStatusByCategory as aQ, getStatusCode as aR, isClientError as aS, isServerError as aT, isSuccess as aU, isValidIp as aV, isValidIpv4 as aW, isValidIpv6 as aX, parseAcceptLanguage as aY, parseClientHintHeaders as aZ, parseContentDisposition as a_, type RobotsRule as aa, type RobotsValidationResult as ab, STATUS_CODES as ac, type SameSiteValue as ad, type SitemapIndexEntry as ae, type SitemapIssue as af, type SitemapSplitFile as ag, type SitemapUrlEntry as ah, type SitemapValidationResult as ai, type SplitSitemapOptions as aj, type SplitSitemapResult as ak, type StatusCode as al, type UaDeviceType as am, type UserAgentInfo as an, type VaryHeaderEntry as ao, type VaryHeaderResult as ap, type XContentTypeOptionsHeader as aq, type XContentTypeOptionsParseResult as ar, X_CONTENT_TYPE_OPTIONS_HEADER as as, analyzeEmailHeaders as at, assessContentTypeRisk as au, buildAcceptLanguage as av, buildCacheControl as aw, buildClientHints as ax, buildContentDisposition as ay, buildDnsQueryUrl as az, type AuthResultEntry as b, parseDnsResponse as b0, parseGeoResponse as b1, parseHar as b2, parseIpv6Address as b3, parsePermissionsPolicy as b4, parsePreferHeader as b5, parseUserAgent as b6, parseVaryHeader as b7, parseXContentTypeOptionsHeader as b8, searchHeaders as b9, searchStatusCodes as ba, splitSitemap as bb, statusCodeToText as bc, typeNumberToLabel as bd, validateDomain as be, validateHeaderName as bf, validateHeaderValue as bg, validateManifest as bh, validateRobotsTxt as bi, validateSitemap as bj, 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 ContentDispositionBuildOptions as j, type ContentDispositionBuildResult as k, type ContentDispositionParseResult as l, type ContentRangeResult as m, network as n, type ContentTypeRiskResult as o, type ContentTypeSniffRisk as p, type CookieAttributes as q, type CookieCheckResult as r, type DnsRecord as s, type DnsRecordType as t, type DnsResponse as u, type EmailHeaderField as v, type HarEntry as w, type HarParseResult as x, type HarSummary as y, type HeaderCategory as z };
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
|
|
24
24
|
* - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
|
|
25
25
|
* - accept-language-parser: parseAcceptLanguage, buildAcceptLanguage
|
|
26
|
+
* - prefer-header: buildPreferHeader, parsePreferHeader
|
|
26
27
|
*/
|
|
27
28
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
28
29
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -774,6 +775,43 @@ declare function buildAcceptLanguage(locales: {
|
|
|
774
775
|
declare function parseAcceptLanguage(raw: string): AcceptLanguageResult | {
|
|
775
776
|
error: string;
|
|
776
777
|
};
|
|
778
|
+
interface PreferParameter {
|
|
779
|
+
name: string;
|
|
780
|
+
value?: string;
|
|
781
|
+
}
|
|
782
|
+
interface PreferPreference {
|
|
783
|
+
token: string;
|
|
784
|
+
value?: string;
|
|
785
|
+
params?: PreferParameter[];
|
|
786
|
+
}
|
|
787
|
+
interface PreferResult {
|
|
788
|
+
header: string;
|
|
789
|
+
headerValue: string;
|
|
790
|
+
preferences: PreferPreference[];
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Build a `Prefer` request-header value from a list of preferences, each
|
|
794
|
+
* with an optional value and optional parameters, per RFC 7240. A value or
|
|
795
|
+
* parameter value that isn't a valid HTTP token is quoted automatically.
|
|
796
|
+
*/
|
|
797
|
+
declare function buildPreferHeader(preferences: {
|
|
798
|
+
token: string;
|
|
799
|
+
value?: string;
|
|
800
|
+
params?: {
|
|
801
|
+
name: string;
|
|
802
|
+
value?: string;
|
|
803
|
+
}[];
|
|
804
|
+
}[]): PreferResult | {
|
|
805
|
+
error: string;
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Parse an existing `Prefer` header value (with or without a leading
|
|
809
|
+
* `Prefer:` label) into its list of preferences, each with an optional
|
|
810
|
+
* value and optional parameters, per RFC 7240.
|
|
811
|
+
*/
|
|
812
|
+
declare function parsePreferHeader(raw: string): PreferResult | {
|
|
813
|
+
error: string;
|
|
814
|
+
};
|
|
777
815
|
|
|
778
816
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
779
817
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -825,6 +863,9 @@ type network_ParsedGeoResult = ParsedGeoResult;
|
|
|
825
863
|
type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
|
|
826
864
|
type network_PermissionsPolicyFeatureInput = PermissionsPolicyFeatureInput;
|
|
827
865
|
type network_PermissionsPolicyResult = PermissionsPolicyResult;
|
|
866
|
+
type network_PreferParameter = PreferParameter;
|
|
867
|
+
type network_PreferPreference = PreferPreference;
|
|
868
|
+
type network_PreferResult = PreferResult;
|
|
828
869
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
829
870
|
type network_RangeEntry = RangeEntry;
|
|
830
871
|
type network_RangeEntryInput = RangeEntryInput;
|
|
@@ -865,6 +906,7 @@ declare const network_buildGeoUrl: typeof buildGeoUrl;
|
|
|
865
906
|
declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
866
907
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
867
908
|
declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
909
|
+
declare const network_buildPreferHeader: typeof buildPreferHeader;
|
|
868
910
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
869
911
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
870
912
|
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
@@ -893,6 +935,7 @@ declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
|
893
935
|
declare const network_parseHar: typeof parseHar;
|
|
894
936
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
895
937
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
938
|
+
declare const network_parsePreferHeader: typeof parsePreferHeader;
|
|
896
939
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
897
940
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
898
941
|
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
@@ -908,7 +951,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
908
951
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
909
952
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
910
953
|
declare namespace network {
|
|
911
|
-
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, 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_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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_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 };
|
|
954
|
+
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_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_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_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 };
|
|
912
955
|
}
|
|
913
956
|
|
|
914
|
-
export { type
|
|
957
|
+
export { type PreferResult as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HttpHeader as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type Ipv6ParseResult as J, type LinkHeaderEntry as K, LINK_REL_VALUES as L, type LinkHeaderEntryInput as M, type LinkHeaderResult as N, type LinkRel as O, type ManifestIconInfo as P, type ManifestIssue as Q, type ManifestValidationResult as R, PERMISSIONS_POLICY_FEATURES as S, type ParsedClientHint as T, type ParsedDnsResult as U, type ParsedGeoResult as V, type PermissionsPolicyDirective as W, type PermissionsPolicyFeatureInput as X, type PermissionsPolicyResult as Y, type PreferParameter as Z, type PreferPreference as _, type AcceptLanguageResult as a, parseContentRangeHeader as a$, REFERRER_POLICY_VALUES as a0, type RangeEntry as a1, type RangeEntryInput as a2, type RangeHeaderResult as a3, type ReceivedHop as a4, type ReferrerPolicyEntry as a5, type ReferrerPolicyResult as a6, type ReferrerPolicyValue as a7, type RobotsGroup as a8, type RobotsIssue as a9, buildGeoUrl as aA, buildLinkHeader as aB, buildMapUrl as aC, buildPermissionsPolicy as aD, buildPreferHeader as aE, buildRangeHeader as aF, buildReferrerPolicy as aG, buildVaryHeader as aH, buildXContentTypeOptionsHeader as aI, checkSetCookieHeader as aJ, countryCodeToFlag as aK, formatCoordinates as aL, formatTtl as aM, getByCategory as aN, getHeader as aO, getHeadersByCategory as aP, getStatusByCategory as aQ, getStatusCode as aR, isClientError as aS, isServerError as aT, isSuccess as aU, isValidIp as aV, isValidIpv4 as aW, isValidIpv6 as aX, parseAcceptLanguage as aY, parseClientHintHeaders as aZ, parseContentDisposition as a_, type RobotsRule as aa, type RobotsValidationResult as ab, STATUS_CODES as ac, type SameSiteValue as ad, type SitemapIndexEntry as ae, type SitemapIssue as af, type SitemapSplitFile as ag, type SitemapUrlEntry as ah, type SitemapValidationResult as ai, type SplitSitemapOptions as aj, type SplitSitemapResult as ak, type StatusCode as al, type UaDeviceType as am, type UserAgentInfo as an, type VaryHeaderEntry as ao, type VaryHeaderResult as ap, type XContentTypeOptionsHeader as aq, type XContentTypeOptionsParseResult as ar, X_CONTENT_TYPE_OPTIONS_HEADER as as, analyzeEmailHeaders as at, assessContentTypeRisk as au, buildAcceptLanguage as av, buildCacheControl as aw, buildClientHints as ax, buildContentDisposition as ay, buildDnsQueryUrl as az, type AuthResultEntry as b, parseDnsResponse as b0, parseGeoResponse as b1, parseHar as b2, parseIpv6Address as b3, parsePermissionsPolicy as b4, parsePreferHeader as b5, parseUserAgent as b6, parseVaryHeader as b7, parseXContentTypeOptionsHeader as b8, searchHeaders as b9, searchStatusCodes as ba, splitSitemap as bb, statusCodeToText as bc, typeNumberToLabel as bd, validateDomain as be, validateHeaderName as bf, validateHeaderValue as bg, validateManifest as bh, validateRobotsTxt as bi, validateSitemap as bj, 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 ContentDispositionBuildOptions as j, type ContentDispositionBuildResult as k, type ContentDispositionParseResult as l, type ContentRangeResult as m, network as n, type ContentTypeRiskResult as o, type ContentTypeSniffRisk as p, type CookieAttributes as q, type CookieCheckResult as r, type DnsRecord as s, type DnsRecordType as t, type DnsResponse as u, type EmailHeaderField as v, type HarEntry as w, type HarParseResult as x, type HarSummary as y, type HeaderCategory as z };
|
package/dist/tools/data.cjs
CHANGED
|
@@ -1139,6 +1139,38 @@ function jsonArrayToNdjson(input) {
|
|
|
1139
1139
|
if (!Array.isArray(parsed)) return { error: "Input must be a JSON array" };
|
|
1140
1140
|
return parsed.map((item) => JSON.stringify(item)).join("\n");
|
|
1141
1141
|
}
|
|
1142
|
+
function dedupeNdjson(input, keyField) {
|
|
1143
|
+
const validated = validateNdjson(input);
|
|
1144
|
+
if (!validated.valid) return { error: _firstNdjsonError(validated) };
|
|
1145
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1146
|
+
const keptRaw = [];
|
|
1147
|
+
const removedLines = [];
|
|
1148
|
+
for (const l of validated.lines) {
|
|
1149
|
+
const parsed = JSON.parse(l.raw);
|
|
1150
|
+
let key;
|
|
1151
|
+
if (keyField) {
|
|
1152
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || !(keyField in parsed)) {
|
|
1153
|
+
return { error: `Line ${l.line}: missing key field "${keyField}"` };
|
|
1154
|
+
}
|
|
1155
|
+
key = JSON.stringify(parsed[keyField]);
|
|
1156
|
+
} else {
|
|
1157
|
+
key = JSON.stringify(parsed);
|
|
1158
|
+
}
|
|
1159
|
+
if (seen.has(key)) {
|
|
1160
|
+
removedLines.push(l.line);
|
|
1161
|
+
} else {
|
|
1162
|
+
seen.add(key);
|
|
1163
|
+
keptRaw.push(l.raw.trim());
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
return {
|
|
1167
|
+
totalLines: validated.totalLines,
|
|
1168
|
+
uniqueLines: keptRaw.length,
|
|
1169
|
+
duplicatesRemoved: removedLines.length,
|
|
1170
|
+
output: keptRaw.join("\n"),
|
|
1171
|
+
removedLines
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1142
1174
|
var _SUBTITLE_TIMESTAMP_RE = /(\d+):(\d{1,2}):(\d{1,2})[.,](\d{1,3})|(\d{1,3}):(\d{1,2})[.,](\d{1,3})/;
|
|
1143
1175
|
var _VTT_BLOCK_KEYWORDS = ["NOTE", "STYLE", "REGION"];
|
|
1144
1176
|
function parseSubtitleTimestamp(raw) {
|
|
@@ -1747,6 +1779,7 @@ exports.calculateMarkdownTaskListProgress = calculateMarkdownTaskListProgress;
|
|
|
1747
1779
|
exports.convertSubtitles = convertSubtitles;
|
|
1748
1780
|
exports.csvToJson = csvToJson;
|
|
1749
1781
|
exports.csvToSqlInsert = csvToSqlInsert;
|
|
1782
|
+
exports.dedupeNdjson = dedupeNdjson;
|
|
1750
1783
|
exports.detectDelimiter = detectDelimiter;
|
|
1751
1784
|
exports.detectSubtitleFormat = detectSubtitleFormat;
|
|
1752
1785
|
exports.diffEnvExample = diffEnvExample;
|
package/dist/tools/data.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as
|
|
1
|
+
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as NdjsonDedupeResult, w as NdjsonLineResult, x as NdjsonValidateResult, P as ParseOptions, y as ParsedIni, z as ParsedSubtitles, S as SubtitleCue, A as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, B as XmlToJsonOptions, Y as YamlAnchorInfo, D as YamlAnchorResolveError, G as YamlAnchorResolveResult, H as analyzeCaptionSpeed, J as calculateMarkdownTaskListProgress, K as convertSubtitles, L as csvToJson, O as csvToSqlInsert, Q as dedupeNdjson, R as detectDelimiter, U as detectSubtitleFormat, W as diffEnvExample, Z as envToExport, _ as envToJson, $ as findCsvDuplicateRows, a0 as formatNdjson, a1 as formatSubtitleTimestamp, a2 as formatToml, a3 as formatXml, a4 as generateMarkdownToc, a5 as getSection, a6 as getSectionNames, a7 as getTomlStats, a8 as getXmlStats, a9 as getYamlStats, aa as inferCsvColumnTypes, ab as iniToJson, ac as jsonArrayToNdjson, ad as jsonToIni, ae as jsonToToml, af as jsonToXml, ag as minifyNdjson, ah as minifyToml, ai as minifyXml, aj as ndjsonToJsonArray, ak as parseCsv, al as parseEnv, am as parseFrontMatter, an as parseIni, ao as parseSubtitleTimestamp, ap as parseSubtitles, aq as parseXmlToObject, ar as resolveYamlAnchors, as as serializeSubtitles, at as shiftSubtitles, au as stringifyIni, av as toCsvString, aw as tomlToJson, ax as validateEnvKey, ay as validateIni, az as validateNdjson, aA as validateToml, aB as validateXml, aC as validateYaml, aD as xmlToJson } from '../data-vxXrBlWh.cjs';
|
package/dist/tools/data.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as
|
|
1
|
+
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as NdjsonDedupeResult, w as NdjsonLineResult, x as NdjsonValidateResult, P as ParseOptions, y as ParsedIni, z as ParsedSubtitles, S as SubtitleCue, A as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, B as XmlToJsonOptions, Y as YamlAnchorInfo, D as YamlAnchorResolveError, G as YamlAnchorResolveResult, H as analyzeCaptionSpeed, J as calculateMarkdownTaskListProgress, K as convertSubtitles, L as csvToJson, O as csvToSqlInsert, Q as dedupeNdjson, R as detectDelimiter, U as detectSubtitleFormat, W as diffEnvExample, Z as envToExport, _ as envToJson, $ as findCsvDuplicateRows, a0 as formatNdjson, a1 as formatSubtitleTimestamp, a2 as formatToml, a3 as formatXml, a4 as generateMarkdownToc, a5 as getSection, a6 as getSectionNames, a7 as getTomlStats, a8 as getXmlStats, a9 as getYamlStats, aa as inferCsvColumnTypes, ab as iniToJson, ac as jsonArrayToNdjson, ad as jsonToIni, ae as jsonToToml, af as jsonToXml, ag as minifyNdjson, ah as minifyToml, ai as minifyXml, aj as ndjsonToJsonArray, ak as parseCsv, al as parseEnv, am as parseFrontMatter, an as parseIni, ao as parseSubtitleTimestamp, ap as parseSubtitles, aq as parseXmlToObject, ar as resolveYamlAnchors, as as serializeSubtitles, at as shiftSubtitles, au as stringifyIni, av as toCsvString, aw as tomlToJson, ax as validateEnvKey, ay as validateIni, az as validateNdjson, aA as validateToml, aB as validateXml, aC as validateYaml, aD as xmlToJson } from '../data-vxXrBlWh.js';
|
package/dist/tools/data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { analyzeCaptionSpeed, calculateMarkdownTaskListProgress, convertSubtitles, csvToJson, csvToSqlInsert, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, inferCsvColumnTypes, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-
|
|
1
|
+
export { analyzeCaptionSpeed, calculateMarkdownTaskListProgress, convertSubtitles, csvToJson, csvToSqlInsert, dedupeNdjson, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, inferCsvColumnTypes, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-QY2M2UHJ.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
|
@@ -600,6 +600,20 @@ async function generateQrDataUrl(text, options) {
|
|
|
600
600
|
}
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
+
function generateCspNonce(byteLength = 16) {
|
|
604
|
+
if (!Number.isInteger(byteLength) || byteLength < 8 || byteLength > 64) {
|
|
605
|
+
return { error: "Byte length must be a whole number between 8 and 64" };
|
|
606
|
+
}
|
|
607
|
+
const nonce = crypto.randomBytes(byteLength).toString("base64");
|
|
608
|
+
return {
|
|
609
|
+
nonce,
|
|
610
|
+
byteLength,
|
|
611
|
+
scriptSrcDirective: `script-src 'nonce-${nonce}'`,
|
|
612
|
+
styleSrcDirective: `style-src 'nonce-${nonce}'`,
|
|
613
|
+
scriptTag: `<script nonce="${nonce}">`,
|
|
614
|
+
styleTag: `<style nonce="${nonce}">`
|
|
615
|
+
};
|
|
616
|
+
}
|
|
603
617
|
|
|
604
618
|
exports.AMBIGUOUS_CHARS = AMBIGUOUS_CHARS;
|
|
605
619
|
exports.DATA_TYPES = DATA_TYPES;
|
|
@@ -612,6 +626,7 @@ exports.estimatePasswordEntropy = estimatePasswordEntropy;
|
|
|
612
626
|
exports.generateBulk = generateBulk;
|
|
613
627
|
exports.generateBulkPasswords = generateBulkPasswords;
|
|
614
628
|
exports.generateBulkUlids = generateBulkUlids;
|
|
629
|
+
exports.generateCspNonce = generateCspNonce;
|
|
615
630
|
exports.generateData = generateData;
|
|
616
631
|
exports.generatePassword = generatePassword;
|
|
617
632
|
exports.generateQrDataUrl = generateQrDataUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as
|
|
1
|
+
export { A as AMBIGUOUS_CHARS, C as CspNonceResult, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as generateCspNonce, r as generateData, s as generatePassword, t as generateQrDataUrl, u as generateQrSvg, v as generateSingle, w as generateUlid, x as generateUuid, y as generateV4, z as generateV7, B as isValidUlid, E as isValidUuid, F as parseUlid, H as parseUuidVersion } from '../generators-DAXXrMvG.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as
|
|
1
|
+
export { A as AMBIGUOUS_CHARS, C as CspNonceResult, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as generateCspNonce, r as generateData, s as generatePassword, t as generateQrDataUrl, u as generateQrSvg, v as generateSingle, w as generateUlid, x as generateUuid, y as generateV4, z as generateV7, B as isValidUlid, E as isValidUuid, F as parseUlid, H as parseUuidVersion } from '../generators-DAXXrMvG.js';
|
package/dist/tools/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AMBIGUOUS_CHARS, DATA_TYPES, DEFAULT_OPTIONS, DEFAULT_QR_OPTIONS, SYMBOL_CHARS, ULID_REGEX, checkStrength, estimatePasswordEntropy, generateBulk, generateBulkPasswords, generateBulkUlids, generateData, generatePassword, generateQrDataUrl, generateQrSvg, generateSingle, generateUlid, generateUuid, generateV4, generateV7, isValidUlid, isValidUuid, parseUlid, parseUuidVersion } from '../chunk-
|
|
1
|
+
export { AMBIGUOUS_CHARS, DATA_TYPES, DEFAULT_OPTIONS, DEFAULT_QR_OPTIONS, SYMBOL_CHARS, ULID_REGEX, checkStrength, estimatePasswordEntropy, generateBulk, generateBulkPasswords, generateBulkUlids, generateCspNonce, generateData, generatePassword, generateQrDataUrl, generateQrSvg, generateSingle, generateUlid, generateUuid, generateV4, generateV7, isValidUlid, isValidUuid, parseUlid, parseUuidVersion } from '../chunk-422ICOZX.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/json.cjs
CHANGED
|
@@ -1392,7 +1392,39 @@ function jsonSchemaToTypescript(schemaJson, options) {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
return parts.join("\n\n");
|
|
1394
1394
|
}
|
|
1395
|
+
function _isMergePatchObject(value) {
|
|
1396
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1397
|
+
}
|
|
1398
|
+
function mergeJsonPatch(target, patch) {
|
|
1399
|
+
if (!_isMergePatchObject(patch)) return patch;
|
|
1400
|
+
const result = _isMergePatchObject(target) ? { ...target } : {};
|
|
1401
|
+
for (const key of Object.keys(patch)) {
|
|
1402
|
+
const value = patch[key];
|
|
1403
|
+
if (value === null) {
|
|
1404
|
+
delete result[key];
|
|
1405
|
+
} else {
|
|
1406
|
+
result[key] = mergeJsonPatch(result[key], value);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
return result;
|
|
1410
|
+
}
|
|
1411
|
+
function applyJsonMergePatch(targetJson, patchJson) {
|
|
1412
|
+
let target;
|
|
1413
|
+
try {
|
|
1414
|
+
target = JSON.parse(targetJson);
|
|
1415
|
+
} catch {
|
|
1416
|
+
return { error: "Target is not valid JSON" };
|
|
1417
|
+
}
|
|
1418
|
+
let patch;
|
|
1419
|
+
try {
|
|
1420
|
+
patch = JSON.parse(patchJson);
|
|
1421
|
+
} catch {
|
|
1422
|
+
return { error: "Patch is not valid JSON" };
|
|
1423
|
+
}
|
|
1424
|
+
return { result: mergeJsonPatch(target, patch) };
|
|
1425
|
+
}
|
|
1395
1426
|
|
|
1427
|
+
exports.applyJsonMergePatch = applyJsonMergePatch;
|
|
1396
1428
|
exports.csvToJson = csvToJson;
|
|
1397
1429
|
exports.detectFormat = detectFormat;
|
|
1398
1430
|
exports.diffJson = diffJson;
|
|
@@ -1411,6 +1443,7 @@ exports.jsonToPython = jsonToPython;
|
|
|
1411
1443
|
exports.jsonToTypescript = jsonToTypescript;
|
|
1412
1444
|
exports.jsonToYaml = jsonToYaml;
|
|
1413
1445
|
exports.jsonToZod = jsonToZod;
|
|
1446
|
+
exports.mergeJsonPatch = mergeJsonPatch;
|
|
1414
1447
|
exports.minifyJson = minifyJson;
|
|
1415
1448
|
exports.parseJson = parseJson;
|
|
1416
1449
|
exports.parseStructs = parseStructs;
|
package/dist/tools/json.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GoField, c as GoStruct, J as JsonDiffResult, d as JsonParseResult, e as JsonPathResult, f as JsonPointerResult, g as JsonSchemaLike, h as JsonSchemaToTsOptions, P as ParseStatus, i as PythonClass, k as PythonField, l as PythonMode, V as ValidationError, m as ValidationResult, Z as ZodOptions, n as
|
|
1
|
+
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GoField, c as GoStruct, J as JsonDiffResult, d as JsonParseResult, e as JsonPathResult, f as JsonPointerResult, g as JsonSchemaLike, h as JsonSchemaToTsOptions, M as MergePatchResult, P as ParseStatus, i as PythonClass, k as PythonField, l as PythonMode, V as ValidationError, m as ValidationResult, Z as ZodOptions, n as applyJsonMergePatch, o as csvToJson, p as detectFormat, q as diffJson, r as evaluateJsonPath, s as formatDiffLine, t as formatJson, u as generateExample, v as getJsonStats, w as inferGoType, x as inferPythonType, y as inferType, z as jsonSchemaToTypescript, A as jsonToCsv, B as jsonToGo, E as jsonToPython, F as jsonToTypescript, H as jsonToYaml, I as jsonToZod, K as mergeJsonPatch, L as minifyJson, N as parseJson, O as parseStructs, Q as resolveJsonPointer, R as toPascalCase, S as toSnakeCase, T as validateJson, U as validateJsonPath, W as validateJsonString, X as yamlToJson } from '../json-CaiYsGDQ.cjs';
|
package/dist/tools/json.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GoField, c as GoStruct, J as JsonDiffResult, d as JsonParseResult, e as JsonPathResult, f as JsonPointerResult, g as JsonSchemaLike, h as JsonSchemaToTsOptions, P as ParseStatus, i as PythonClass, k as PythonField, l as PythonMode, V as ValidationError, m as ValidationResult, Z as ZodOptions, n as
|
|
1
|
+
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GoField, c as GoStruct, J as JsonDiffResult, d as JsonParseResult, e as JsonPathResult, f as JsonPointerResult, g as JsonSchemaLike, h as JsonSchemaToTsOptions, M as MergePatchResult, P as ParseStatus, i as PythonClass, k as PythonField, l as PythonMode, V as ValidationError, m as ValidationResult, Z as ZodOptions, n as applyJsonMergePatch, o as csvToJson, p as detectFormat, q as diffJson, r as evaluateJsonPath, s as formatDiffLine, t as formatJson, u as generateExample, v as getJsonStats, w as inferGoType, x as inferPythonType, y as inferType, z as jsonSchemaToTypescript, A as jsonToCsv, B as jsonToGo, E as jsonToPython, F as jsonToTypescript, H as jsonToYaml, I as jsonToZod, K as mergeJsonPatch, L as minifyJson, N as parseJson, O as parseStructs, Q as resolveJsonPointer, R as toPascalCase, S as toSnakeCase, T as validateJson, U as validateJsonPath, W as validateJsonString, X as yamlToJson } from '../json-CaiYsGDQ.js';
|
package/dist/tools/json.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { csvToJson, detectFormat, diffJson, evaluateJsonPath, formatDiffLine, formatJson, generateExample, getJsonStats, inferGoType, inferPythonType, inferType, jsonSchemaToTypescript, jsonToCsv, jsonToGo, jsonToPython, jsonToTypescript, jsonToYaml, jsonToZod, minifyJson, parseJson, parseStructs, resolveJsonPointer, toPascalCase, toSnakeCase, validateJson, validateJsonPath, validateJsonString, yamlToJson } from '../chunk-
|
|
1
|
+
export { applyJsonMergePatch, csvToJson, detectFormat, diffJson, evaluateJsonPath, formatDiffLine, formatJson, generateExample, getJsonStats, inferGoType, inferPythonType, inferType, jsonSchemaToTypescript, jsonToCsv, jsonToGo, jsonToPython, jsonToTypescript, jsonToYaml, jsonToZod, mergeJsonPatch, minifyJson, parseJson, parseStructs, resolveJsonPointer, toPascalCase, toSnakeCase, validateJson, validateJsonPath, validateJsonString, yamlToJson } from '../chunk-34C6GXCC.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -2822,6 +2822,103 @@ function parseAcceptLanguage(raw) {
|
|
|
2822
2822
|
const headerValue = formatAcceptLanguageEntries(sorted);
|
|
2823
2823
|
return { header: `Accept-Language: ${headerValue}`, headerValue, entries: sorted };
|
|
2824
2824
|
}
|
|
2825
|
+
var PREFER_TOKEN_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
2826
|
+
function isPreferToken(s) {
|
|
2827
|
+
return PREFER_TOKEN_RE.test(s);
|
|
2828
|
+
}
|
|
2829
|
+
function splitPreferTopLevel(input, delim) {
|
|
2830
|
+
const parts = [];
|
|
2831
|
+
let current = "";
|
|
2832
|
+
let inQuotes = false;
|
|
2833
|
+
for (const ch of input) {
|
|
2834
|
+
if (ch === '"') inQuotes = !inQuotes;
|
|
2835
|
+
if (ch === delim && !inQuotes) {
|
|
2836
|
+
parts.push(current);
|
|
2837
|
+
current = "";
|
|
2838
|
+
} else {
|
|
2839
|
+
current += ch;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
parts.push(current);
|
|
2843
|
+
return parts;
|
|
2844
|
+
}
|
|
2845
|
+
function parsePreferTokenValue(part) {
|
|
2846
|
+
const trimmed = part.trim();
|
|
2847
|
+
if (!trimmed) return null;
|
|
2848
|
+
const eq = trimmed.indexOf("=");
|
|
2849
|
+
if (eq === -1) return { token: trimmed };
|
|
2850
|
+
const token = trimmed.slice(0, eq).trim();
|
|
2851
|
+
let value = trimmed.slice(eq + 1).trim();
|
|
2852
|
+
if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
|
|
2853
|
+
value = value.slice(1, -1);
|
|
2854
|
+
}
|
|
2855
|
+
return { token, value };
|
|
2856
|
+
}
|
|
2857
|
+
function formatPreferWord(value) {
|
|
2858
|
+
return isPreferToken(value) ? value : `"${value.replace(/"/g, '\\"')}"`;
|
|
2859
|
+
}
|
|
2860
|
+
function formatPreferPreferences(preferences) {
|
|
2861
|
+
return preferences.map((p) => {
|
|
2862
|
+
let s = p.token;
|
|
2863
|
+
if (p.value !== void 0) s += `=${formatPreferWord(p.value)}`;
|
|
2864
|
+
for (const param of p.params ?? []) {
|
|
2865
|
+
s += `;${param.name}`;
|
|
2866
|
+
if (param.value !== void 0) s += `=${formatPreferWord(param.value)}`;
|
|
2867
|
+
}
|
|
2868
|
+
return s;
|
|
2869
|
+
}).join(", ");
|
|
2870
|
+
}
|
|
2871
|
+
function buildPreferHeader(preferences) {
|
|
2872
|
+
if (!Array.isArray(preferences) || preferences.length === 0) {
|
|
2873
|
+
return { error: "At least one preference is required" };
|
|
2874
|
+
}
|
|
2875
|
+
const built = [];
|
|
2876
|
+
for (let i = 0; i < preferences.length; i++) {
|
|
2877
|
+
const { token, value, params } = preferences[i];
|
|
2878
|
+
if (typeof token !== "string" || !isPreferToken(token.trim())) {
|
|
2879
|
+
return { error: `preference ${i + 1}: token is required and must be a valid HTTP token` };
|
|
2880
|
+
}
|
|
2881
|
+
const cleanParams = [];
|
|
2882
|
+
if (params !== void 0) {
|
|
2883
|
+
if (!Array.isArray(params)) return { error: `preference ${i + 1}: params must be an array` };
|
|
2884
|
+
for (const param of params) {
|
|
2885
|
+
if (typeof param?.name !== "string" || !isPreferToken(param.name.trim())) {
|
|
2886
|
+
return { error: `preference ${i + 1}: parameter name is required and must be a valid HTTP token` };
|
|
2887
|
+
}
|
|
2888
|
+
cleanParams.push({ name: param.name.trim(), value: param.value !== void 0 ? String(param.value) : void 0 });
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
built.push({
|
|
2892
|
+
token: token.trim(),
|
|
2893
|
+
value: value !== void 0 ? String(value) : void 0,
|
|
2894
|
+
params: cleanParams.length > 0 ? cleanParams : void 0
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
const headerValue = formatPreferPreferences(built);
|
|
2898
|
+
return { header: `Prefer: ${headerValue}`, headerValue, preferences: built };
|
|
2899
|
+
}
|
|
2900
|
+
function parsePreferHeader(raw) {
|
|
2901
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
2902
|
+
const withoutLabel = raw.trim().replace(/^prefer:\s*/i, "");
|
|
2903
|
+
const parts = splitPreferTopLevel(withoutLabel, ",").map((p) => p.trim()).filter((p) => p.length > 0);
|
|
2904
|
+
if (parts.length === 0) return { error: "Input is empty" };
|
|
2905
|
+
const preferences = [];
|
|
2906
|
+
for (const part of parts) {
|
|
2907
|
+
const segments = splitPreferTopLevel(part, ";").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
2908
|
+
if (segments.length === 0) return { error: `Invalid preference: "${part}"` };
|
|
2909
|
+
const main = parsePreferTokenValue(segments[0]);
|
|
2910
|
+
if (!main || !isPreferToken(main.token)) return { error: `Invalid preference token in "${part}"` };
|
|
2911
|
+
const params = [];
|
|
2912
|
+
for (const seg of segments.slice(1)) {
|
|
2913
|
+
const p = parsePreferTokenValue(seg);
|
|
2914
|
+
if (!p || !isPreferToken(p.token)) return { error: `Invalid parameter in "${part}"` };
|
|
2915
|
+
params.push({ name: p.token, value: p.value });
|
|
2916
|
+
}
|
|
2917
|
+
preferences.push({ token: main.token, value: main.value, params: params.length > 0 ? params : void 0 });
|
|
2918
|
+
}
|
|
2919
|
+
const headerValue = formatPreferPreferences(preferences);
|
|
2920
|
+
return { header: `Prefer: ${headerValue}`, headerValue, preferences };
|
|
2921
|
+
}
|
|
2825
2922
|
|
|
2826
2923
|
exports.CLIENT_HINTS = CLIENT_HINTS;
|
|
2827
2924
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
@@ -2842,6 +2939,7 @@ exports.buildGeoUrl = buildGeoUrl;
|
|
|
2842
2939
|
exports.buildLinkHeader = buildLinkHeader;
|
|
2843
2940
|
exports.buildMapUrl = buildMapUrl;
|
|
2844
2941
|
exports.buildPermissionsPolicy = buildPermissionsPolicy;
|
|
2942
|
+
exports.buildPreferHeader = buildPreferHeader;
|
|
2845
2943
|
exports.buildRangeHeader = buildRangeHeader;
|
|
2846
2944
|
exports.buildReferrerPolicy = buildReferrerPolicy;
|
|
2847
2945
|
exports.buildVaryHeader = buildVaryHeader;
|
|
@@ -2870,6 +2968,7 @@ exports.parseGeoResponse = parseGeoResponse;
|
|
|
2870
2968
|
exports.parseHar = parseHar;
|
|
2871
2969
|
exports.parseIpv6Address = parseIpv6Address;
|
|
2872
2970
|
exports.parsePermissionsPolicy = parsePermissionsPolicy;
|
|
2971
|
+
exports.parsePreferHeader = parsePreferHeader;
|
|
2873
2972
|
exports.parseUserAgent = parseUserAgent;
|
|
2874
2973
|
exports.parseVaryHeader = parseVaryHeader;
|
|
2875
2974
|
exports.parseXContentTypeOptionsHeader = parseXContentTypeOptionsHeader;
|
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 ContentDispositionBuildOptions, k as ContentDispositionBuildResult, l as ContentDispositionParseResult, m as ContentRangeResult, o as ContentTypeRiskResult, p as ContentTypeSniffRisk, q as CookieAttributes, r as CookieCheckResult, D as DNS_RECORD_TYPES, s as DnsRecord, t as DnsRecordType, u as DnsResponse, E as EmailHeaderAnalysis, v as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, w as HarEntry, x as HarParseResult, y as HarSummary, z as HeaderCategory, F as HttpHeader, I as Ipv6AddressType, J as Ipv6ParseResult, L as LINK_REL_VALUES, K as LinkHeaderEntry, M as LinkHeaderEntryInput, N as LinkHeaderResult, O as LinkRel, P as ManifestIconInfo, Q as ManifestIssue, R as ManifestValidationResult, S as PERMISSIONS_POLICY_FEATURES, T as ParsedClientHint, U as ParsedDnsResult, V as ParsedGeoResult, W as PermissionsPolicyDirective, X as PermissionsPolicyFeatureInput, Y as PermissionsPolicyResult, Z 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 ContentDispositionBuildOptions, k as ContentDispositionBuildResult, l as ContentDispositionParseResult, m as ContentRangeResult, o as ContentTypeRiskResult, p as ContentTypeSniffRisk, q as CookieAttributes, r as CookieCheckResult, D as DNS_RECORD_TYPES, s as DnsRecord, t as DnsRecordType, u as DnsResponse, E as EmailHeaderAnalysis, v as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, w as HarEntry, x as HarParseResult, y as HarSummary, z as HeaderCategory, F as HttpHeader, I as Ipv6AddressType, J as Ipv6ParseResult, L as LINK_REL_VALUES, K as LinkHeaderEntry, M as LinkHeaderEntryInput, N as LinkHeaderResult, O as LinkRel, P as ManifestIconInfo, Q as ManifestIssue, R as ManifestValidationResult, S as PERMISSIONS_POLICY_FEATURES, T as ParsedClientHint, U as ParsedDnsResult, V as ParsedGeoResult, W as PermissionsPolicyDirective, X as PermissionsPolicyFeatureInput, Y as PermissionsPolicyResult, Z as PreferParameter, _ as PreferPreference, $ as PreferResult, a0 as REFERRER_POLICY_VALUES, a1 as RangeEntry, a2 as RangeEntryInput, a3 as RangeHeaderResult, a4 as ReceivedHop, a5 as ReferrerPolicyEntry, a6 as ReferrerPolicyResult, a7 as ReferrerPolicyValue, a8 as RobotsGroup, a9 as RobotsIssue, aa as RobotsRule, ab as RobotsValidationResult, ac as STATUS_CODES, ad as SameSiteValue, ae as SitemapIndexEntry, af as SitemapIssue, ag as SitemapSplitFile, ah as SitemapUrlEntry, ai as SitemapValidationResult, aj as SplitSitemapOptions, ak as SplitSitemapResult, al as StatusCode, am as UaDeviceType, an as UserAgentInfo, ao as VaryHeaderEntry, ap as VaryHeaderResult, aq as XContentTypeOptionsHeader, ar as XContentTypeOptionsParseResult, as as X_CONTENT_TYPE_OPTIONS_HEADER, at as analyzeEmailHeaders, au as assessContentTypeRisk, av as buildAcceptLanguage, aw as buildCacheControl, ax as buildClientHints, ay as buildContentDisposition, az as buildDnsQueryUrl, aA as buildGeoUrl, aB as buildLinkHeader, aC as buildMapUrl, aD as buildPermissionsPolicy, aE as buildPreferHeader, aF as buildRangeHeader, aG as buildReferrerPolicy, aH as buildVaryHeader, aI as buildXContentTypeOptionsHeader, aJ as checkSetCookieHeader, aK as countryCodeToFlag, aL as formatCoordinates, aM as formatTtl, aN as getByCategory, aO as getHeader, aP as getHeadersByCategory, aQ as getStatusByCategory, aR as getStatusCode, aS as isClientError, aT as isServerError, aU as isSuccess, aV as isValidIp, aW as isValidIpv4, aX as isValidIpv6, aY as parseAcceptLanguage, aZ as parseClientHintHeaders, a_ as parseContentDisposition, a$ as parseContentRangeHeader, b0 as parseDnsResponse, b1 as parseGeoResponse, b2 as parseHar, b3 as parseIpv6Address, b4 as parsePermissionsPolicy, b5 as parsePreferHeader, b6 as parseUserAgent, b7 as parseVaryHeader, b8 as parseXContentTypeOptionsHeader, b9 as searchHeaders, ba as searchStatusCodes, bb as splitSitemap, bc as statusCodeToText, bd as typeNumberToLabel, be as validateDomain, bf as validateHeaderName, bg as validateHeaderValue, bh as validateManifest, bi as validateRobotsTxt, bj as validateSitemap } from '../network-fDfM1_L6.cjs';
|