@utilix-tech/sdk 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +15 -3
- package/dist/{ai_agent-C1zudGgT.d.cts → ai_agent-CmrVjvYH.d.cts} +28 -2
- package/dist/{ai_agent-C1zudGgT.d.ts → ai_agent-CmrVjvYH.d.ts} +28 -2
- package/dist/{chunk-W3J7GZVQ.js → chunk-EKIXOA7B.js} +114 -1
- package/dist/{chunk-7WSFJTYP.js → chunk-XPNZYPM5.js} +148 -1
- package/dist/index.cjs +260 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{network-BC8McQOh.d.cts → network-DISiPMoK.d.cts} +70 -2
- package/dist/{network-BC8McQOh.d.ts → network-DISiPMoK.d.ts} +70 -2
- package/dist/tools/ai_agent.cjs +113 -0
- package/dist/tools/ai_agent.d.cts +1 -1
- package/dist/tools/ai_agent.d.ts +1 -1
- package/dist/tools/ai_agent.js +1 -1
- package/dist/tools/network.cjs +147 -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/index.cjs
CHANGED
|
@@ -9922,6 +9922,7 @@ __export(network_exports, {
|
|
|
9922
9922
|
buildMapUrl: () => buildMapUrl,
|
|
9923
9923
|
buildRangeHeader: () => buildRangeHeader,
|
|
9924
9924
|
buildReferrerPolicy: () => buildReferrerPolicy,
|
|
9925
|
+
buildVaryHeader: () => buildVaryHeader,
|
|
9925
9926
|
checkSetCookieHeader: () => checkSetCookieHeader,
|
|
9926
9927
|
countryCodeToFlag: () => countryCodeToFlag,
|
|
9927
9928
|
formatCoordinates: () => formatCoordinates,
|
|
@@ -9943,6 +9944,7 @@ __export(network_exports, {
|
|
|
9943
9944
|
parseHar: () => parseHar,
|
|
9944
9945
|
parseIpv6Address: () => parseIpv6Address,
|
|
9945
9946
|
parseUserAgent: () => parseUserAgent,
|
|
9947
|
+
parseVaryHeader: () => parseVaryHeader,
|
|
9946
9948
|
searchHeaders: () => searchHeaders,
|
|
9947
9949
|
searchStatusCodes: () => searchStatusCodes,
|
|
9948
9950
|
statusCodeToText: () => statusCodeToText,
|
|
@@ -9950,6 +9952,7 @@ __export(network_exports, {
|
|
|
9950
9952
|
validateDomain: () => validateDomain,
|
|
9951
9953
|
validateHeaderName: () => validateHeaderName,
|
|
9952
9954
|
validateHeaderValue: () => validateHeaderValue,
|
|
9955
|
+
validateManifest: () => validateManifest,
|
|
9953
9956
|
validateRobotsTxt: () => validateRobotsTxt,
|
|
9954
9957
|
validateSitemap: () => validateSitemap
|
|
9955
9958
|
});
|
|
@@ -12230,6 +12233,150 @@ function parseContentRangeHeader(header) {
|
|
|
12230
12233
|
}
|
|
12231
12234
|
return { unit, start, end, total, isUnsatisfiable, isTotalUnknown, byteLength: end - start + 1 };
|
|
12232
12235
|
}
|
|
12236
|
+
var VARY_HEADER_NOTES = {
|
|
12237
|
+
"accept-encoding": "Caches must store a separate response per compression scheme (gzip, br, etc.) the client accepts.",
|
|
12238
|
+
"accept-language": "Caches must store a separate response per requested language, which can fragment a shared cache badly if Accept-Language values are highly varied.",
|
|
12239
|
+
"accept": "Caches must store a separate response per requested content type (e.g. JSON vs HTML).",
|
|
12240
|
+
"user-agent": "Caches must store a separate response per distinct User-Agent string, which is often unique enough to make caching nearly ineffective.",
|
|
12241
|
+
"authorization": "Signals the response is user-specific; most shared caches will refuse to cache it at all rather than key on this header.",
|
|
12242
|
+
"cookie": "Same effect as Authorization: shared caches typically treat the response as private and skip caching rather than key on cookie values.",
|
|
12243
|
+
"origin": "Caches must store a separate response per requesting Origin, needed whenever a response includes CORS headers that differ by origin.",
|
|
12244
|
+
"x-requested-with": "Caches must store a separate response depending on whether the request was made via an XHR/fetch client hint.",
|
|
12245
|
+
"x-forwarded-proto": "Caches must store a separate response for HTTP vs HTTPS requests, relevant behind a proxy or load balancer that terminates TLS."
|
|
12246
|
+
};
|
|
12247
|
+
function buildVaryHeader(headers) {
|
|
12248
|
+
if (!Array.isArray(headers) || headers.length === 0) return { error: "At least one header is required" };
|
|
12249
|
+
const trimmed = headers.map((h) => typeof h === "string" ? h.trim() : "").filter((h) => h.length > 0);
|
|
12250
|
+
if (trimmed.length === 0) return { error: "At least one header is required" };
|
|
12251
|
+
const warnings = [];
|
|
12252
|
+
if (trimmed.some((h) => h === "*") && trimmed.length > 1) {
|
|
12253
|
+
warnings.push('"*" makes every request effectively uncacheable; combining it with other header names is redundant, most caches will just skip caching entirely');
|
|
12254
|
+
}
|
|
12255
|
+
const seen = /* @__PURE__ */ new Map();
|
|
12256
|
+
for (const h of trimmed) {
|
|
12257
|
+
const key = h.toLowerCase();
|
|
12258
|
+
if (!seen.has(key)) seen.set(key, h);
|
|
12259
|
+
}
|
|
12260
|
+
if (seen.size < trimmed.length) warnings.push("duplicate header names were removed");
|
|
12261
|
+
const entries = Array.from(seen.values()).map((h) => ({
|
|
12262
|
+
header: h,
|
|
12263
|
+
note: h === "*" ? "Every response is considered unique; most caches will not store it at all." : VARY_HEADER_NOTES[h.toLowerCase()] ?? `Caches must store a separate response per distinct ${h} value.`
|
|
12264
|
+
}));
|
|
12265
|
+
const headerValue = entries.map((e) => e.header).join(", ");
|
|
12266
|
+
return { header: `Vary: ${headerValue}`, headerValue, entries, warnings };
|
|
12267
|
+
}
|
|
12268
|
+
function parseVaryHeader(raw) {
|
|
12269
|
+
if (!raw || raw.trim() === "") return { error: "Input is empty" };
|
|
12270
|
+
const withoutLabel = raw.trim().replace(/^vary:\s*/i, "");
|
|
12271
|
+
const headers = withoutLabel.split(",").map((h) => h.trim()).filter((h) => h.length > 0);
|
|
12272
|
+
return buildVaryHeader(headers);
|
|
12273
|
+
}
|
|
12274
|
+
var VALID_MANIFEST_DISPLAY = /* @__PURE__ */ new Set(["fullscreen", "standalone", "minimal-ui", "browser"]);
|
|
12275
|
+
function validateManifest(jsonText) {
|
|
12276
|
+
if (!jsonText || !jsonText.trim()) return { error: "Input is empty" };
|
|
12277
|
+
let manifest;
|
|
12278
|
+
try {
|
|
12279
|
+
manifest = JSON.parse(jsonText);
|
|
12280
|
+
} catch (e) {
|
|
12281
|
+
return { error: `Invalid JSON: ${e.message}` };
|
|
12282
|
+
}
|
|
12283
|
+
if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest)) {
|
|
12284
|
+
return { error: "Manifest must be a JSON object" };
|
|
12285
|
+
}
|
|
12286
|
+
const m = manifest;
|
|
12287
|
+
const issues = [];
|
|
12288
|
+
if (!m.name && !m.short_name) {
|
|
12289
|
+
issues.push({ severity: "error", path: "name", message: 'Manifest must have at least one of "name" or "short_name"' });
|
|
12290
|
+
}
|
|
12291
|
+
if (m.name !== void 0 && typeof m.name !== "string") {
|
|
12292
|
+
issues.push({ severity: "error", path: "name", message: '"name" must be a string' });
|
|
12293
|
+
} else if (typeof m.name === "string" && m.name.length > 45) {
|
|
12294
|
+
issues.push({ severity: "warning", path: "name", message: `"name" is ${m.name.length} characters; keep it under ~45 to avoid truncation in install prompts` });
|
|
12295
|
+
}
|
|
12296
|
+
if (m.short_name !== void 0 && typeof m.short_name !== "string") {
|
|
12297
|
+
issues.push({ severity: "error", path: "short_name", message: '"short_name" must be a string' });
|
|
12298
|
+
} else if (typeof m.short_name === "string" && m.short_name.length > 12) {
|
|
12299
|
+
issues.push({ severity: "warning", path: "short_name", message: `"short_name" is ${m.short_name.length} characters; keep it under ~12 to avoid truncation on home screens` });
|
|
12300
|
+
}
|
|
12301
|
+
if (!m.start_url) {
|
|
12302
|
+
issues.push({ severity: "error", path: "start_url", message: 'Manifest is missing "start_url"' });
|
|
12303
|
+
} else if (typeof m.start_url !== "string") {
|
|
12304
|
+
issues.push({ severity: "error", path: "start_url", message: '"start_url" must be a string' });
|
|
12305
|
+
} else if (m.start_url.startsWith("//")) {
|
|
12306
|
+
issues.push({ severity: "warning", path: "start_url", message: '"start_url" looks protocol-relative; use a relative path (e.g. "/") or a full absolute URL instead' });
|
|
12307
|
+
}
|
|
12308
|
+
if (m.display !== void 0) {
|
|
12309
|
+
if (typeof m.display !== "string" || !VALID_MANIFEST_DISPLAY.has(m.display)) {
|
|
12310
|
+
issues.push({ severity: "error", path: "display", message: `"display" must be one of: ${[...VALID_MANIFEST_DISPLAY].join(", ")}` });
|
|
12311
|
+
}
|
|
12312
|
+
} else {
|
|
12313
|
+
issues.push({ severity: "warning", path: "display", message: 'Missing "display"; it defaults to "browser", which will not open the installed app in its own standalone window' });
|
|
12314
|
+
}
|
|
12315
|
+
const icons = [];
|
|
12316
|
+
let hasMaskableIcon = false;
|
|
12317
|
+
let has512Icon = false;
|
|
12318
|
+
if (!Array.isArray(m.icons) || m.icons.length === 0) {
|
|
12319
|
+
issues.push({ severity: "error", path: "icons", message: 'Manifest must have a non-empty "icons" array' });
|
|
12320
|
+
} else {
|
|
12321
|
+
m.icons.forEach((icon, i) => {
|
|
12322
|
+
const path = `icons[${i}]`;
|
|
12323
|
+
if (!icon || typeof icon !== "object") {
|
|
12324
|
+
issues.push({ severity: "error", path, message: "Icon entry must be an object" });
|
|
12325
|
+
return;
|
|
12326
|
+
}
|
|
12327
|
+
const iconObj = icon;
|
|
12328
|
+
if (!iconObj.src || typeof iconObj.src !== "string") {
|
|
12329
|
+
issues.push({ severity: "error", path, message: 'Icon entry is missing a required "src"' });
|
|
12330
|
+
}
|
|
12331
|
+
if (iconObj.sizes !== void 0) {
|
|
12332
|
+
if (typeof iconObj.sizes !== "string" || iconObj.sizes !== "any" && !/^\d+x\d+(\s+\d+x\d+)*$/i.test(iconObj.sizes)) {
|
|
12333
|
+
issues.push({ severity: "warning", path, message: `"sizes" value "${String(iconObj.sizes)}" doesn't match the expected "WIDTHxHEIGHT" format` });
|
|
12334
|
+
} else if (/(^|\s)512x512(\s|$)/i.test(iconObj.sizes)) {
|
|
12335
|
+
has512Icon = true;
|
|
12336
|
+
}
|
|
12337
|
+
}
|
|
12338
|
+
if (typeof iconObj.purpose === "string" && iconObj.purpose.toLowerCase().includes("maskable")) {
|
|
12339
|
+
hasMaskableIcon = true;
|
|
12340
|
+
}
|
|
12341
|
+
icons.push({
|
|
12342
|
+
src: typeof iconObj.src === "string" ? iconObj.src : "",
|
|
12343
|
+
sizes: typeof iconObj.sizes === "string" ? iconObj.sizes : void 0,
|
|
12344
|
+
type: typeof iconObj.type === "string" ? iconObj.type : void 0,
|
|
12345
|
+
purpose: typeof iconObj.purpose === "string" ? iconObj.purpose : void 0
|
|
12346
|
+
});
|
|
12347
|
+
});
|
|
12348
|
+
if (icons.length > 0) {
|
|
12349
|
+
if (!has512Icon) {
|
|
12350
|
+
issues.push({ severity: "warning", path: "icons", message: "No icon sized 512x512 found; this size is used for splash screens and app store listings" });
|
|
12351
|
+
}
|
|
12352
|
+
if (!hasMaskableIcon) {
|
|
12353
|
+
issues.push({ severity: "warning", path: "icons", message: 'No icon with purpose "maskable" (or "any maskable") found; without one, Android may crop your icon into its adaptive icon mask' });
|
|
12354
|
+
}
|
|
12355
|
+
}
|
|
12356
|
+
}
|
|
12357
|
+
if (m.theme_color !== void 0 && typeof m.theme_color !== "string") {
|
|
12358
|
+
issues.push({ severity: "error", path: "theme_color", message: '"theme_color" must be a CSS color string' });
|
|
12359
|
+
}
|
|
12360
|
+
if (m.background_color !== void 0 && typeof m.background_color !== "string") {
|
|
12361
|
+
issues.push({ severity: "error", path: "background_color", message: '"background_color" must be a CSS color string' });
|
|
12362
|
+
} else if (m.background_color === void 0) {
|
|
12363
|
+
issues.push({ severity: "warning", path: "background_color", message: 'Missing "background_color"; without it the splash screen background defaults to white' });
|
|
12364
|
+
}
|
|
12365
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
12366
|
+
return {
|
|
12367
|
+
issues,
|
|
12368
|
+
valid,
|
|
12369
|
+
summary: {
|
|
12370
|
+
name: typeof m.name === "string" ? m.name : void 0,
|
|
12371
|
+
shortName: typeof m.short_name === "string" ? m.short_name : void 0,
|
|
12372
|
+
startUrl: typeof m.start_url === "string" ? m.start_url : void 0,
|
|
12373
|
+
display: typeof m.display === "string" ? m.display : void 0,
|
|
12374
|
+
icons,
|
|
12375
|
+
hasMaskableIcon,
|
|
12376
|
+
has512Icon
|
|
12377
|
+
}
|
|
12378
|
+
};
|
|
12379
|
+
}
|
|
12233
12380
|
|
|
12234
12381
|
// src/tools/api.ts
|
|
12235
12382
|
var api_exports = {};
|
|
@@ -20081,6 +20228,7 @@ __export(ai_agent_exports, {
|
|
|
20081
20228
|
extractUrls: () => extractUrls,
|
|
20082
20229
|
flattenJson: () => flattenJson,
|
|
20083
20230
|
formatFewShotExamples: () => formatFewShotExamples,
|
|
20231
|
+
lintToolSchema: () => lintToolSchema,
|
|
20084
20232
|
mergeJson: () => mergeJson,
|
|
20085
20233
|
redactPii: () => redactPii,
|
|
20086
20234
|
repairJson: () => repairJson,
|
|
@@ -21061,6 +21209,118 @@ Output: ${e.output.trim()}`).join("\n\n");
|
|
|
21061
21209
|
}
|
|
21062
21210
|
return { formatted, exampleCount: valid.length, format };
|
|
21063
21211
|
}
|
|
21212
|
+
var TOOL_NAME_RE = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
21213
|
+
function normalizeToolDefs(data) {
|
|
21214
|
+
let rawList;
|
|
21215
|
+
if (Array.isArray(data)) {
|
|
21216
|
+
rawList = data;
|
|
21217
|
+
} else if (data && typeof data === "object" && Array.isArray(data.tools)) {
|
|
21218
|
+
rawList = data.tools;
|
|
21219
|
+
} else {
|
|
21220
|
+
rawList = [data];
|
|
21221
|
+
}
|
|
21222
|
+
const out = [];
|
|
21223
|
+
for (const item of rawList) {
|
|
21224
|
+
if (!item || typeof item !== "object") {
|
|
21225
|
+
return { error: "Each tool definition must be a JSON object" };
|
|
21226
|
+
}
|
|
21227
|
+
const obj = item;
|
|
21228
|
+
if (obj.type === "function" && obj.function && typeof obj.function === "object") {
|
|
21229
|
+
const fn = obj.function;
|
|
21230
|
+
out.push({ name: String(fn.name ?? ""), description: typeof fn.description === "string" ? fn.description : void 0, schema: fn.parameters, format: "openai" });
|
|
21231
|
+
} else if ("input_schema" in obj) {
|
|
21232
|
+
out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.input_schema, format: "anthropic" });
|
|
21233
|
+
} else if ("inputSchema" in obj) {
|
|
21234
|
+
out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.inputSchema, format: "mcp" });
|
|
21235
|
+
} else if ("parameters" in obj || "name" in obj) {
|
|
21236
|
+
out.push({ name: String(obj.name ?? ""), description: typeof obj.description === "string" ? obj.description : void 0, schema: obj.parameters, format: "bare" });
|
|
21237
|
+
} else {
|
|
21238
|
+
return { error: 'Unrecognized tool-definition format: expected an OpenAI ({type:"function",function:{...}}), Anthropic ({name,input_schema}), or MCP ({name,inputSchema}) shape' };
|
|
21239
|
+
}
|
|
21240
|
+
}
|
|
21241
|
+
return out;
|
|
21242
|
+
}
|
|
21243
|
+
function lintToolSchema(jsonText) {
|
|
21244
|
+
if (!jsonText || !jsonText.trim()) return { error: "Input is empty" };
|
|
21245
|
+
let data;
|
|
21246
|
+
try {
|
|
21247
|
+
data = JSON.parse(jsonText);
|
|
21248
|
+
} catch (e) {
|
|
21249
|
+
return { error: `Invalid JSON: ${e.message}` };
|
|
21250
|
+
}
|
|
21251
|
+
const normalized = normalizeToolDefs(data);
|
|
21252
|
+
if ("error" in normalized) return normalized;
|
|
21253
|
+
if (normalized.length === 0) return { error: "No tool definitions found" };
|
|
21254
|
+
const issues = [];
|
|
21255
|
+
const seenNames = /* @__PURE__ */ new Map();
|
|
21256
|
+
for (const tool of normalized) {
|
|
21257
|
+
const label = tool.name || "(unnamed)";
|
|
21258
|
+
seenNames.set(label, (seenNames.get(label) ?? 0) + 1);
|
|
21259
|
+
if (!tool.name) {
|
|
21260
|
+
issues.push({ severity: "error", tool: label, path: "name", message: 'Tool is missing a "name"' });
|
|
21261
|
+
} else if (!TOOL_NAME_RE.test(tool.name)) {
|
|
21262
|
+
issues.push({ severity: "error", tool: label, path: "name", message: `Tool name "${tool.name}" must match ^[a-zA-Z0-9_-]{1,64}$ (letters, digits, underscores, hyphens, max 64 chars) to be accepted by OpenAI/Anthropic function calling` });
|
|
21263
|
+
}
|
|
21264
|
+
if (!tool.description || !tool.description.trim()) {
|
|
21265
|
+
issues.push({ severity: "error", tool: label, path: "description", message: 'Tool is missing a "description" \u2014 the model relies entirely on this text to decide when to call it' });
|
|
21266
|
+
} else {
|
|
21267
|
+
if (tool.description.trim().length < 10) {
|
|
21268
|
+
issues.push({ severity: "warning", tool: label, path: "description", message: "Description is very short; a vague description measurably hurts the model's ability to pick the right tool" });
|
|
21269
|
+
}
|
|
21270
|
+
if (tool.description.length > 1024) {
|
|
21271
|
+
issues.push({ severity: "warning", tool: label, path: "description", message: `Description is ${tool.description.length} characters; long descriptions cost tokens on every request that includes this tool` });
|
|
21272
|
+
}
|
|
21273
|
+
}
|
|
21274
|
+
if (tool.schema === void 0 || tool.schema === null) {
|
|
21275
|
+
issues.push({ severity: "warning", tool: label, path: "parameters", message: "Tool has no parameter schema; only correct if the tool genuinely takes no arguments" });
|
|
21276
|
+
continue;
|
|
21277
|
+
}
|
|
21278
|
+
if (typeof tool.schema !== "object" || Array.isArray(tool.schema)) {
|
|
21279
|
+
issues.push({ severity: "error", tool: label, path: "parameters", message: "Parameter schema must be a JSON Schema object" });
|
|
21280
|
+
continue;
|
|
21281
|
+
}
|
|
21282
|
+
const schema = tool.schema;
|
|
21283
|
+
if (schema.type !== void 0 && schema.type !== "object") {
|
|
21284
|
+
issues.push({ severity: "error", tool: label, path: "parameters.type", message: `Top-level parameter schema type is "${String(schema.type)}"; OpenAI and Anthropic both require "object" at the top level` });
|
|
21285
|
+
}
|
|
21286
|
+
const properties = schema.properties;
|
|
21287
|
+
if (properties !== void 0 && (typeof properties !== "object" || properties === null || Array.isArray(properties))) {
|
|
21288
|
+
issues.push({ severity: "error", tool: label, path: "parameters.properties", message: '"properties" must be an object' });
|
|
21289
|
+
} else if (properties && typeof properties === "object") {
|
|
21290
|
+
const propsObj = properties;
|
|
21291
|
+
const propNames = Object.keys(propsObj);
|
|
21292
|
+
for (const propName of propNames) {
|
|
21293
|
+
const prop = propsObj[propName];
|
|
21294
|
+
const propPath = `parameters.properties.${propName}`;
|
|
21295
|
+
if (!prop || typeof prop !== "object") {
|
|
21296
|
+
issues.push({ severity: "error", tool: label, path: propPath, message: "Property schema must be an object" });
|
|
21297
|
+
continue;
|
|
21298
|
+
}
|
|
21299
|
+
const propObj = prop;
|
|
21300
|
+
if (!propObj.description) {
|
|
21301
|
+
issues.push({ severity: "warning", tool: label, path: propPath, message: `Property "${propName}" has no description; missing per-parameter descriptions measurably hurt model accuracy on which value to pass` });
|
|
21302
|
+
}
|
|
21303
|
+
if (Array.isArray(propObj.enum) && propObj.enum.length === 0) {
|
|
21304
|
+
issues.push({ severity: "error", tool: label, path: propPath, message: `Property "${propName}" has an empty "enum" array` });
|
|
21305
|
+
}
|
|
21306
|
+
}
|
|
21307
|
+
if (Array.isArray(schema.required)) {
|
|
21308
|
+
for (const req of schema.required) {
|
|
21309
|
+
if (typeof req === "string" && !propNames.includes(req)) {
|
|
21310
|
+
issues.push({ severity: "error", tool: label, path: "parameters.required", message: `"required" lists "${req}", which isn't defined in "properties"` });
|
|
21311
|
+
}
|
|
21312
|
+
}
|
|
21313
|
+
}
|
|
21314
|
+
}
|
|
21315
|
+
}
|
|
21316
|
+
for (const [name, count] of seenNames) {
|
|
21317
|
+
if (count > 1 && name !== "(unnamed)") {
|
|
21318
|
+
issues.push({ severity: "error", tool: name, path: "name", message: `Tool name "${name}" is used ${count} times; tool names must be unique within a single request` });
|
|
21319
|
+
}
|
|
21320
|
+
}
|
|
21321
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
21322
|
+
return { toolCount: normalized.length, issues, valid };
|
|
21323
|
+
}
|
|
21064
21324
|
|
|
21065
21325
|
// src/tools/media.ts
|
|
21066
21326
|
var media_exports = {};
|
package/dist/index.d.cts
CHANGED
|
@@ -6,13 +6,13 @@ export { d as data } from './data-BKpEOcOX.cjs';
|
|
|
6
6
|
export { g as generators } from './generators-Du8cBesn.cjs';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.cjs';
|
|
8
8
|
export { u as units } from './units-CzPwRC03.cjs';
|
|
9
|
-
export { n as network } from './network-
|
|
9
|
+
export { n as network } from './network-DISiPMoK.cjs';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.cjs';
|
|
11
11
|
export { c as code } from './code-KXoRsHtl.cjs';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.cjs';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.cjs';
|
|
15
|
-
export { a as ai_agent } from './ai_agent-
|
|
15
|
+
export { a as ai_agent } from './ai_agent-CmrVjvYH.cjs';
|
|
16
16
|
export { m as media } from './media-fD8dJ5qR.cjs';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ export { d as data } from './data-BKpEOcOX.js';
|
|
|
6
6
|
export { g as generators } from './generators-Du8cBesn.js';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.js';
|
|
8
8
|
export { u as units } from './units-CzPwRC03.js';
|
|
9
|
-
export { n as network } from './network-
|
|
9
|
+
export { n as network } from './network-DISiPMoK.js';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.js';
|
|
11
11
|
export { c as code } from './code-KXoRsHtl.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.js';
|
|
15
|
-
export { a as ai_agent } from './ai_agent-
|
|
15
|
+
export { a as ai_agent } from './ai_agent-CmrVjvYH.js';
|
|
16
16
|
export { m as media } from './media-fD8dJ5qR.js';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-L6V4W4SU.js';
|
|
2
2
|
export { units_exports as units } from './chunk-2MTHD2LG.js';
|
|
3
|
-
export { network_exports as network } from './chunk-
|
|
3
|
+
export { network_exports as network } from './chunk-XPNZYPM5.js';
|
|
4
4
|
export { api_exports as api } from './chunk-52ZDKSIX.js';
|
|
5
5
|
export { code_exports as code } from './chunk-JL7YTXRB.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
7
7
|
export { css_exports as css } from './chunk-6YPV2AB5.js';
|
|
8
8
|
export { misc_exports as misc } from './chunk-GX7H6TAX.js';
|
|
9
|
-
export { ai_agent_exports as ai_agent } from './chunk-
|
|
9
|
+
export { ai_agent_exports as ai_agent } from './chunk-EKIXOA7B.js';
|
|
10
10
|
export { json_exports as json } from './chunk-WVEKRKGU.js';
|
|
11
11
|
export { encoding_exports as encoding } from './chunk-DOWQZUTP.js';
|
|
12
12
|
export { hashing_exports as hashing } from './chunk-PET2CGTH.js';
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* - same-site-cookie-checker: checkSetCookieHeader
|
|
19
19
|
* - email-header-analyzer: analyzeEmailHeaders
|
|
20
20
|
* - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
|
|
21
|
+
* - vary-header-builder: buildVaryHeader, parseVaryHeader
|
|
21
22
|
*/
|
|
22
23
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
23
24
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -498,6 +499,65 @@ interface ContentRangeResult {
|
|
|
498
499
|
declare function parseContentRangeHeader(header: string): ContentRangeResult | {
|
|
499
500
|
error: string;
|
|
500
501
|
};
|
|
502
|
+
interface VaryHeaderEntry {
|
|
503
|
+
header: string;
|
|
504
|
+
note: string;
|
|
505
|
+
}
|
|
506
|
+
interface VaryHeaderResult {
|
|
507
|
+
header: string;
|
|
508
|
+
headerValue: string;
|
|
509
|
+
entries: VaryHeaderEntry[];
|
|
510
|
+
warnings: string[];
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Build a `Vary` response-header value from a list of request-header names,
|
|
514
|
+
* de-duplicating case-insensitively and attaching a plain-English caching
|
|
515
|
+
* note for each well-known header (Accept-Encoding, Authorization, etc.).
|
|
516
|
+
*/
|
|
517
|
+
declare function buildVaryHeader(headers: string[]): VaryHeaderResult | {
|
|
518
|
+
error: string;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* Parse an existing `Vary` header value (with or without a leading `Vary:`
|
|
522
|
+
* label) into the same shape `buildVaryHeader` returns, for explaining a
|
|
523
|
+
* header you found on a real response rather than building one from scratch.
|
|
524
|
+
*/
|
|
525
|
+
declare function parseVaryHeader(raw: string): VaryHeaderResult | {
|
|
526
|
+
error: string;
|
|
527
|
+
};
|
|
528
|
+
interface ManifestIssue {
|
|
529
|
+
severity: 'error' | 'warning';
|
|
530
|
+
path: string;
|
|
531
|
+
message: string;
|
|
532
|
+
}
|
|
533
|
+
interface ManifestIconInfo {
|
|
534
|
+
src: string;
|
|
535
|
+
sizes?: string;
|
|
536
|
+
type?: string;
|
|
537
|
+
purpose?: string;
|
|
538
|
+
}
|
|
539
|
+
interface ManifestValidationResult {
|
|
540
|
+
issues: ManifestIssue[];
|
|
541
|
+
valid: boolean;
|
|
542
|
+
summary: {
|
|
543
|
+
name?: string;
|
|
544
|
+
shortName?: string;
|
|
545
|
+
startUrl?: string;
|
|
546
|
+
display?: string;
|
|
547
|
+
icons: ManifestIconInfo[];
|
|
548
|
+
hasMaskableIcon: boolean;
|
|
549
|
+
has512Icon: boolean;
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Validate a web app manifest.json against the W3C Web App Manifest spec's
|
|
554
|
+
* installability requirements: name/short_name, start_url, display mode, and
|
|
555
|
+
* an icons array covering a 512x512 and a maskable icon, plus recommended
|
|
556
|
+
* theme_color/background_color fields.
|
|
557
|
+
*/
|
|
558
|
+
declare function validateManifest(jsonText: string): ManifestValidationResult | {
|
|
559
|
+
error: string;
|
|
560
|
+
};
|
|
501
561
|
|
|
502
562
|
type network_AuthResultEntry = AuthResultEntry;
|
|
503
563
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
@@ -527,6 +587,9 @@ type network_LinkHeaderEntry = LinkHeaderEntry;
|
|
|
527
587
|
type network_LinkHeaderEntryInput = LinkHeaderEntryInput;
|
|
528
588
|
type network_LinkHeaderResult = LinkHeaderResult;
|
|
529
589
|
type network_LinkRel = LinkRel;
|
|
590
|
+
type network_ManifestIconInfo = ManifestIconInfo;
|
|
591
|
+
type network_ManifestIssue = ManifestIssue;
|
|
592
|
+
type network_ManifestValidationResult = ManifestValidationResult;
|
|
530
593
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
531
594
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
532
595
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
@@ -550,6 +613,8 @@ type network_SitemapValidationResult = SitemapValidationResult;
|
|
|
550
613
|
type network_StatusCode = StatusCode;
|
|
551
614
|
type network_UaDeviceType = UaDeviceType;
|
|
552
615
|
type network_UserAgentInfo = UserAgentInfo;
|
|
616
|
+
type network_VaryHeaderEntry = VaryHeaderEntry;
|
|
617
|
+
type network_VaryHeaderResult = VaryHeaderResult;
|
|
553
618
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
554
619
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
555
620
|
declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
|
|
@@ -558,6 +623,7 @@ declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
|
558
623
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
559
624
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
560
625
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
626
|
+
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
561
627
|
declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
|
|
562
628
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
563
629
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
@@ -579,6 +645,7 @@ declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
|
579
645
|
declare const network_parseHar: typeof parseHar;
|
|
580
646
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
581
647
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
648
|
+
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
582
649
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
583
650
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
584
651
|
declare const network_statusCodeToText: typeof statusCodeToText;
|
|
@@ -586,10 +653,11 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
|
|
|
586
653
|
declare const network_validateDomain: typeof validateDomain;
|
|
587
654
|
declare const network_validateHeaderName: typeof validateHeaderName;
|
|
588
655
|
declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
656
|
+
declare const network_validateManifest: typeof validateManifest;
|
|
589
657
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
590
658
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
591
659
|
declare namespace network {
|
|
592
|
-
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, 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_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
660
|
+
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, 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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, 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, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, 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 };
|
|
593
661
|
}
|
|
594
662
|
|
|
595
|
-
export {
|
|
663
|
+
export { type UaDeviceType as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ReceivedHop as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ReferrerPolicyEntry as J, type ReferrerPolicyResult as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ReferrerPolicyValue as N, type RobotsGroup as O, type ParsedDnsResult as P, type RobotsIssue as Q, REFERRER_POLICY_VALUES as R, type RobotsRule as S, type RobotsValidationResult as T, STATUS_CODES as U, type SameSiteValue as V, type SitemapIndexEntry as W, type SitemapIssue as X, type SitemapUrlEntry as Y, type SitemapValidationResult as Z, type StatusCode as _, type CacheControlOptions as a, type UserAgentInfo as a0, type VaryHeaderEntry as a1, type VaryHeaderResult as a2, analyzeEmailHeaders as a3, buildCacheControl as a4, buildDnsQueryUrl as a5, buildGeoUrl as a6, buildLinkHeader as a7, buildMapUrl as a8, buildRangeHeader as a9, statusCodeToText as aA, typeNumberToLabel as aB, validateDomain as aC, validateHeaderName as aD, validateHeaderValue as aE, validateManifest as aF, validateRobotsTxt as aG, validateSitemap as aH, buildReferrerPolicy as aa, buildVaryHeader as ab, checkSetCookieHeader as ac, countryCodeToFlag as ad, formatCoordinates as ae, formatTtl as af, getByCategory as ag, getHeader as ah, getHeadersByCategory as ai, getStatusByCategory as aj, getStatusCode as ak, isClientError as al, isServerError as am, isSuccess as an, isValidIp as ao, isValidIpv4 as ap, isValidIpv6 as aq, parseContentRangeHeader as ar, parseDnsResponse as as, parseGeoResponse as at, parseHar as au, parseIpv6Address as av, parseUserAgent as aw, parseVaryHeader as ax, searchHeaders as ay, searchStatusCodes as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedGeoResult as w, type RangeEntry as x, type RangeEntryInput as y, type RangeHeaderResult as z };
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* - same-site-cookie-checker: checkSetCookieHeader
|
|
19
19
|
* - email-header-analyzer: analyzeEmailHeaders
|
|
20
20
|
* - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
|
|
21
|
+
* - vary-header-builder: buildVaryHeader, parseVaryHeader
|
|
21
22
|
*/
|
|
22
23
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
23
24
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -498,6 +499,65 @@ interface ContentRangeResult {
|
|
|
498
499
|
declare function parseContentRangeHeader(header: string): ContentRangeResult | {
|
|
499
500
|
error: string;
|
|
500
501
|
};
|
|
502
|
+
interface VaryHeaderEntry {
|
|
503
|
+
header: string;
|
|
504
|
+
note: string;
|
|
505
|
+
}
|
|
506
|
+
interface VaryHeaderResult {
|
|
507
|
+
header: string;
|
|
508
|
+
headerValue: string;
|
|
509
|
+
entries: VaryHeaderEntry[];
|
|
510
|
+
warnings: string[];
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Build a `Vary` response-header value from a list of request-header names,
|
|
514
|
+
* de-duplicating case-insensitively and attaching a plain-English caching
|
|
515
|
+
* note for each well-known header (Accept-Encoding, Authorization, etc.).
|
|
516
|
+
*/
|
|
517
|
+
declare function buildVaryHeader(headers: string[]): VaryHeaderResult | {
|
|
518
|
+
error: string;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* Parse an existing `Vary` header value (with or without a leading `Vary:`
|
|
522
|
+
* label) into the same shape `buildVaryHeader` returns, for explaining a
|
|
523
|
+
* header you found on a real response rather than building one from scratch.
|
|
524
|
+
*/
|
|
525
|
+
declare function parseVaryHeader(raw: string): VaryHeaderResult | {
|
|
526
|
+
error: string;
|
|
527
|
+
};
|
|
528
|
+
interface ManifestIssue {
|
|
529
|
+
severity: 'error' | 'warning';
|
|
530
|
+
path: string;
|
|
531
|
+
message: string;
|
|
532
|
+
}
|
|
533
|
+
interface ManifestIconInfo {
|
|
534
|
+
src: string;
|
|
535
|
+
sizes?: string;
|
|
536
|
+
type?: string;
|
|
537
|
+
purpose?: string;
|
|
538
|
+
}
|
|
539
|
+
interface ManifestValidationResult {
|
|
540
|
+
issues: ManifestIssue[];
|
|
541
|
+
valid: boolean;
|
|
542
|
+
summary: {
|
|
543
|
+
name?: string;
|
|
544
|
+
shortName?: string;
|
|
545
|
+
startUrl?: string;
|
|
546
|
+
display?: string;
|
|
547
|
+
icons: ManifestIconInfo[];
|
|
548
|
+
hasMaskableIcon: boolean;
|
|
549
|
+
has512Icon: boolean;
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Validate a web app manifest.json against the W3C Web App Manifest spec's
|
|
554
|
+
* installability requirements: name/short_name, start_url, display mode, and
|
|
555
|
+
* an icons array covering a 512x512 and a maskable icon, plus recommended
|
|
556
|
+
* theme_color/background_color fields.
|
|
557
|
+
*/
|
|
558
|
+
declare function validateManifest(jsonText: string): ManifestValidationResult | {
|
|
559
|
+
error: string;
|
|
560
|
+
};
|
|
501
561
|
|
|
502
562
|
type network_AuthResultEntry = AuthResultEntry;
|
|
503
563
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
@@ -527,6 +587,9 @@ type network_LinkHeaderEntry = LinkHeaderEntry;
|
|
|
527
587
|
type network_LinkHeaderEntryInput = LinkHeaderEntryInput;
|
|
528
588
|
type network_LinkHeaderResult = LinkHeaderResult;
|
|
529
589
|
type network_LinkRel = LinkRel;
|
|
590
|
+
type network_ManifestIconInfo = ManifestIconInfo;
|
|
591
|
+
type network_ManifestIssue = ManifestIssue;
|
|
592
|
+
type network_ManifestValidationResult = ManifestValidationResult;
|
|
530
593
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
531
594
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
532
595
|
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
@@ -550,6 +613,8 @@ type network_SitemapValidationResult = SitemapValidationResult;
|
|
|
550
613
|
type network_StatusCode = StatusCode;
|
|
551
614
|
type network_UaDeviceType = UaDeviceType;
|
|
552
615
|
type network_UserAgentInfo = UserAgentInfo;
|
|
616
|
+
type network_VaryHeaderEntry = VaryHeaderEntry;
|
|
617
|
+
type network_VaryHeaderResult = VaryHeaderResult;
|
|
553
618
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
554
619
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
555
620
|
declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
|
|
@@ -558,6 +623,7 @@ declare const network_buildLinkHeader: typeof buildLinkHeader;
|
|
|
558
623
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
559
624
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
560
625
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
626
|
+
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
561
627
|
declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
|
|
562
628
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
563
629
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
@@ -579,6 +645,7 @@ declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
|
579
645
|
declare const network_parseHar: typeof parseHar;
|
|
580
646
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
581
647
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
648
|
+
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
582
649
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
583
650
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
584
651
|
declare const network_statusCodeToText: typeof statusCodeToText;
|
|
@@ -586,10 +653,11 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
|
|
|
586
653
|
declare const network_validateDomain: typeof validateDomain;
|
|
587
654
|
declare const network_validateHeaderName: typeof validateHeaderName;
|
|
588
655
|
declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
656
|
+
declare const network_validateManifest: typeof validateManifest;
|
|
589
657
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
590
658
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
591
659
|
declare namespace network {
|
|
592
|
-
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, 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_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
660
|
+
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, 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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, 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, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, 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 };
|
|
593
661
|
}
|
|
594
662
|
|
|
595
|
-
export {
|
|
663
|
+
export { type UaDeviceType as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ReceivedHop as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ReferrerPolicyEntry as J, type ReferrerPolicyResult as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ReferrerPolicyValue as N, type RobotsGroup as O, type ParsedDnsResult as P, type RobotsIssue as Q, REFERRER_POLICY_VALUES as R, type RobotsRule as S, type RobotsValidationResult as T, STATUS_CODES as U, type SameSiteValue as V, type SitemapIndexEntry as W, type SitemapIssue as X, type SitemapUrlEntry as Y, type SitemapValidationResult as Z, type StatusCode as _, type CacheControlOptions as a, type UserAgentInfo as a0, type VaryHeaderEntry as a1, type VaryHeaderResult as a2, analyzeEmailHeaders as a3, buildCacheControl as a4, buildDnsQueryUrl as a5, buildGeoUrl as a6, buildLinkHeader as a7, buildMapUrl as a8, buildRangeHeader as a9, statusCodeToText as aA, typeNumberToLabel as aB, validateDomain as aC, validateHeaderName as aD, validateHeaderValue as aE, validateManifest as aF, validateRobotsTxt as aG, validateSitemap as aH, buildReferrerPolicy as aa, buildVaryHeader as ab, checkSetCookieHeader as ac, countryCodeToFlag as ad, formatCoordinates as ae, formatTtl as af, getByCategory as ag, getHeader as ah, getHeadersByCategory as ai, getStatusByCategory as aj, getStatusCode as ak, isClientError as al, isServerError as am, isSuccess as an, isValidIp as ao, isValidIpv4 as ap, isValidIpv6 as aq, parseContentRangeHeader as ar, parseDnsResponse as as, parseGeoResponse as at, parseHar as au, parseIpv6Address as av, parseUserAgent as aw, parseVaryHeader as ax, searchHeaders as ay, searchStatusCodes as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedGeoResult as w, type RangeEntry as x, type RangeEntryInput as y, type RangeHeaderResult as z };
|