@utilix-tech/sdk 0.64.0 → 0.66.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 +8 -0
- package/README.md +3 -3
- package/dist/{chunk-QY2M2UHJ.js → chunk-HJVSH7FQ.js} +137 -1
- package/dist/{chunk-IANBS5Y3.js → chunk-TTQ2FNUG.js} +244 -1
- package/dist/{data-vxXrBlWh.d.cts → data-26TALa9U.d.cts} +35 -2
- package/dist/{data-vxXrBlWh.d.ts → data-26TALa9U.d.ts} +35 -2
- package/dist/index.cjs +379 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{network-DZTfMAk0.d.cts → network-EHkPJFoe.d.cts} +114 -2
- package/dist/{network-DZTfMAk0.d.ts → network-EHkPJFoe.d.ts} +114 -2
- package/dist/tools/data.cjs +136 -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/network.cjs +243 -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
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
|
|
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 MarkdownTableAlignResult, r as MarkdownTableColumnAlignment, s as MarkdownTableInfo, t as MarkdownTaskListItem, u as MarkdownTaskListProgressResult, v as MarkdownTaskListSectionSummary, w as MarkdownTocEntry, x as MarkdownTocOptions, y as MarkdownTocResult, N as NdjsonDedupeResult, z as NdjsonLineResult, A as NdjsonValidateResult, P as ParseOptions, B as ParsedIni, D as ParsedSubtitles, S as SubtitleCue, G as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, H as XmlToJsonOptions, Y as YamlAnchorInfo, J as YamlAnchorResolveError, K as YamlAnchorResolveResult, L as alignMarkdownTables, O as analyzeCaptionSpeed, Q as calculateMarkdownTaskListProgress, R as convertSubtitles, U as csvToJson, W as csvToSqlInsert, Z as dedupeNdjson, _ as detectDelimiter, $ as detectSubtitleFormat, a0 as diffEnvExample, a1 as envToExport, a2 as envToJson, a3 as findCsvDuplicateRows, a4 as formatNdjson, a5 as formatSubtitleTimestamp, a6 as formatToml, a7 as formatXml, a8 as generateMarkdownToc, a9 as getSection, aa as getSectionNames, ab as getTomlStats, ac as getXmlStats, ad as getYamlStats, ae as inferCsvColumnTypes, af as iniToJson, ag as jsonArrayToNdjson, ah as jsonToIni, ai as jsonToToml, aj as jsonToXml, ak as minifyNdjson, al as minifyToml, am as minifyXml, an as ndjsonToJsonArray, ao as parseCsv, ap as parseEnv, aq as parseFrontMatter, ar as parseIni, as as parseSubtitleTimestamp, at as parseSubtitles, au as parseXmlToObject, av as resolveYamlAnchors, aw as serializeSubtitles, ax as shiftSubtitles, ay as stringifyIni, az as toCsvString, aA as tomlToJson, aB as validateEnvKey, aC as validateIni, aD as validateNdjson, aE as validateToml, aF as validateXml, aG as validateYaml, aH as xmlToJson } from '../data-26TALa9U.js';
|
package/dist/tools/data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
1
|
+
export { alignMarkdownTables, 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-HJVSH7FQ.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -3090,6 +3090,243 @@ function parseMultipartFormData(body, boundary) {
|
|
|
3090
3090
|
}
|
|
3091
3091
|
return { boundary, parts };
|
|
3092
3092
|
}
|
|
3093
|
+
var HSTS_ONE_YEAR_SECONDS = 31536e3;
|
|
3094
|
+
function _humanizeHstsMaxAge(seconds) {
|
|
3095
|
+
if (seconds === 0) return "0 seconds (clears HSTS)";
|
|
3096
|
+
if (seconds % HSTS_ONE_YEAR_SECONDS === 0) {
|
|
3097
|
+
const years = seconds / HSTS_ONE_YEAR_SECONDS;
|
|
3098
|
+
return `${years} year${years === 1 ? "" : "s"}`;
|
|
3099
|
+
}
|
|
3100
|
+
if (seconds % 86400 === 0) {
|
|
3101
|
+
const days = seconds / 86400;
|
|
3102
|
+
return `${days} day${days === 1 ? "" : "s"}`;
|
|
3103
|
+
}
|
|
3104
|
+
if (seconds % 3600 === 0) {
|
|
3105
|
+
const hours = seconds / 3600;
|
|
3106
|
+
return `${hours} hour${hours === 1 ? "" : "s"}`;
|
|
3107
|
+
}
|
|
3108
|
+
return `${seconds} second${seconds === 1 ? "" : "s"}`;
|
|
3109
|
+
}
|
|
3110
|
+
function buildHsts(options) {
|
|
3111
|
+
if (!options || typeof options !== "object") return { error: "maxAge is required" };
|
|
3112
|
+
const { maxAge, includeSubDomains = false, preload = false } = options;
|
|
3113
|
+
if (typeof maxAge !== "number" || !Number.isFinite(maxAge) || !Number.isInteger(maxAge) || maxAge < 0) {
|
|
3114
|
+
return { error: "maxAge must be a non-negative integer number of seconds" };
|
|
3115
|
+
}
|
|
3116
|
+
const warnings = [];
|
|
3117
|
+
const preloadEligible = maxAge >= HSTS_ONE_YEAR_SECONDS && includeSubDomains && preload;
|
|
3118
|
+
if (preload && !includeSubDomains) {
|
|
3119
|
+
warnings.push("Browser HSTS preload lists require includeSubDomains whenever preload is set; this header will not qualify for preloading as configured.");
|
|
3120
|
+
}
|
|
3121
|
+
if (preload && maxAge < HSTS_ONE_YEAR_SECONDS) {
|
|
3122
|
+
warnings.push(`Browser HSTS preload lists require max-age of at least ${HSTS_ONE_YEAR_SECONDS} (1 year); ${maxAge} is too low to qualify.`);
|
|
3123
|
+
}
|
|
3124
|
+
if (maxAge === 0) {
|
|
3125
|
+
warnings.push("max-age=0 tells the browser to forget this host supports HSTS immediately, this clears HSTS rather than enabling it.");
|
|
3126
|
+
} else if (maxAge < 86400) {
|
|
3127
|
+
warnings.push("A max-age under a day gives very little protection; most real deployments use at least 15552000 (180 days) once confident HTTPS is fully working.");
|
|
3128
|
+
}
|
|
3129
|
+
const parts = [`max-age=${maxAge}`];
|
|
3130
|
+
if (includeSubDomains) parts.push("includeSubDomains");
|
|
3131
|
+
if (preload) parts.push("preload");
|
|
3132
|
+
const header = parts.join("; ");
|
|
3133
|
+
return {
|
|
3134
|
+
header,
|
|
3135
|
+
headerName: "Strict-Transport-Security",
|
|
3136
|
+
snippet: `Strict-Transport-Security: ${header}`,
|
|
3137
|
+
maxAge,
|
|
3138
|
+
maxAgeHuman: _humanizeHstsMaxAge(maxAge),
|
|
3139
|
+
includeSubDomains,
|
|
3140
|
+
preload,
|
|
3141
|
+
preloadEligible,
|
|
3142
|
+
warnings
|
|
3143
|
+
};
|
|
3144
|
+
}
|
|
3145
|
+
function parseHsts(raw) {
|
|
3146
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
3147
|
+
const withoutLabel = raw.trim().replace(/^strict-transport-security:\s*/i, "");
|
|
3148
|
+
const tokens = withoutLabel.split(";").map((t) => t.trim()).filter((t) => t !== "");
|
|
3149
|
+
if (tokens.length === 0) return { error: "No directives found" };
|
|
3150
|
+
let maxAge = null;
|
|
3151
|
+
let includeSubDomains = false;
|
|
3152
|
+
let preload = false;
|
|
3153
|
+
for (const token of tokens) {
|
|
3154
|
+
const eq = token.indexOf("=");
|
|
3155
|
+
const name = (eq === -1 ? token : token.slice(0, eq)).trim().toLowerCase();
|
|
3156
|
+
if (name === "max-age") {
|
|
3157
|
+
const rawValue = eq === -1 ? "" : token.slice(eq + 1).trim();
|
|
3158
|
+
const n = Number(rawValue);
|
|
3159
|
+
if (rawValue === "" || !Number.isFinite(n) || !Number.isInteger(n) || n < 0) {
|
|
3160
|
+
return { error: `max-age value "${rawValue}" is not a valid non-negative integer` };
|
|
3161
|
+
}
|
|
3162
|
+
maxAge = n;
|
|
3163
|
+
} else if (name === "includesubdomains") {
|
|
3164
|
+
includeSubDomains = true;
|
|
3165
|
+
} else if (name === "preload") {
|
|
3166
|
+
preload = true;
|
|
3167
|
+
} else {
|
|
3168
|
+
return { error: `Unrecognized directive "${token}"` };
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
if (maxAge === null) return { error: "max-age directive is required" };
|
|
3172
|
+
return buildHsts({ maxAge, includeSubDomains, preload });
|
|
3173
|
+
}
|
|
3174
|
+
var X_ROBOTS_TAG_FLAGS = /* @__PURE__ */ new Set(["noindex", "nofollow", "noarchive", "nosnippet", "notranslate", "noimageindex", "none", "all", "indexifembedded"]);
|
|
3175
|
+
var X_ROBOTS_TAG_FLAG_NOTES = {
|
|
3176
|
+
noindex: "Do not show this page in search results.",
|
|
3177
|
+
nofollow: "Do not follow, or pass ranking credit through, any links on this page.",
|
|
3178
|
+
noarchive: "Do not show a cached copy of this page in search results.",
|
|
3179
|
+
nosnippet: "Do not show a text snippet or video preview for this page in search results.",
|
|
3180
|
+
notranslate: "Do not offer a translation of this page in search results.",
|
|
3181
|
+
noimageindex: "Do not index images on this page.",
|
|
3182
|
+
none: "Shorthand for noindex plus nofollow combined.",
|
|
3183
|
+
all: "Explicitly allow indexing and following, the default with no directives at all.",
|
|
3184
|
+
indexifembedded: "Allow indexing of this page's content when embedded via iframe in another page, even if this page also carries noindex. Only Google supports this directive."
|
|
3185
|
+
};
|
|
3186
|
+
var X_ROBOTS_TAG_VALUED_DIRECTIVES = /* @__PURE__ */ new Set(["max-snippet", "max-image-preview", "max-video-preview", "unavailable_after"]);
|
|
3187
|
+
function _isXRobotsTagFlag(value) {
|
|
3188
|
+
return X_ROBOTS_TAG_FLAGS.has(value);
|
|
3189
|
+
}
|
|
3190
|
+
function buildXRobotsTag(options) {
|
|
3191
|
+
if (!options || typeof options !== "object") return { error: "At least one directive is required" };
|
|
3192
|
+
const { flags = [], maxSnippet, maxImagePreview, maxVideoPreview, unavailableAfter, userAgent } = options;
|
|
3193
|
+
if (!Array.isArray(flags)) return { error: "flags must be an array of directive names" };
|
|
3194
|
+
for (const flag of flags) {
|
|
3195
|
+
if (typeof flag !== "string" || !_isXRobotsTagFlag(flag)) return { error: `Unknown directive "${flag}"` };
|
|
3196
|
+
}
|
|
3197
|
+
if (maxSnippet !== void 0 && (typeof maxSnippet !== "number" || !Number.isInteger(maxSnippet) || maxSnippet < -1)) {
|
|
3198
|
+
return { error: "maxSnippet must be an integer >= -1" };
|
|
3199
|
+
}
|
|
3200
|
+
if (maxVideoPreview !== void 0 && (typeof maxVideoPreview !== "number" || !Number.isInteger(maxVideoPreview) || maxVideoPreview < -1)) {
|
|
3201
|
+
return { error: "maxVideoPreview must be an integer >= -1" };
|
|
3202
|
+
}
|
|
3203
|
+
if (maxImagePreview !== void 0 && !["none", "standard", "large"].includes(maxImagePreview)) {
|
|
3204
|
+
return { error: 'maxImagePreview must be one of "none", "standard", "large"' };
|
|
3205
|
+
}
|
|
3206
|
+
if (unavailableAfter !== void 0 && (typeof unavailableAfter !== "string" || unavailableAfter.trim() === "" || Number.isNaN(Date.parse(unavailableAfter)))) {
|
|
3207
|
+
return { error: "unavailableAfter must be a valid, parseable date string" };
|
|
3208
|
+
}
|
|
3209
|
+
const uniqueFlags = Array.from(new Set(flags));
|
|
3210
|
+
if (uniqueFlags.length === 0 && maxSnippet === void 0 && maxImagePreview === void 0 && maxVideoPreview === void 0 && unavailableAfter === void 0) {
|
|
3211
|
+
return { error: "At least one directive is required" };
|
|
3212
|
+
}
|
|
3213
|
+
const warnings = [];
|
|
3214
|
+
if (uniqueFlags.includes("none") && (uniqueFlags.includes("noindex") || uniqueFlags.includes("nofollow"))) {
|
|
3215
|
+
warnings.push('"none" already implies noindex and nofollow; combining it with either is redundant.');
|
|
3216
|
+
}
|
|
3217
|
+
if (uniqueFlags.includes("all") && uniqueFlags.some((f) => f !== "all" && f !== "indexifembedded")) {
|
|
3218
|
+
warnings.push('"all" explicitly allows indexing and following, which contradicts any restrictive directive combined with it.');
|
|
3219
|
+
}
|
|
3220
|
+
const directives = [...uniqueFlags];
|
|
3221
|
+
const notes = uniqueFlags.map((f) => `${f}: ${X_ROBOTS_TAG_FLAG_NOTES[f]}`);
|
|
3222
|
+
if (maxSnippet !== void 0) {
|
|
3223
|
+
directives.push(`max-snippet: ${maxSnippet}`);
|
|
3224
|
+
notes.push(`max-snippet: ${maxSnippet === 0 ? "Show no text snippet at all." : maxSnippet === -1 ? "No limit on snippet length." : `Limit the text snippet to at most ${maxSnippet} characters.`}`);
|
|
3225
|
+
}
|
|
3226
|
+
if (maxImagePreview !== void 0) {
|
|
3227
|
+
directives.push(`max-image-preview: ${maxImagePreview}`);
|
|
3228
|
+
notes.push(`max-image-preview: Limit any image preview shown in search results to the "${maxImagePreview}" size.`);
|
|
3229
|
+
}
|
|
3230
|
+
if (maxVideoPreview !== void 0) {
|
|
3231
|
+
directives.push(`max-video-preview: ${maxVideoPreview}`);
|
|
3232
|
+
notes.push(`max-video-preview: ${maxVideoPreview === 0 ? "Show no video preview at all, a static image only." : maxVideoPreview === -1 ? "No limit on video preview length." : `Limit the video preview to at most ${maxVideoPreview} seconds.`}`);
|
|
3233
|
+
}
|
|
3234
|
+
if (unavailableAfter !== void 0) {
|
|
3235
|
+
directives.push(`unavailable_after: ${unavailableAfter}`);
|
|
3236
|
+
notes.push(`unavailable_after: Stop showing this page in search results after this date.`);
|
|
3237
|
+
}
|
|
3238
|
+
const directivesJoined = directives.join(", ");
|
|
3239
|
+
const header = userAgent ? `${userAgent}: ${directivesJoined}` : directivesJoined;
|
|
3240
|
+
return {
|
|
3241
|
+
header,
|
|
3242
|
+
headerName: "X-Robots-Tag",
|
|
3243
|
+
snippet: `X-Robots-Tag: ${header}`,
|
|
3244
|
+
directives,
|
|
3245
|
+
notes,
|
|
3246
|
+
warnings
|
|
3247
|
+
};
|
|
3248
|
+
}
|
|
3249
|
+
function parseXRobotsTag(raw) {
|
|
3250
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
3251
|
+
let withoutLabel = raw.trim().replace(/^x-robots-tag:\s*/i, "");
|
|
3252
|
+
let userAgent;
|
|
3253
|
+
const firstColon = withoutLabel.indexOf(":");
|
|
3254
|
+
const firstComma = withoutLabel.indexOf(",");
|
|
3255
|
+
if (firstColon !== -1 && (firstComma === -1 || firstColon < firstComma)) {
|
|
3256
|
+
const candidate = withoutLabel.slice(0, firstColon).trim();
|
|
3257
|
+
const candidateLower = candidate.toLowerCase();
|
|
3258
|
+
if (candidate !== "" && !X_ROBOTS_TAG_VALUED_DIRECTIVES.has(candidateLower) && !_isXRobotsTagFlag(candidateLower)) {
|
|
3259
|
+
userAgent = candidate;
|
|
3260
|
+
withoutLabel = withoutLabel.slice(firstColon + 1).trim();
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
const tokens = withoutLabel.split(",").map((t) => t.trim()).filter((t) => t !== "");
|
|
3264
|
+
if (tokens.length === 0) return { error: "No directives found" };
|
|
3265
|
+
const flags = [];
|
|
3266
|
+
let maxSnippet;
|
|
3267
|
+
let maxImagePreview;
|
|
3268
|
+
let maxVideoPreview;
|
|
3269
|
+
let unavailableAfter;
|
|
3270
|
+
for (const token of tokens) {
|
|
3271
|
+
const eq = token.indexOf(":");
|
|
3272
|
+
const name = (eq === -1 ? token : token.slice(0, eq)).trim().toLowerCase();
|
|
3273
|
+
const value = eq === -1 ? "" : token.slice(eq + 1).trim();
|
|
3274
|
+
if (eq === -1) {
|
|
3275
|
+
if (!_isXRobotsTagFlag(name)) return { error: `Unrecognized directive "${token}"` };
|
|
3276
|
+
flags.push(name);
|
|
3277
|
+
continue;
|
|
3278
|
+
}
|
|
3279
|
+
if (name === "max-snippet") {
|
|
3280
|
+
const n = Number(value);
|
|
3281
|
+
if (value === "" || !Number.isInteger(n) || n < -1) return { error: `max-snippet value "${value}" is not a valid integer >= -1` };
|
|
3282
|
+
maxSnippet = n;
|
|
3283
|
+
} else if (name === "max-image-preview") {
|
|
3284
|
+
if (!["none", "standard", "large"].includes(value)) return { error: `max-image-preview value "${value}" must be one of "none", "standard", "large"` };
|
|
3285
|
+
maxImagePreview = value;
|
|
3286
|
+
} else if (name === "max-video-preview") {
|
|
3287
|
+
const n = Number(value);
|
|
3288
|
+
if (value === "" || !Number.isInteger(n) || n < -1) return { error: `max-video-preview value "${value}" is not a valid integer >= -1` };
|
|
3289
|
+
maxVideoPreview = n;
|
|
3290
|
+
} else if (name === "unavailable_after") {
|
|
3291
|
+
if (value === "" || Number.isNaN(Date.parse(value))) return { error: `unavailable_after value "${value}" is not a valid, parseable date` };
|
|
3292
|
+
unavailableAfter = value;
|
|
3293
|
+
} else {
|
|
3294
|
+
return { error: `Unrecognized directive "${token}"` };
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
return buildXRobotsTag({ flags, maxSnippet, maxImagePreview, maxVideoPreview, unavailableAfter, userAgent });
|
|
3298
|
+
}
|
|
3299
|
+
var WELL_KNOWN_OPCODES = {
|
|
3300
|
+
0: { name: "Continuation Frame", description: "Continues a fragmented message whose first frame was a text or binary frame sent with the FIN bit unset.", category: "data" },
|
|
3301
|
+
1: { name: "Text Frame", description: "Carries a UTF-8 encoded text payload.", category: "data" },
|
|
3302
|
+
2: { name: "Binary Frame", description: "Carries an arbitrary binary payload.", category: "data" },
|
|
3303
|
+
8: { name: "Connection Close", description: "Initiates or acknowledges closing the connection, optionally carrying a 2-byte close code and a UTF-8 reason in its payload.", category: "control" },
|
|
3304
|
+
9: { name: "Ping", description: "A control frame used to check the connection is alive; the receiver should reply with a Pong carrying the same application data.", category: "control" },
|
|
3305
|
+
10: { name: "Pong", description: "Sent in response to a Ping (or unprompted as a heartbeat), carrying the same application data as the Ping it answers.", category: "control" }
|
|
3306
|
+
};
|
|
3307
|
+
var RESERVED_NON_CONTROL_OPCODES = /* @__PURE__ */ new Set([3, 4, 5, 6, 7]);
|
|
3308
|
+
function _describeOpcode(opcode) {
|
|
3309
|
+
const known = WELL_KNOWN_OPCODES[opcode];
|
|
3310
|
+
const hex = `0x${opcode.toString(16).toUpperCase()}`;
|
|
3311
|
+
if (known) {
|
|
3312
|
+
return { opcode, hex, name: known.name, description: known.description, category: known.category, isControl: known.category === "control" };
|
|
3313
|
+
}
|
|
3314
|
+
if (RESERVED_NON_CONTROL_OPCODES.has(opcode)) {
|
|
3315
|
+
return { opcode, hex, name: "Reserved (non-control)", description: "Reserved for future non-control frame types by a later revision of the WebSocket protocol. No meaning is defined yet; a compliant endpoint must fail the connection if it receives one.", category: "reserved-non-control", isControl: false };
|
|
3316
|
+
}
|
|
3317
|
+
return { opcode, hex, name: "Reserved (control)", description: "Reserved for future control frame types by a later revision of the WebSocket protocol. No meaning is defined yet; a compliant endpoint must fail the connection if it receives one.", category: "reserved-control", isControl: true };
|
|
3318
|
+
}
|
|
3319
|
+
function listOpcodes() {
|
|
3320
|
+
const result = [];
|
|
3321
|
+
for (let opcode = 0; opcode <= 15; opcode++) result.push(_describeOpcode(opcode));
|
|
3322
|
+
return result;
|
|
3323
|
+
}
|
|
3324
|
+
function lookupOpcode(opcode) {
|
|
3325
|
+
if (typeof opcode !== "number" || !Number.isInteger(opcode) || opcode < 0 || opcode > 15) {
|
|
3326
|
+
return { error: "opcode must be an integer between 0 and 15 (0x0-0xF); the frame opcode is only a 4-bit field" };
|
|
3327
|
+
}
|
|
3328
|
+
return _describeOpcode(opcode);
|
|
3329
|
+
}
|
|
3093
3330
|
|
|
3094
3331
|
exports.CLIENT_HINTS = CLIENT_HINTS;
|
|
3095
3332
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
@@ -3107,6 +3344,7 @@ exports.buildClientHints = buildClientHints;
|
|
|
3107
3344
|
exports.buildContentDisposition = buildContentDisposition;
|
|
3108
3345
|
exports.buildDnsQueryUrl = buildDnsQueryUrl;
|
|
3109
3346
|
exports.buildGeoUrl = buildGeoUrl;
|
|
3347
|
+
exports.buildHsts = buildHsts;
|
|
3110
3348
|
exports.buildLinkHeader = buildLinkHeader;
|
|
3111
3349
|
exports.buildMapUrl = buildMapUrl;
|
|
3112
3350
|
exports.buildPermissionsPolicy = buildPermissionsPolicy;
|
|
@@ -3117,6 +3355,7 @@ exports.buildReferrerPolicy = buildReferrerPolicy;
|
|
|
3117
3355
|
exports.buildRetryAfterHeader = buildRetryAfterHeader;
|
|
3118
3356
|
exports.buildVaryHeader = buildVaryHeader;
|
|
3119
3357
|
exports.buildXContentTypeOptionsHeader = buildXContentTypeOptionsHeader;
|
|
3358
|
+
exports.buildXRobotsTag = buildXRobotsTag;
|
|
3120
3359
|
exports.checkSetCookieHeader = checkSetCookieHeader;
|
|
3121
3360
|
exports.countryCodeToFlag = countryCodeToFlag;
|
|
3122
3361
|
exports.extractMultipartBoundary = extractMultipartBoundary;
|
|
@@ -3134,7 +3373,9 @@ exports.isValidIp = isValidIp;
|
|
|
3134
3373
|
exports.isValidIpv4 = isValidIpv4;
|
|
3135
3374
|
exports.isValidIpv6 = isValidIpv6;
|
|
3136
3375
|
exports.listCloseCodes = listCloseCodes;
|
|
3376
|
+
exports.listOpcodes = listOpcodes;
|
|
3137
3377
|
exports.lookupCloseCode = lookupCloseCode;
|
|
3378
|
+
exports.lookupOpcode = lookupOpcode;
|
|
3138
3379
|
exports.parseAcceptLanguage = parseAcceptLanguage;
|
|
3139
3380
|
exports.parseClientHintHeaders = parseClientHintHeaders;
|
|
3140
3381
|
exports.parseContentDisposition = parseContentDisposition;
|
|
@@ -3142,6 +3383,7 @@ exports.parseContentRangeHeader = parseContentRangeHeader;
|
|
|
3142
3383
|
exports.parseDnsResponse = parseDnsResponse;
|
|
3143
3384
|
exports.parseGeoResponse = parseGeoResponse;
|
|
3144
3385
|
exports.parseHar = parseHar;
|
|
3386
|
+
exports.parseHsts = parseHsts;
|
|
3145
3387
|
exports.parseIpv6Address = parseIpv6Address;
|
|
3146
3388
|
exports.parseMultipartFormData = parseMultipartFormData;
|
|
3147
3389
|
exports.parsePermissionsPolicy = parsePermissionsPolicy;
|
|
@@ -3151,6 +3393,7 @@ exports.parseRetryAfterHeader = parseRetryAfterHeader;
|
|
|
3151
3393
|
exports.parseUserAgent = parseUserAgent;
|
|
3152
3394
|
exports.parseVaryHeader = parseVaryHeader;
|
|
3153
3395
|
exports.parseXContentTypeOptionsHeader = parseXContentTypeOptionsHeader;
|
|
3396
|
+
exports.parseXRobotsTag = parseXRobotsTag;
|
|
3154
3397
|
exports.searchHeaders = searchHeaders;
|
|
3155
3398
|
exports.searchStatusCodes = searchStatusCodes;
|
|
3156
3399
|
exports.splitSitemap = splitSitemap;
|
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 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
|
|
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 HstsOptions, K as HstsResult, L as HttpHeader, M as Ipv6AddressType, N as Ipv6ParseResult, O as LINK_REL_VALUES, P as LinkHeaderEntry, Q as LinkHeaderEntryInput, R as LinkHeaderResult, S as LinkRel, T as ManifestIconInfo, U as ManifestIssue, V as ManifestValidationResult, W as MultipartParseResult, X as MultipartPart, Y as OpcodeCategory, Z as OpcodeInfo, _ as PERMISSIONS_POLICY_FEATURES, $ as ParsedClientHint, a0 as ParsedDnsResult, a1 as ParsedGeoResult, a2 as PermissionsPolicyDirective, a3 as PermissionsPolicyFeatureInput, a4 as PermissionsPolicyResult, a5 as PreferParameter, a6 as PreferPreference, a7 as PreferResult, a8 as PriorityResult, a9 as REFERRER_POLICY_VALUES, aa as RangeEntry, ab as RangeEntryInput, ac as RangeHeaderResult, ad as ReceivedHop, ae as ReferrerPolicyEntry, af as ReferrerPolicyResult, ag as ReferrerPolicyValue, ah as RetryAfterDateResult, ai as RetryAfterResult, aj as RetryAfterSecondsResult, ak as RobotsGroup, al as RobotsIssue, am as RobotsRule, an as RobotsValidationResult, ao as STATUS_CODES, ap as SameSiteValue, aq as SitemapIndexEntry, ar as SitemapIssue, as as SitemapSplitFile, at as SitemapUrlEntry, au as SitemapValidationResult, av as SplitSitemapOptions, aw as SplitSitemapResult, ax as StatusCode, ay as UaDeviceType, az as UserAgentInfo, aA as VaryHeaderEntry, aB as VaryHeaderResult, aC as XContentTypeOptionsHeader, aD as XContentTypeOptionsParseResult, aE as XRobotsTagFlag, aF as XRobotsTagOptions, aG as XRobotsTagResult, aH as X_CONTENT_TYPE_OPTIONS_HEADER, aI as analyzeEmailHeaders, aJ as assessContentTypeRisk, aK as buildAcceptLanguage, aL as buildCacheControl, aM as buildClientHints, aN as buildContentDisposition, aO as buildDnsQueryUrl, aP as buildGeoUrl, aQ as buildHsts, aR as buildLinkHeader, aS as buildMapUrl, aT as buildPermissionsPolicy, aU as buildPreferHeader, aV as buildPriorityHeader, aW as buildRangeHeader, aX as buildReferrerPolicy, aY as buildRetryAfterHeader, aZ as buildVaryHeader, a_ as buildXContentTypeOptionsHeader, a$ as buildXRobotsTag, b0 as checkSetCookieHeader, b1 as countryCodeToFlag, b2 as extractMultipartBoundary, b3 as formatCoordinates, b4 as formatTtl, b5 as getByCategory, b6 as getHeader, b7 as getHeadersByCategory, b8 as getStatusByCategory, b9 as getStatusCode, ba as isClientError, bb as isServerError, bc as isSuccess, bd as isValidIp, be as isValidIpv4, bf as isValidIpv6, bg as listCloseCodes, bh as listOpcodes, bi as lookupCloseCode, bj as lookupOpcode, bk as parseAcceptLanguage, bl as parseClientHintHeaders, bm as parseContentDisposition, bn as parseContentRangeHeader, bo as parseDnsResponse, bp as parseGeoResponse, bq as parseHar, br as parseHsts, bs as parseIpv6Address, bt as parseMultipartFormData, bu as parsePermissionsPolicy, bv as parsePreferHeader, bw as parsePriorityHeader, bx as parseRetryAfterHeader, by as parseUserAgent, bz as parseVaryHeader, bA as parseXContentTypeOptionsHeader, bB as parseXRobotsTag, bC as searchHeaders, bD as searchStatusCodes, bE as splitSitemap, bF as statusCodeToText, bG as typeNumberToLabel, bH as validateDomain, bI as validateHeaderName, bJ as validateHeaderValue, bK as validateManifest, bL as validateRobotsTxt, bM as validateSitemap } from '../network-EHkPJFoe.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 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
|
|
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 HstsOptions, K as HstsResult, L as HttpHeader, M as Ipv6AddressType, N as Ipv6ParseResult, O as LINK_REL_VALUES, P as LinkHeaderEntry, Q as LinkHeaderEntryInput, R as LinkHeaderResult, S as LinkRel, T as ManifestIconInfo, U as ManifestIssue, V as ManifestValidationResult, W as MultipartParseResult, X as MultipartPart, Y as OpcodeCategory, Z as OpcodeInfo, _ as PERMISSIONS_POLICY_FEATURES, $ as ParsedClientHint, a0 as ParsedDnsResult, a1 as ParsedGeoResult, a2 as PermissionsPolicyDirective, a3 as PermissionsPolicyFeatureInput, a4 as PermissionsPolicyResult, a5 as PreferParameter, a6 as PreferPreference, a7 as PreferResult, a8 as PriorityResult, a9 as REFERRER_POLICY_VALUES, aa as RangeEntry, ab as RangeEntryInput, ac as RangeHeaderResult, ad as ReceivedHop, ae as ReferrerPolicyEntry, af as ReferrerPolicyResult, ag as ReferrerPolicyValue, ah as RetryAfterDateResult, ai as RetryAfterResult, aj as RetryAfterSecondsResult, ak as RobotsGroup, al as RobotsIssue, am as RobotsRule, an as RobotsValidationResult, ao as STATUS_CODES, ap as SameSiteValue, aq as SitemapIndexEntry, ar as SitemapIssue, as as SitemapSplitFile, at as SitemapUrlEntry, au as SitemapValidationResult, av as SplitSitemapOptions, aw as SplitSitemapResult, ax as StatusCode, ay as UaDeviceType, az as UserAgentInfo, aA as VaryHeaderEntry, aB as VaryHeaderResult, aC as XContentTypeOptionsHeader, aD as XContentTypeOptionsParseResult, aE as XRobotsTagFlag, aF as XRobotsTagOptions, aG as XRobotsTagResult, aH as X_CONTENT_TYPE_OPTIONS_HEADER, aI as analyzeEmailHeaders, aJ as assessContentTypeRisk, aK as buildAcceptLanguage, aL as buildCacheControl, aM as buildClientHints, aN as buildContentDisposition, aO as buildDnsQueryUrl, aP as buildGeoUrl, aQ as buildHsts, aR as buildLinkHeader, aS as buildMapUrl, aT as buildPermissionsPolicy, aU as buildPreferHeader, aV as buildPriorityHeader, aW as buildRangeHeader, aX as buildReferrerPolicy, aY as buildRetryAfterHeader, aZ as buildVaryHeader, a_ as buildXContentTypeOptionsHeader, a$ as buildXRobotsTag, b0 as checkSetCookieHeader, b1 as countryCodeToFlag, b2 as extractMultipartBoundary, b3 as formatCoordinates, b4 as formatTtl, b5 as getByCategory, b6 as getHeader, b7 as getHeadersByCategory, b8 as getStatusByCategory, b9 as getStatusCode, ba as isClientError, bb as isServerError, bc as isSuccess, bd as isValidIp, be as isValidIpv4, bf as isValidIpv6, bg as listCloseCodes, bh as listOpcodes, bi as lookupCloseCode, bj as lookupOpcode, bk as parseAcceptLanguage, bl as parseClientHintHeaders, bm as parseContentDisposition, bn as parseContentRangeHeader, bo as parseDnsResponse, bp as parseGeoResponse, bq as parseHar, br as parseHsts, bs as parseIpv6Address, bt as parseMultipartFormData, bu as parsePermissionsPolicy, bv as parsePreferHeader, bw as parsePriorityHeader, bx as parseRetryAfterHeader, by as parseUserAgent, bz as parseVaryHeader, bA as parseXContentTypeOptionsHeader, bB as parseXRobotsTag, bC as searchHeaders, bD as searchStatusCodes, bE as splitSitemap, bF as statusCodeToText, bG as typeNumberToLabel, bH as validateDomain, bI as validateHeaderName, bJ as validateHeaderValue, bK as validateManifest, bL as validateRobotsTxt, bM as validateSitemap } from '../network-EHkPJFoe.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, buildPriorityHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, checkSetCookieHeader, countryCodeToFlag, extractMultipartBoundary, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, listCloseCodes, lookupCloseCode, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parseMultipartFormData, parsePermissionsPolicy, parsePreferHeader, parsePriorityHeader, 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, buildHsts, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildPreferHeader, buildPriorityHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, buildXRobotsTag, checkSetCookieHeader, countryCodeToFlag, extractMultipartBoundary, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, listCloseCodes, listOpcodes, lookupCloseCode, lookupOpcode, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseHsts, parseIpv6Address, parseMultipartFormData, parsePermissionsPolicy, parsePreferHeader, parsePriorityHeader, parseRetryAfterHeader, parseUserAgent, parseVaryHeader, parseXContentTypeOptionsHeader, parseXRobotsTag, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-TTQ2FNUG.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
|
|
5
5
|
"author": "Utilix <hello@utilix.tech>",
|
|
6
6
|
"license": "MIT",
|