@utilix-tech/sdk 0.28.0 → 0.30.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 +28 -11
- package/dist/{chunk-2CJSLYWI.js → chunk-3TYWIX3B.js} +107 -1
- package/dist/{chunk-Y5OOP6WN.js → chunk-CSNTHZHF.js} +90 -1
- package/dist/{chunk-47DTCCQJ.js → chunk-L6V4W4SU.js} +112 -1
- package/dist/{chunk-WO3LJMVV.js → chunk-WVEKRKGU.js} +101 -1
- package/dist/{generators-BGtRGpJZ.d.cts → generators-Du8cBesn.d.cts} +45 -2
- package/dist/{generators-BGtRGpJZ.d.ts → generators-Du8cBesn.d.ts} +45 -2
- package/dist/index.cjs +406 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{json-DEVFIpsC.d.ts → json-Ta9JykSB.d.cts} +36 -2
- package/dist/{json-DEVFIpsC.d.cts → json-Ta9JykSB.d.ts} +36 -2
- package/dist/{media-cuxfzXxw.d.cts → media-fD8dJ5qR.d.cts} +29 -2
- package/dist/{media-cuxfzXxw.d.ts → media-fD8dJ5qR.d.ts} +29 -2
- package/dist/{network-BJOjJnmY.d.ts → network-D7Epuerc.d.cts} +23 -2
- package/dist/{network-BJOjJnmY.d.cts → network-D7Epuerc.d.ts} +23 -2
- package/dist/tools/generators.cjs +106 -0
- package/dist/tools/generators.d.cts +1 -1
- package/dist/tools/generators.d.ts +1 -1
- package/dist/tools/generators.js +1 -1
- package/dist/tools/json.cjs +100 -0
- package/dist/tools/json.d.cts +1 -1
- package/dist/tools/json.d.ts +1 -1
- package/dist/tools/json.js +1 -1
- package/dist/tools/media.cjs +111 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/network.cjs +89 -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.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { j as json } from './json-
|
|
1
|
+
export { j as json } from './json-Ta9JykSB.js';
|
|
2
2
|
export { e as encoding } from './encoding-Dk3wpmb3.js';
|
|
3
3
|
export { h as hashing } from './hashing-CnetQFD_.js';
|
|
4
4
|
export { t as text } from './text-D1fySkCB.js';
|
|
5
5
|
export { d as data } from './data-XRb0D7Zn.js';
|
|
6
|
-
export { g as generators } from './generators-
|
|
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-COt5uI20.js';
|
|
9
|
-
export { n as network } from './network-
|
|
9
|
+
export { n as network } from './network-D7Epuerc.js';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.js';
|
|
11
11
|
export { c as code } from './code-DaRvff2v.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
15
|
export { a as ai_agent } from './ai_agent-B-c59NXD.js';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-fD8dJ5qR.js';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { media_exports as media } from './chunk-
|
|
1
|
+
export { media_exports as media } from './chunk-L6V4W4SU.js';
|
|
2
2
|
export { units_exports as units } from './chunk-I63BCOAG.js';
|
|
3
|
-
export { network_exports as network } from './chunk-
|
|
3
|
+
export { network_exports as network } from './chunk-CSNTHZHF.js';
|
|
4
4
|
export { api_exports as api } from './chunk-52ZDKSIX.js';
|
|
5
5
|
export { code_exports as code } from './chunk-LXKIPPDG.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
9
|
export { ai_agent_exports as ai_agent } from './chunk-265NPGKH.js';
|
|
10
|
-
export { json_exports as json } from './chunk-
|
|
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-GEFVMGZR.js';
|
|
13
13
|
export { text_exports as text } from './chunk-AFEZ6N4A.js';
|
|
14
14
|
export { data_exports as data } from './chunk-66QHV5KW.js';
|
|
15
|
-
export { generators_exports as generators } from './chunk-
|
|
15
|
+
export { generators_exports as generators } from './chunk-3TYWIX3B.js';
|
|
16
16
|
export { time_exports as time } from './chunk-IEPWZERQ.js';
|
|
17
17
|
import './chunk-MLKGABMK.js';
|
|
18
18
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - json-to-go : jsonToGo, parseStructs, toPascalCase, inferGoType
|
|
14
14
|
* - json-to-python : jsonToPython, toSnakeCase, inferPythonType
|
|
15
15
|
* - json-to-zod : jsonToZod
|
|
16
|
+
* - json-schema-to-typescript : jsonSchemaToTypescript
|
|
16
17
|
*/
|
|
17
18
|
type ParseStatus = 'idle' | 'valid' | 'error';
|
|
18
19
|
interface JsonParseResult {
|
|
@@ -170,6 +171,36 @@ interface JsonPointerResult {
|
|
|
170
171
|
* traversal, no external calls.
|
|
171
172
|
*/
|
|
172
173
|
declare function resolveJsonPointer(json: string, pointer: string): JsonPointerResult;
|
|
174
|
+
interface JsonSchemaLike {
|
|
175
|
+
type?: string | string[];
|
|
176
|
+
properties?: Record<string, JsonSchemaLike>;
|
|
177
|
+
required?: string[];
|
|
178
|
+
items?: JsonSchemaLike | JsonSchemaLike[];
|
|
179
|
+
enum?: unknown[];
|
|
180
|
+
const?: unknown;
|
|
181
|
+
oneOf?: JsonSchemaLike[];
|
|
182
|
+
anyOf?: JsonSchemaLike[];
|
|
183
|
+
allOf?: JsonSchemaLike[];
|
|
184
|
+
$ref?: string;
|
|
185
|
+
additionalProperties?: boolean | JsonSchemaLike;
|
|
186
|
+
description?: string;
|
|
187
|
+
definitions?: Record<string, JsonSchemaLike>;
|
|
188
|
+
$defs?: Record<string, JsonSchemaLike>;
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface JsonSchemaToTsOptions {
|
|
192
|
+
rootName?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Convert a JSON Schema document into TypeScript interfaces/types. Unlike
|
|
196
|
+
* jsonToTypescript (which infers types from an example data payload), this
|
|
197
|
+
* reads the schema's declared `type`/`enum`/`required` keywords directly, so
|
|
198
|
+
* optional vs. required fields and enum/union types come through accurately
|
|
199
|
+
* instead of being guessed from a single example value.
|
|
200
|
+
*/
|
|
201
|
+
declare function jsonSchemaToTypescript(schemaJson: string, options?: JsonSchemaToTsOptions): string | {
|
|
202
|
+
error: string;
|
|
203
|
+
};
|
|
173
204
|
|
|
174
205
|
type json_ConvertOptions = ConvertOptions;
|
|
175
206
|
type json_CsvOptions = CsvOptions;
|
|
@@ -181,6 +212,8 @@ type json_JsonDiffResult = JsonDiffResult;
|
|
|
181
212
|
type json_JsonParseResult = JsonParseResult;
|
|
182
213
|
type json_JsonPathResult = JsonPathResult;
|
|
183
214
|
type json_JsonPointerResult = JsonPointerResult;
|
|
215
|
+
type json_JsonSchemaLike = JsonSchemaLike;
|
|
216
|
+
type json_JsonSchemaToTsOptions = JsonSchemaToTsOptions;
|
|
184
217
|
type json_ParseStatus = ParseStatus;
|
|
185
218
|
type json_PythonClass = PythonClass;
|
|
186
219
|
type json_PythonField = PythonField;
|
|
@@ -199,6 +232,7 @@ declare const json_getJsonStats: typeof getJsonStats;
|
|
|
199
232
|
declare const json_inferGoType: typeof inferGoType;
|
|
200
233
|
declare const json_inferPythonType: typeof inferPythonType;
|
|
201
234
|
declare const json_inferType: typeof inferType;
|
|
235
|
+
declare const json_jsonSchemaToTypescript: typeof jsonSchemaToTypescript;
|
|
202
236
|
declare const json_jsonToCsv: typeof jsonToCsv;
|
|
203
237
|
declare const json_jsonToGo: typeof jsonToGo;
|
|
204
238
|
declare const json_jsonToPython: typeof jsonToPython;
|
|
@@ -216,7 +250,7 @@ declare const json_validateJsonPath: typeof validateJsonPath;
|
|
|
216
250
|
declare const json_validateJsonString: typeof validateJsonString;
|
|
217
251
|
declare const json_yamlToJson: typeof yamlToJson;
|
|
218
252
|
declare namespace json {
|
|
219
|
-
export { type json_ConvertOptions as ConvertOptions, type json_CsvOptions as CsvOptions, type json_DiffNode as DiffNode, type json_DiffType as DiffType, type json_GoField as GoField, type json_GoStruct as GoStruct, type json_JsonDiffResult as JsonDiffResult, type json_JsonParseResult as JsonParseResult, type json_JsonPathResult as JsonPathResult, type json_JsonPointerResult as JsonPointerResult, type json_ParseStatus as ParseStatus, type json_PythonClass as PythonClass, type json_PythonField as PythonField, type json_PythonMode as PythonMode, type json_ValidationError as ValidationError, type json_ValidationResult as ValidationResult, type json_ZodOptions as ZodOptions, json_csvToJson as csvToJson, json_detectFormat as detectFormat, json_diffJson as diffJson, json_evaluateJsonPath as evaluateJsonPath, json_formatDiffLine as formatDiffLine, json_formatJson as formatJson, json_generateExample as generateExample, json_getJsonStats as getJsonStats, json_inferGoType as inferGoType, json_inferPythonType as inferPythonType, json_inferType as inferType, json_jsonToCsv as jsonToCsv, json_jsonToGo as jsonToGo, json_jsonToPython as jsonToPython, json_jsonToTypescript as jsonToTypescript, json_jsonToYaml as jsonToYaml, json_jsonToZod as jsonToZod, json_minifyJson as minifyJson, json_parseJson as parseJson, json_parseStructs as parseStructs, json_resolveJsonPointer as resolveJsonPointer, json_toPascalCase as toPascalCase, json_toSnakeCase as toSnakeCase, json_validateJson as validateJson, json_validateJsonPath as validateJsonPath, json_validateJsonString as validateJsonString, json_yamlToJson as yamlToJson };
|
|
253
|
+
export { type json_ConvertOptions as ConvertOptions, type json_CsvOptions as CsvOptions, type json_DiffNode as DiffNode, type json_DiffType as DiffType, type json_GoField as GoField, type json_GoStruct as GoStruct, type json_JsonDiffResult as JsonDiffResult, type json_JsonParseResult as JsonParseResult, type json_JsonPathResult as JsonPathResult, type json_JsonPointerResult as JsonPointerResult, type json_JsonSchemaLike as JsonSchemaLike, type json_JsonSchemaToTsOptions as JsonSchemaToTsOptions, type json_ParseStatus as ParseStatus, type json_PythonClass as PythonClass, type json_PythonField as PythonField, type json_PythonMode as PythonMode, type json_ValidationError as ValidationError, type json_ValidationResult as ValidationResult, type json_ZodOptions as ZodOptions, json_csvToJson as csvToJson, json_detectFormat as detectFormat, json_diffJson as diffJson, json_evaluateJsonPath as evaluateJsonPath, json_formatDiffLine as formatDiffLine, json_formatJson as formatJson, json_generateExample as generateExample, json_getJsonStats as getJsonStats, json_inferGoType as inferGoType, json_inferPythonType as inferPythonType, json_inferType as inferType, json_jsonSchemaToTypescript as jsonSchemaToTypescript, json_jsonToCsv as jsonToCsv, json_jsonToGo as jsonToGo, json_jsonToPython as jsonToPython, json_jsonToTypescript as jsonToTypescript, json_jsonToYaml as jsonToYaml, json_jsonToZod as jsonToZod, json_minifyJson as minifyJson, json_parseJson as parseJson, json_parseStructs as parseStructs, json_resolveJsonPointer as resolveJsonPointer, json_toPascalCase as toPascalCase, json_toSnakeCase as toSnakeCase, json_validateJson as validateJson, json_validateJsonPath as validateJsonPath, json_validateJsonString as validateJsonString, json_yamlToJson as yamlToJson };
|
|
220
254
|
}
|
|
221
255
|
|
|
222
|
-
export {
|
|
256
|
+
export { jsonToGo as A, jsonToPython as B, type ConvertOptions as C, type DiffNode as D, jsonToTypescript as E, jsonToYaml as F, type GoField as G, jsonToZod as H, minifyJson as I, type JsonDiffResult as J, parseJson as K, parseStructs as L, resolveJsonPointer as M, toPascalCase as N, toSnakeCase as O, type ParseStatus as P, validateJson as Q, validateJsonPath as R, validateJsonString as S, yamlToJson as T, type ValidationError as V, type ZodOptions as Z, type CsvOptions as a, type DiffType as b, type GoStruct as c, type JsonParseResult as d, type JsonPathResult as e, type JsonPointerResult as f, type JsonSchemaLike as g, type JsonSchemaToTsOptions as h, type PythonClass as i, json as j, type PythonField as k, type PythonMode as l, type ValidationResult as m, csvToJson as n, detectFormat as o, diffJson as p, evaluateJsonPath as q, formatDiffLine as r, formatJson as s, generateExample as t, getJsonStats as u, inferGoType as v, inferPythonType as w, inferType as x, jsonSchemaToTypescript as y, jsonToCsv as z };
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - json-to-go : jsonToGo, parseStructs, toPascalCase, inferGoType
|
|
14
14
|
* - json-to-python : jsonToPython, toSnakeCase, inferPythonType
|
|
15
15
|
* - json-to-zod : jsonToZod
|
|
16
|
+
* - json-schema-to-typescript : jsonSchemaToTypescript
|
|
16
17
|
*/
|
|
17
18
|
type ParseStatus = 'idle' | 'valid' | 'error';
|
|
18
19
|
interface JsonParseResult {
|
|
@@ -170,6 +171,36 @@ interface JsonPointerResult {
|
|
|
170
171
|
* traversal, no external calls.
|
|
171
172
|
*/
|
|
172
173
|
declare function resolveJsonPointer(json: string, pointer: string): JsonPointerResult;
|
|
174
|
+
interface JsonSchemaLike {
|
|
175
|
+
type?: string | string[];
|
|
176
|
+
properties?: Record<string, JsonSchemaLike>;
|
|
177
|
+
required?: string[];
|
|
178
|
+
items?: JsonSchemaLike | JsonSchemaLike[];
|
|
179
|
+
enum?: unknown[];
|
|
180
|
+
const?: unknown;
|
|
181
|
+
oneOf?: JsonSchemaLike[];
|
|
182
|
+
anyOf?: JsonSchemaLike[];
|
|
183
|
+
allOf?: JsonSchemaLike[];
|
|
184
|
+
$ref?: string;
|
|
185
|
+
additionalProperties?: boolean | JsonSchemaLike;
|
|
186
|
+
description?: string;
|
|
187
|
+
definitions?: Record<string, JsonSchemaLike>;
|
|
188
|
+
$defs?: Record<string, JsonSchemaLike>;
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface JsonSchemaToTsOptions {
|
|
192
|
+
rootName?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Convert a JSON Schema document into TypeScript interfaces/types. Unlike
|
|
196
|
+
* jsonToTypescript (which infers types from an example data payload), this
|
|
197
|
+
* reads the schema's declared `type`/`enum`/`required` keywords directly, so
|
|
198
|
+
* optional vs. required fields and enum/union types come through accurately
|
|
199
|
+
* instead of being guessed from a single example value.
|
|
200
|
+
*/
|
|
201
|
+
declare function jsonSchemaToTypescript(schemaJson: string, options?: JsonSchemaToTsOptions): string | {
|
|
202
|
+
error: string;
|
|
203
|
+
};
|
|
173
204
|
|
|
174
205
|
type json_ConvertOptions = ConvertOptions;
|
|
175
206
|
type json_CsvOptions = CsvOptions;
|
|
@@ -181,6 +212,8 @@ type json_JsonDiffResult = JsonDiffResult;
|
|
|
181
212
|
type json_JsonParseResult = JsonParseResult;
|
|
182
213
|
type json_JsonPathResult = JsonPathResult;
|
|
183
214
|
type json_JsonPointerResult = JsonPointerResult;
|
|
215
|
+
type json_JsonSchemaLike = JsonSchemaLike;
|
|
216
|
+
type json_JsonSchemaToTsOptions = JsonSchemaToTsOptions;
|
|
184
217
|
type json_ParseStatus = ParseStatus;
|
|
185
218
|
type json_PythonClass = PythonClass;
|
|
186
219
|
type json_PythonField = PythonField;
|
|
@@ -199,6 +232,7 @@ declare const json_getJsonStats: typeof getJsonStats;
|
|
|
199
232
|
declare const json_inferGoType: typeof inferGoType;
|
|
200
233
|
declare const json_inferPythonType: typeof inferPythonType;
|
|
201
234
|
declare const json_inferType: typeof inferType;
|
|
235
|
+
declare const json_jsonSchemaToTypescript: typeof jsonSchemaToTypescript;
|
|
202
236
|
declare const json_jsonToCsv: typeof jsonToCsv;
|
|
203
237
|
declare const json_jsonToGo: typeof jsonToGo;
|
|
204
238
|
declare const json_jsonToPython: typeof jsonToPython;
|
|
@@ -216,7 +250,7 @@ declare const json_validateJsonPath: typeof validateJsonPath;
|
|
|
216
250
|
declare const json_validateJsonString: typeof validateJsonString;
|
|
217
251
|
declare const json_yamlToJson: typeof yamlToJson;
|
|
218
252
|
declare namespace json {
|
|
219
|
-
export { type json_ConvertOptions as ConvertOptions, type json_CsvOptions as CsvOptions, type json_DiffNode as DiffNode, type json_DiffType as DiffType, type json_GoField as GoField, type json_GoStruct as GoStruct, type json_JsonDiffResult as JsonDiffResult, type json_JsonParseResult as JsonParseResult, type json_JsonPathResult as JsonPathResult, type json_JsonPointerResult as JsonPointerResult, type json_ParseStatus as ParseStatus, type json_PythonClass as PythonClass, type json_PythonField as PythonField, type json_PythonMode as PythonMode, type json_ValidationError as ValidationError, type json_ValidationResult as ValidationResult, type json_ZodOptions as ZodOptions, json_csvToJson as csvToJson, json_detectFormat as detectFormat, json_diffJson as diffJson, json_evaluateJsonPath as evaluateJsonPath, json_formatDiffLine as formatDiffLine, json_formatJson as formatJson, json_generateExample as generateExample, json_getJsonStats as getJsonStats, json_inferGoType as inferGoType, json_inferPythonType as inferPythonType, json_inferType as inferType, json_jsonToCsv as jsonToCsv, json_jsonToGo as jsonToGo, json_jsonToPython as jsonToPython, json_jsonToTypescript as jsonToTypescript, json_jsonToYaml as jsonToYaml, json_jsonToZod as jsonToZod, json_minifyJson as minifyJson, json_parseJson as parseJson, json_parseStructs as parseStructs, json_resolveJsonPointer as resolveJsonPointer, json_toPascalCase as toPascalCase, json_toSnakeCase as toSnakeCase, json_validateJson as validateJson, json_validateJsonPath as validateJsonPath, json_validateJsonString as validateJsonString, json_yamlToJson as yamlToJson };
|
|
253
|
+
export { type json_ConvertOptions as ConvertOptions, type json_CsvOptions as CsvOptions, type json_DiffNode as DiffNode, type json_DiffType as DiffType, type json_GoField as GoField, type json_GoStruct as GoStruct, type json_JsonDiffResult as JsonDiffResult, type json_JsonParseResult as JsonParseResult, type json_JsonPathResult as JsonPathResult, type json_JsonPointerResult as JsonPointerResult, type json_JsonSchemaLike as JsonSchemaLike, type json_JsonSchemaToTsOptions as JsonSchemaToTsOptions, type json_ParseStatus as ParseStatus, type json_PythonClass as PythonClass, type json_PythonField as PythonField, type json_PythonMode as PythonMode, type json_ValidationError as ValidationError, type json_ValidationResult as ValidationResult, type json_ZodOptions as ZodOptions, json_csvToJson as csvToJson, json_detectFormat as detectFormat, json_diffJson as diffJson, json_evaluateJsonPath as evaluateJsonPath, json_formatDiffLine as formatDiffLine, json_formatJson as formatJson, json_generateExample as generateExample, json_getJsonStats as getJsonStats, json_inferGoType as inferGoType, json_inferPythonType as inferPythonType, json_inferType as inferType, json_jsonSchemaToTypescript as jsonSchemaToTypescript, json_jsonToCsv as jsonToCsv, json_jsonToGo as jsonToGo, json_jsonToPython as jsonToPython, json_jsonToTypescript as jsonToTypescript, json_jsonToYaml as jsonToYaml, json_jsonToZod as jsonToZod, json_minifyJson as minifyJson, json_parseJson as parseJson, json_parseStructs as parseStructs, json_resolveJsonPointer as resolveJsonPointer, json_toPascalCase as toPascalCase, json_toSnakeCase as toSnakeCase, json_validateJson as validateJson, json_validateJsonPath as validateJsonPath, json_validateJsonString as validateJsonString, json_yamlToJson as yamlToJson };
|
|
220
254
|
}
|
|
221
255
|
|
|
222
|
-
export {
|
|
256
|
+
export { jsonToGo as A, jsonToPython as B, type ConvertOptions as C, type DiffNode as D, jsonToTypescript as E, jsonToYaml as F, type GoField as G, jsonToZod as H, minifyJson as I, type JsonDiffResult as J, parseJson as K, parseStructs as L, resolveJsonPointer as M, toPascalCase as N, toSnakeCase as O, type ParseStatus as P, validateJson as Q, validateJsonPath as R, validateJsonString as S, yamlToJson as T, type ValidationError as V, type ZodOptions as Z, type CsvOptions as a, type DiffType as b, type GoStruct as c, type JsonParseResult as d, type JsonPathResult as e, type JsonPointerResult as f, type JsonSchemaLike as g, type JsonSchemaToTsOptions as h, type PythonClass as i, json as j, type PythonField as k, type PythonMode as l, type ValidationResult as m, csvToJson as n, detectFormat as o, diffJson as p, evaluateJsonPath as q, formatDiffLine as r, formatJson as s, generateExample as t, getJsonStats as u, inferGoType as v, inferPythonType as w, inferType as x, jsonSchemaToTypescript as y, jsonToCsv as z };
|
|
@@ -64,6 +64,29 @@ interface PdfMetadataError {
|
|
|
64
64
|
* pdf.js or other PDF rendering library required.
|
|
65
65
|
*/
|
|
66
66
|
declare function readPdfMetadata(bytes: Uint8Array): PdfMetadata | PdfMetadataError;
|
|
67
|
+
type PdfPageOrientation = 'portrait' | 'landscape' | 'square' | null;
|
|
68
|
+
interface PdfPageDimension {
|
|
69
|
+
pageNumber: number;
|
|
70
|
+
widthPt: number | null;
|
|
71
|
+
heightPt: number | null;
|
|
72
|
+
widthIn: number | null;
|
|
73
|
+
heightIn: number | null;
|
|
74
|
+
rotation: number;
|
|
75
|
+
orientation: PdfPageOrientation;
|
|
76
|
+
paperSize: string | null;
|
|
77
|
+
}
|
|
78
|
+
interface PdfPageDimensionsResult {
|
|
79
|
+
version: string | null;
|
|
80
|
+
pageCount: number;
|
|
81
|
+
pages: PdfPageDimension[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* List each page's MediaBox width/height (in points and inches), rotation,
|
|
85
|
+
* and orientation, in document order — walking the Root -> Pages -> Kids
|
|
86
|
+
* tree and inheriting /MediaBox / /Rotate from ancestor nodes the way the
|
|
87
|
+
* PDF spec requires. No PDF rendering library required.
|
|
88
|
+
*/
|
|
89
|
+
declare function readPdfPageDimensions(bytes: Uint8Array): PdfPageDimensionsResult | PdfMetadataError;
|
|
67
90
|
interface WavInfo {
|
|
68
91
|
audioFormat: number;
|
|
69
92
|
audioFormatLabel: string;
|
|
@@ -194,6 +217,9 @@ type media_ImageInfo = ImageInfo;
|
|
|
194
217
|
type media_ImageInfoError = ImageInfoError;
|
|
195
218
|
type media_PdfMetadata = PdfMetadata;
|
|
196
219
|
type media_PdfMetadataError = PdfMetadataError;
|
|
220
|
+
type media_PdfPageDimension = PdfPageDimension;
|
|
221
|
+
type media_PdfPageDimensionsResult = PdfPageDimensionsResult;
|
|
222
|
+
type media_PdfPageOrientation = PdfPageOrientation;
|
|
197
223
|
type media_VideoInfo = VideoInfo;
|
|
198
224
|
type media_VideoInfoError = VideoInfoError;
|
|
199
225
|
type media_WavInfo = WavInfo;
|
|
@@ -204,10 +230,11 @@ declare const media_readIcoInfo: typeof readIcoInfo;
|
|
|
204
230
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
205
231
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
206
232
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
233
|
+
declare const media_readPdfPageDimensions: typeof readPdfPageDimensions;
|
|
207
234
|
declare const media_readVideoInfo: typeof readVideoInfo;
|
|
208
235
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
209
236
|
declare namespace media {
|
|
210
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
237
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
211
238
|
}
|
|
212
239
|
|
|
213
|
-
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type
|
|
240
|
+
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type PdfPageDimension as k, type PdfPageDimensionsResult as l, media as m, type PdfPageOrientation as n, type VideoInfoError as o, type WavInfoError as p, readFlacInfo as q, readExifData as r, readIcoInfo as s, readId3Tags as t, readImageInfo as u, readPdfMetadata as v, readPdfPageDimensions as w, readVideoInfo as x, readWavInfo as y };
|
|
@@ -64,6 +64,29 @@ interface PdfMetadataError {
|
|
|
64
64
|
* pdf.js or other PDF rendering library required.
|
|
65
65
|
*/
|
|
66
66
|
declare function readPdfMetadata(bytes: Uint8Array): PdfMetadata | PdfMetadataError;
|
|
67
|
+
type PdfPageOrientation = 'portrait' | 'landscape' | 'square' | null;
|
|
68
|
+
interface PdfPageDimension {
|
|
69
|
+
pageNumber: number;
|
|
70
|
+
widthPt: number | null;
|
|
71
|
+
heightPt: number | null;
|
|
72
|
+
widthIn: number | null;
|
|
73
|
+
heightIn: number | null;
|
|
74
|
+
rotation: number;
|
|
75
|
+
orientation: PdfPageOrientation;
|
|
76
|
+
paperSize: string | null;
|
|
77
|
+
}
|
|
78
|
+
interface PdfPageDimensionsResult {
|
|
79
|
+
version: string | null;
|
|
80
|
+
pageCount: number;
|
|
81
|
+
pages: PdfPageDimension[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* List each page's MediaBox width/height (in points and inches), rotation,
|
|
85
|
+
* and orientation, in document order — walking the Root -> Pages -> Kids
|
|
86
|
+
* tree and inheriting /MediaBox / /Rotate from ancestor nodes the way the
|
|
87
|
+
* PDF spec requires. No PDF rendering library required.
|
|
88
|
+
*/
|
|
89
|
+
declare function readPdfPageDimensions(bytes: Uint8Array): PdfPageDimensionsResult | PdfMetadataError;
|
|
67
90
|
interface WavInfo {
|
|
68
91
|
audioFormat: number;
|
|
69
92
|
audioFormatLabel: string;
|
|
@@ -194,6 +217,9 @@ type media_ImageInfo = ImageInfo;
|
|
|
194
217
|
type media_ImageInfoError = ImageInfoError;
|
|
195
218
|
type media_PdfMetadata = PdfMetadata;
|
|
196
219
|
type media_PdfMetadataError = PdfMetadataError;
|
|
220
|
+
type media_PdfPageDimension = PdfPageDimension;
|
|
221
|
+
type media_PdfPageDimensionsResult = PdfPageDimensionsResult;
|
|
222
|
+
type media_PdfPageOrientation = PdfPageOrientation;
|
|
197
223
|
type media_VideoInfo = VideoInfo;
|
|
198
224
|
type media_VideoInfoError = VideoInfoError;
|
|
199
225
|
type media_WavInfo = WavInfo;
|
|
@@ -204,10 +230,11 @@ declare const media_readIcoInfo: typeof readIcoInfo;
|
|
|
204
230
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
205
231
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
206
232
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
233
|
+
declare const media_readPdfPageDimensions: typeof readPdfPageDimensions;
|
|
207
234
|
declare const media_readVideoInfo: typeof readVideoInfo;
|
|
208
235
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
209
236
|
declare namespace media {
|
|
210
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
237
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
211
238
|
}
|
|
212
239
|
|
|
213
|
-
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type
|
|
240
|
+
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type PdfPageDimension as k, type PdfPageDimensionsResult as l, media as m, type PdfPageOrientation as n, type VideoInfoError as o, type WavInfoError as p, readFlacInfo as q, readExifData as r, readIcoInfo as s, readId3Tags as t, readImageInfo as u, readPdfMetadata as v, readPdfPageDimensions as w, readVideoInfo as x, readWavInfo as y };
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - robots-txt-validator: validateRobotsTxt
|
|
13
13
|
* - user-agent-parser: parseUserAgent
|
|
14
14
|
* - cache-control-builder: buildCacheControl
|
|
15
|
+
* - ipv6-compressor: parseIpv6Address
|
|
15
16
|
*/
|
|
16
17
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
17
18
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -291,6 +292,23 @@ interface CacheControlResult {
|
|
|
291
292
|
declare function buildCacheControl(options?: CacheControlOptions): CacheControlResult | {
|
|
292
293
|
error: string;
|
|
293
294
|
};
|
|
295
|
+
type Ipv6AddressType = 'unspecified' | 'loopback' | 'link-local' | 'unique-local' | 'multicast' | 'ipv4-mapped' | 'documentation' | 'global-unicast';
|
|
296
|
+
interface Ipv6ParseResult {
|
|
297
|
+
expanded: string;
|
|
298
|
+
compressed: string;
|
|
299
|
+
groups: string[];
|
|
300
|
+
zoneId: string | null;
|
|
301
|
+
addressType: Ipv6AddressType;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Parse an IPv6 address into its expanded (full 8-group) and compressed
|
|
305
|
+
* (RFC 5952 canonical shortest) forms, classify its address type, and
|
|
306
|
+
* separate out an optional zone ID. Understands "::" shorthand and an
|
|
307
|
+
* embedded IPv4 suffix like "::ffff:192.168.1.1".
|
|
308
|
+
*/
|
|
309
|
+
declare function parseIpv6Address(input: string): Ipv6ParseResult | {
|
|
310
|
+
error: string;
|
|
311
|
+
};
|
|
294
312
|
|
|
295
313
|
type network_CacheControlDirective = CacheControlDirective;
|
|
296
314
|
type network_CacheControlOptions = CacheControlOptions;
|
|
@@ -306,6 +324,8 @@ type network_HarParseResult = HarParseResult;
|
|
|
306
324
|
type network_HarSummary = HarSummary;
|
|
307
325
|
type network_HeaderCategory = HeaderCategory;
|
|
308
326
|
type network_HttpHeader = HttpHeader;
|
|
327
|
+
type network_Ipv6AddressType = Ipv6AddressType;
|
|
328
|
+
type network_Ipv6ParseResult = Ipv6ParseResult;
|
|
309
329
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
310
330
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
311
331
|
type network_RobotsGroup = RobotsGroup;
|
|
@@ -341,6 +361,7 @@ declare const network_isValidIpv6: typeof isValidIpv6;
|
|
|
341
361
|
declare const network_parseDnsResponse: typeof parseDnsResponse;
|
|
342
362
|
declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
343
363
|
declare const network_parseHar: typeof parseHar;
|
|
364
|
+
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
344
365
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
345
366
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
346
367
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
@@ -352,7 +373,7 @@ declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
|
352
373
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
353
374
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
354
375
|
declare namespace network {
|
|
355
|
-
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_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_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, 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 };
|
|
376
|
+
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_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_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_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 };
|
|
356
377
|
}
|
|
357
378
|
|
|
358
|
-
export {
|
|
379
|
+
export { parseUserAgent as $, countryCodeToFlag as A, formatCoordinates as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, formatTtl as E, getByCategory as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, getHeader as J, getHeadersByCategory as K, getStatusByCategory as L, getStatusCode as M, isClientError as N, isServerError as O, type ParsedDnsResult as P, isSuccess as Q, type RobotsGroup as R, STATUS_CODES as S, isValidIp as T, type UaDeviceType as U, isValidIpv4 as V, isValidIpv6 as W, parseDnsResponse as X, parseGeoResponse as Y, parseHar as Z, parseIpv6Address as _, type CacheControlOptions as a, searchHeaders as a0, searchStatusCodes as a1, statusCodeToText as a2, typeNumberToLabel as a3, validateDomain as a4, validateHeaderName as a5, validateHeaderValue as a6, validateRobotsTxt as a7, validateSitemap as a8, type CacheControlResult as b, type DnsRecord as c, type DnsRecordType as d, type DnsResponse as e, type HarEntry as f, type HarParseResult as g, type HarSummary as h, type HeaderCategory as i, type HttpHeader as j, type Ipv6ParseResult as k, type ParsedGeoResult as l, type RobotsIssue as m, network as n, type RobotsRule as o, type RobotsValidationResult as p, type SitemapIndexEntry as q, type SitemapIssue as r, type SitemapUrlEntry as s, type SitemapValidationResult as t, type StatusCode as u, type UserAgentInfo as v, buildCacheControl as w, buildDnsQueryUrl as x, buildGeoUrl as y, buildMapUrl as z };
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - robots-txt-validator: validateRobotsTxt
|
|
13
13
|
* - user-agent-parser: parseUserAgent
|
|
14
14
|
* - cache-control-builder: buildCacheControl
|
|
15
|
+
* - ipv6-compressor: parseIpv6Address
|
|
15
16
|
*/
|
|
16
17
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
17
18
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -291,6 +292,23 @@ interface CacheControlResult {
|
|
|
291
292
|
declare function buildCacheControl(options?: CacheControlOptions): CacheControlResult | {
|
|
292
293
|
error: string;
|
|
293
294
|
};
|
|
295
|
+
type Ipv6AddressType = 'unspecified' | 'loopback' | 'link-local' | 'unique-local' | 'multicast' | 'ipv4-mapped' | 'documentation' | 'global-unicast';
|
|
296
|
+
interface Ipv6ParseResult {
|
|
297
|
+
expanded: string;
|
|
298
|
+
compressed: string;
|
|
299
|
+
groups: string[];
|
|
300
|
+
zoneId: string | null;
|
|
301
|
+
addressType: Ipv6AddressType;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Parse an IPv6 address into its expanded (full 8-group) and compressed
|
|
305
|
+
* (RFC 5952 canonical shortest) forms, classify its address type, and
|
|
306
|
+
* separate out an optional zone ID. Understands "::" shorthand and an
|
|
307
|
+
* embedded IPv4 suffix like "::ffff:192.168.1.1".
|
|
308
|
+
*/
|
|
309
|
+
declare function parseIpv6Address(input: string): Ipv6ParseResult | {
|
|
310
|
+
error: string;
|
|
311
|
+
};
|
|
294
312
|
|
|
295
313
|
type network_CacheControlDirective = CacheControlDirective;
|
|
296
314
|
type network_CacheControlOptions = CacheControlOptions;
|
|
@@ -306,6 +324,8 @@ type network_HarParseResult = HarParseResult;
|
|
|
306
324
|
type network_HarSummary = HarSummary;
|
|
307
325
|
type network_HeaderCategory = HeaderCategory;
|
|
308
326
|
type network_HttpHeader = HttpHeader;
|
|
327
|
+
type network_Ipv6AddressType = Ipv6AddressType;
|
|
328
|
+
type network_Ipv6ParseResult = Ipv6ParseResult;
|
|
309
329
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
310
330
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
311
331
|
type network_RobotsGroup = RobotsGroup;
|
|
@@ -341,6 +361,7 @@ declare const network_isValidIpv6: typeof isValidIpv6;
|
|
|
341
361
|
declare const network_parseDnsResponse: typeof parseDnsResponse;
|
|
342
362
|
declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
343
363
|
declare const network_parseHar: typeof parseHar;
|
|
364
|
+
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
344
365
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
345
366
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
346
367
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
@@ -352,7 +373,7 @@ declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
|
352
373
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
353
374
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
354
375
|
declare namespace network {
|
|
355
|
-
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_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_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, 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 };
|
|
376
|
+
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_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_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_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 };
|
|
356
377
|
}
|
|
357
378
|
|
|
358
|
-
export {
|
|
379
|
+
export { parseUserAgent as $, countryCodeToFlag as A, formatCoordinates as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, formatTtl as E, getByCategory as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, getHeader as J, getHeadersByCategory as K, getStatusByCategory as L, getStatusCode as M, isClientError as N, isServerError as O, type ParsedDnsResult as P, isSuccess as Q, type RobotsGroup as R, STATUS_CODES as S, isValidIp as T, type UaDeviceType as U, isValidIpv4 as V, isValidIpv6 as W, parseDnsResponse as X, parseGeoResponse as Y, parseHar as Z, parseIpv6Address as _, type CacheControlOptions as a, searchHeaders as a0, searchStatusCodes as a1, statusCodeToText as a2, typeNumberToLabel as a3, validateDomain as a4, validateHeaderName as a5, validateHeaderValue as a6, validateRobotsTxt as a7, validateSitemap as a8, type CacheControlResult as b, type DnsRecord as c, type DnsRecordType as d, type DnsResponse as e, type HarEntry as f, type HarParseResult as g, type HarSummary as h, type HeaderCategory as i, type HttpHeader as j, type Ipv6ParseResult as k, type ParsedGeoResult as l, type RobotsIssue as m, network as n, type RobotsRule as o, type RobotsValidationResult as p, type SitemapIndexEntry as q, type SitemapIssue as r, type SitemapUrlEntry as s, type SitemapValidationResult as t, type StatusCode as u, type UserAgentInfo as v, buildCacheControl as w, buildDnsQueryUrl as x, buildGeoUrl as y, buildMapUrl as z };
|
|
@@ -207,6 +207,111 @@ function checkStrength(password) {
|
|
|
207
207
|
color: levels[score].color
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
+
var _SYMBOL_POOL_CHARS = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
|
211
|
+
var _SYMBOL_POOL_SET = new Set(_SYMBOL_POOL_CHARS.split(""));
|
|
212
|
+
function _hasSymbolChar(password) {
|
|
213
|
+
for (const ch of password) {
|
|
214
|
+
if (_SYMBOL_POOL_SET.has(ch)) return true;
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
function _hasSequentialRun(password, minRun) {
|
|
219
|
+
let ascRun = 1;
|
|
220
|
+
let descRun = 1;
|
|
221
|
+
for (let i = 1; i < password.length; i++) {
|
|
222
|
+
const prev = password.charCodeAt(i - 1);
|
|
223
|
+
const curr = password.charCodeAt(i);
|
|
224
|
+
if (curr === prev + 1) {
|
|
225
|
+
ascRun++;
|
|
226
|
+
descRun = 1;
|
|
227
|
+
} else if (curr === prev - 1) {
|
|
228
|
+
descRun++;
|
|
229
|
+
ascRun = 1;
|
|
230
|
+
} else {
|
|
231
|
+
ascRun = 1;
|
|
232
|
+
descRun = 1;
|
|
233
|
+
}
|
|
234
|
+
if (ascRun >= minRun || descRun >= minRun) return true;
|
|
235
|
+
}
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
function _formatCrackDuration(seconds) {
|
|
239
|
+
if (!isFinite(seconds)) return "effectively never";
|
|
240
|
+
if (seconds < 1) return "instantly";
|
|
241
|
+
const units = [
|
|
242
|
+
["century", 315576e4],
|
|
243
|
+
["year", 31557600],
|
|
244
|
+
["month", 2629800],
|
|
245
|
+
["day", 86400],
|
|
246
|
+
["hour", 3600],
|
|
247
|
+
["minute", 60],
|
|
248
|
+
["second", 1]
|
|
249
|
+
];
|
|
250
|
+
for (const [name, unitSeconds] of units) {
|
|
251
|
+
if (seconds >= unitSeconds) {
|
|
252
|
+
const value = seconds / unitSeconds;
|
|
253
|
+
if (name === "century" && value > 1e3) return "longer than the age of the universe";
|
|
254
|
+
const rounded = value >= 100 ? Math.round(value) : Math.round(value * 10) / 10;
|
|
255
|
+
const plural = name === "century" ? "centuries" : `${name}s`;
|
|
256
|
+
return `${rounded} ${rounded === 1 ? name : plural}`;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return "instantly";
|
|
260
|
+
}
|
|
261
|
+
function estimatePasswordEntropy(password) {
|
|
262
|
+
if (!password) return { error: "Password is required" };
|
|
263
|
+
const hasLowercase = /[a-z]/.test(password);
|
|
264
|
+
const hasUppercase = /[A-Z]/.test(password);
|
|
265
|
+
const hasDigits = /[0-9]/.test(password);
|
|
266
|
+
const hasSymbols = _hasSymbolChar(password);
|
|
267
|
+
const hasOther = /[^\x20-\x7e]/.test(password);
|
|
268
|
+
let poolSize = 0;
|
|
269
|
+
if (hasLowercase) poolSize += 26;
|
|
270
|
+
if (hasUppercase) poolSize += 26;
|
|
271
|
+
if (hasDigits) poolSize += 10;
|
|
272
|
+
if (hasSymbols) poolSize += _SYMBOL_POOL_CHARS.length;
|
|
273
|
+
if (hasOther) poolSize += 100;
|
|
274
|
+
const entropyBits = Math.round(password.length * Math.log2(poolSize) * 100) / 100;
|
|
275
|
+
let strength;
|
|
276
|
+
if (entropyBits < 28) strength = "very-weak";
|
|
277
|
+
else if (entropyBits < 36) strength = "weak";
|
|
278
|
+
else if (entropyBits < 60) strength = "fair";
|
|
279
|
+
else if (entropyBits < 128) strength = "strong";
|
|
280
|
+
else strength = "very-strong";
|
|
281
|
+
const averageGuesses = Math.pow(2, entropyBits) / 2;
|
|
282
|
+
const scenarios = [
|
|
283
|
+
{ scenario: "Online, throttled (100 guesses/hour)", guessesPerSecond: 100 / 3600 },
|
|
284
|
+
{ scenario: "Online, unthrottled (10 guesses/sec)", guessesPerSecond: 10 },
|
|
285
|
+
{ scenario: "Offline, slow hash e.g. bcrypt (10k guesses/sec)", guessesPerSecond: 1e4 },
|
|
286
|
+
{ scenario: "Offline, fast hash / GPU cluster (10B guesses/sec)", guessesPerSecond: 1e10 }
|
|
287
|
+
];
|
|
288
|
+
const crackTimes = scenarios.map((s) => ({
|
|
289
|
+
scenario: s.scenario,
|
|
290
|
+
guessesPerSecond: s.guessesPerSecond,
|
|
291
|
+
humanReadable: _formatCrackDuration(averageGuesses / s.guessesPerSecond)
|
|
292
|
+
}));
|
|
293
|
+
const warnings = [];
|
|
294
|
+
if (password.length < 8) {
|
|
295
|
+
warnings.push("Shorter than 8 characters \u2014 most sites and cracking tools treat this as trivially weak regardless of entropy.");
|
|
296
|
+
}
|
|
297
|
+
if (/(.)\1{2,}/.test(password)) {
|
|
298
|
+
warnings.push('Contains a repeated character run (e.g. "aaa"), which is easier to guess than the entropy figure implies.');
|
|
299
|
+
}
|
|
300
|
+
if (_hasSequentialRun(password, 3)) {
|
|
301
|
+
warnings.push('Contains a sequential run (e.g. "abc" or "321"), which is easier to guess than the entropy figure implies.');
|
|
302
|
+
}
|
|
303
|
+
if (poolSize <= 26) {
|
|
304
|
+
warnings.push("Uses only one character class \u2014 mixing in uppercase, digits, or symbols raises the character pool and entropy.");
|
|
305
|
+
}
|
|
306
|
+
return {
|
|
307
|
+
length: password.length,
|
|
308
|
+
charset: { hasLowercase, hasUppercase, hasDigits, hasSymbols, hasOther, poolSize },
|
|
309
|
+
entropyBits,
|
|
310
|
+
strength,
|
|
311
|
+
crackTimes,
|
|
312
|
+
warnings
|
|
313
|
+
};
|
|
314
|
+
}
|
|
210
315
|
var DATA_TYPES = [
|
|
211
316
|
{ value: "name", label: "Full Name", example: "John Smith" },
|
|
212
317
|
{ value: "email", label: "Email Address", example: "john.smith@gmail.com" },
|
|
@@ -503,6 +608,7 @@ exports.DEFAULT_QR_OPTIONS = DEFAULT_QR_OPTIONS;
|
|
|
503
608
|
exports.SYMBOL_CHARS = SYMBOL_CHARS;
|
|
504
609
|
exports.ULID_REGEX = ULID_REGEX;
|
|
505
610
|
exports.checkStrength = checkStrength;
|
|
611
|
+
exports.estimatePasswordEntropy = estimatePasswordEntropy;
|
|
506
612
|
exports.generateBulk = generateBulk;
|
|
507
613
|
exports.generateBulkPasswords = generateBulkPasswords;
|
|
508
614
|
exports.generateBulkUlids = generateBulkUlids;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordOptions, Q as QrErrorLevel,
|
|
1
|
+
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as generateData, r as generatePassword, s as generateQrDataUrl, t as generateQrSvg, u as generateSingle, v as generateUlid, w as generateUuid, x as generateV4, y as generateV7, z as isValidUlid, B as isValidUuid, C as parseUlid, E as parseUuidVersion } from '../generators-Du8cBesn.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordOptions, Q as QrErrorLevel,
|
|
1
|
+
export { A as AMBIGUOUS_CHARS, D as DATA_TYPES, a as DEFAULT_OPTIONS, b as DEFAULT_QR_OPTIONS, c as DataType, G as GeneratedUuid, P as PasswordCharsetInfo, d as PasswordCrackTimeEstimate, e as PasswordEntropyResult, f as PasswordEntropyStrength, h as PasswordOptions, Q as QrErrorLevel, i as QrOptions, j as QrOutputFormat, R as RandomConfig, S as SYMBOL_CHARS, U as ULID_REGEX, k as UuidVersion, l as checkStrength, m as estimatePasswordEntropy, n as generateBulk, o as generateBulkPasswords, p as generateBulkUlids, q as generateData, r as generatePassword, s as generateQrDataUrl, t as generateQrSvg, u as generateSingle, v as generateUlid, w as generateUuid, x as generateV4, y as generateV7, z as isValidUlid, B as isValidUuid, C as parseUlid, E as parseUuidVersion } from '../generators-Du8cBesn.js';
|
package/dist/tools/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AMBIGUOUS_CHARS, DATA_TYPES, DEFAULT_OPTIONS, DEFAULT_QR_OPTIONS, SYMBOL_CHARS, ULID_REGEX, checkStrength, generateBulk, generateBulkPasswords, generateBulkUlids, generateData, generatePassword, generateQrDataUrl, generateQrSvg, generateSingle, generateUlid, generateUuid, generateV4, generateV7, isValidUlid, isValidUuid, parseUlid, parseUuidVersion } from '../chunk-
|
|
1
|
+
export { AMBIGUOUS_CHARS, DATA_TYPES, DEFAULT_OPTIONS, DEFAULT_QR_OPTIONS, SYMBOL_CHARS, ULID_REGEX, checkStrength, estimatePasswordEntropy, generateBulk, generateBulkPasswords, generateBulkUlids, generateData, generatePassword, generateQrDataUrl, generateQrSvg, generateSingle, generateUlid, generateUuid, generateV4, generateV7, isValidUlid, isValidUuid, parseUlid, parseUuidVersion } from '../chunk-3TYWIX3B.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|