@utilix-tech/sdk 0.1.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +199 -0
  3. package/dist/api-8aZtWhSj.d.cts +308 -0
  4. package/dist/api-8aZtWhSj.d.ts +308 -0
  5. package/dist/chunk-2CJSLYWI.js +520 -0
  6. package/dist/chunk-3BAHSW4C.js +1385 -0
  7. package/dist/chunk-6YPV2AB5.js +1246 -0
  8. package/dist/chunk-BPVAB4P2.js +1126 -0
  9. package/dist/chunk-FL53T24A.js +257 -0
  10. package/dist/chunk-L6KCTHUW.js +1086 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/chunk-ROTPLW7T.js +265 -0
  13. package/dist/chunk-TSAGO3XP.js +1253 -0
  14. package/dist/chunk-UC656APA.js +1080 -0
  15. package/dist/chunk-W4UBLYFU.js +1219 -0
  16. package/dist/chunk-XST6X3HT.js +896 -0
  17. package/dist/chunk-XXYZLLHI.js +2227 -0
  18. package/dist/chunk-ZKL2VX2G.js +2215 -0
  19. package/dist/chunk-ZPQZEIXP.js +685 -0
  20. package/dist/code-QNrdLIR3.d.cts +327 -0
  21. package/dist/code-QNrdLIR3.d.ts +327 -0
  22. package/dist/color-tPwZCr9H.d.cts +229 -0
  23. package/dist/color-tPwZCr9H.d.ts +229 -0
  24. package/dist/css-Cf7AMGM-.d.cts +318 -0
  25. package/dist/css-Cf7AMGM-.d.ts +318 -0
  26. package/dist/data-rMjWNiOJ.d.cts +215 -0
  27. package/dist/data-rMjWNiOJ.d.ts +215 -0
  28. package/dist/encoding-7gmq-vkV.d.cts +108 -0
  29. package/dist/encoding-7gmq-vkV.d.ts +108 -0
  30. package/dist/generators-BGtRGpJZ.d.cts +118 -0
  31. package/dist/generators-BGtRGpJZ.d.ts +118 -0
  32. package/dist/hashing-CnetQFD_.d.cts +76 -0
  33. package/dist/hashing-CnetQFD_.d.ts +76 -0
  34. package/dist/index.cjs +15466 -0
  35. package/dist/index.d.cts +18 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +20 -0
  38. package/dist/json-BjSoIS1h.d.cts +198 -0
  39. package/dist/json-BjSoIS1h.d.ts +198 -0
  40. package/dist/misc-DcVBManm.d.cts +201 -0
  41. package/dist/misc-DcVBManm.d.ts +201 -0
  42. package/dist/network-CNtmrDeN.d.cts +170 -0
  43. package/dist/network-CNtmrDeN.d.ts +170 -0
  44. package/dist/text-DqAjPtQ0.d.cts +319 -0
  45. package/dist/text-DqAjPtQ0.d.ts +319 -0
  46. package/dist/time-DbT8fjaF.d.cts +145 -0
  47. package/dist/time-DbT8fjaF.d.ts +145 -0
  48. package/dist/tools/api.cjs +1216 -0
  49. package/dist/tools/api.d.cts +1 -0
  50. package/dist/tools/api.d.ts +1 -0
  51. package/dist/tools/api.js +2 -0
  52. package/dist/tools/code.cjs +2212 -0
  53. package/dist/tools/code.d.cts +1 -0
  54. package/dist/tools/code.d.ts +1 -0
  55. package/dist/tools/code.js +2 -0
  56. package/dist/tools/color.cjs +1122 -0
  57. package/dist/tools/color.d.cts +1 -0
  58. package/dist/tools/color.d.ts +1 -0
  59. package/dist/tools/color.js +2 -0
  60. package/dist/tools/css.cjs +1242 -0
  61. package/dist/tools/css.d.cts +1 -0
  62. package/dist/tools/css.d.ts +1 -0
  63. package/dist/tools/css.js +2 -0
  64. package/dist/tools/data.cjs +1097 -0
  65. package/dist/tools/data.d.cts +1 -0
  66. package/dist/tools/data.d.ts +1 -0
  67. package/dist/tools/data.js +2 -0
  68. package/dist/tools/encoding.cjs +261 -0
  69. package/dist/tools/encoding.d.cts +1 -0
  70. package/dist/tools/encoding.d.ts +1 -0
  71. package/dist/tools/encoding.js +2 -0
  72. package/dist/tools/generators.cjs +521 -0
  73. package/dist/tools/generators.d.cts +1 -0
  74. package/dist/tools/generators.d.ts +1 -0
  75. package/dist/tools/generators.js +2 -0
  76. package/dist/tools/hashing.cjs +259 -0
  77. package/dist/tools/hashing.d.cts +1 -0
  78. package/dist/tools/hashing.d.ts +1 -0
  79. package/dist/tools/hashing.js +2 -0
  80. package/dist/tools/json.cjs +1270 -0
  81. package/dist/tools/json.d.cts +1 -0
  82. package/dist/tools/json.d.ts +1 -0
  83. package/dist/tools/json.js +2 -0
  84. package/dist/tools/misc.cjs +1082 -0
  85. package/dist/tools/misc.d.cts +1 -0
  86. package/dist/tools/misc.d.ts +1 -0
  87. package/dist/tools/misc.js +2 -0
  88. package/dist/tools/network.cjs +1381 -0
  89. package/dist/tools/network.d.cts +1 -0
  90. package/dist/tools/network.d.ts +1 -0
  91. package/dist/tools/network.js +2 -0
  92. package/dist/tools/text.cjs +2224 -0
  93. package/dist/tools/text.d.cts +1 -0
  94. package/dist/tools/text.d.ts +1 -0
  95. package/dist/tools/text.js +2 -0
  96. package/dist/tools/time.cjs +681 -0
  97. package/dist/tools/time.d.cts +1 -0
  98. package/dist/tools/time.d.ts +1 -0
  99. package/dist/tools/time.js +2 -0
  100. package/dist/tools/units.cjs +892 -0
  101. package/dist/tools/units.d.cts +1 -0
  102. package/dist/tools/units.d.ts +1 -0
  103. package/dist/tools/units.js +2 -0
  104. package/dist/units-6lwDYBvX.d.cts +302 -0
  105. package/dist/units-6lwDYBvX.d.ts +302 -0
  106. package/package.json +148 -0
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @module data
3
+ * Data format tools for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - yaml-validator : validateYaml, getYamlStats
7
+ * - toml-formatter : formatToml, minifyToml, validateToml, tomlToJson, jsonToToml, getTomlStats
8
+ * - xml-formatter : validateXml, formatXml, minifyXml
9
+ * - xml-to-json : parseXmlToObject, xmlToJson, getXmlStats, jsonToXml
10
+ * - csv-viewer : detectDelimiter, parseCsv, csvToJson, toCsvString
11
+ * - ini-parser : parseIni, stringifyIni, iniToJson, jsonToIni, getSection, getSectionNames, validateIni
12
+ * - env-parser : parseEnv, envToJson, envToExport, validateEnvKey
13
+ */
14
+ interface ValidationResult {
15
+ valid: boolean;
16
+ error?: {
17
+ message: string;
18
+ line?: number;
19
+ column?: number;
20
+ };
21
+ documentCount: number;
22
+ keyCount: number;
23
+ }
24
+ declare function validateYaml(input: string): ValidationResult;
25
+ declare function getYamlStats(input: string): {
26
+ lines: number;
27
+ keys: number;
28
+ depth: number;
29
+ } | {
30
+ error: string;
31
+ };
32
+ interface TomlFormatResult {
33
+ output: string;
34
+ valid: boolean;
35
+ error?: string;
36
+ }
37
+ declare function formatToml(input: string): TomlFormatResult;
38
+ declare function minifyToml(input: string): TomlFormatResult;
39
+ declare function validateToml(input: string): {
40
+ valid: boolean;
41
+ error?: string;
42
+ };
43
+ declare function tomlToJson(input: string): string | {
44
+ error: string;
45
+ };
46
+ declare function jsonToToml(input: string): string | {
47
+ error: string;
48
+ };
49
+ declare function getTomlStats(input: string): {
50
+ keys: number;
51
+ tables: number;
52
+ arrays: number;
53
+ } | {
54
+ error: string;
55
+ };
56
+ interface XmlFormatResult {
57
+ output: string;
58
+ originalSize: number;
59
+ outputSize: number;
60
+ valid: boolean;
61
+ error?: string;
62
+ }
63
+ declare function validateXml(input: string): {
64
+ valid: boolean;
65
+ error?: string;
66
+ };
67
+ declare function formatXml(input: string, indentSize?: number): XmlFormatResult;
68
+ declare function minifyXml(input: string): XmlFormatResult;
69
+ interface XmlToJsonOptions {
70
+ compact?: boolean;
71
+ ignoreAttributes?: boolean;
72
+ attributePrefix?: string;
73
+ textKey?: string;
74
+ arrayMode?: boolean;
75
+ spaces?: number;
76
+ }
77
+ declare function parseXmlToObject(xml: string, options?: XmlToJsonOptions): Record<string, unknown> | {
78
+ error: string;
79
+ };
80
+ declare function xmlToJson(xml: string, options?: XmlToJsonOptions): string | {
81
+ error: string;
82
+ };
83
+ declare function getXmlStats(xml: string): {
84
+ elements: number;
85
+ attributes: number;
86
+ depth: number;
87
+ rootElement: string;
88
+ };
89
+ declare function jsonToXml(json: string, options?: {
90
+ rootElement?: string;
91
+ spaces?: number;
92
+ }): string | {
93
+ error: string;
94
+ };
95
+ interface ParseOptions {
96
+ delimiter?: string;
97
+ hasHeader?: boolean;
98
+ trimWhitespace?: boolean;
99
+ maxRows?: number;
100
+ }
101
+ interface CsvParseResult {
102
+ headers: string[];
103
+ rows: string[][];
104
+ totalRows: number;
105
+ totalCols: number;
106
+ warnings: string[];
107
+ }
108
+ declare function detectDelimiter(input: string): string;
109
+ declare function parseCsv(input: string, options?: ParseOptions): CsvParseResult | {
110
+ error: string;
111
+ };
112
+ declare function csvToJson(input: string, options?: ParseOptions): string | {
113
+ error: string;
114
+ };
115
+ declare function toCsvString(headers: string[], rows: string[][]): string;
116
+ interface IniSection {
117
+ name: string;
118
+ keys: Record<string, string>;
119
+ comments: string[];
120
+ lineStart: number;
121
+ lineEnd: number;
122
+ }
123
+ interface ParsedIni {
124
+ sections: IniSection[];
125
+ global: Record<string, string>;
126
+ raw: string;
127
+ }
128
+ declare function parseIni(input: string): ParsedIni | {
129
+ error: string;
130
+ };
131
+ declare function stringifyIni(parsed: ParsedIni): string;
132
+ declare function iniToJson(input: string): string | {
133
+ error: string;
134
+ };
135
+ declare function jsonToIni(json: string): string | {
136
+ error: string;
137
+ };
138
+ declare function getSection(parsed: ParsedIni, name: string): Record<string, string> | null;
139
+ declare function getSectionNames(parsed: ParsedIni): string[];
140
+ declare function validateIni(input: string): {
141
+ valid: boolean;
142
+ errors: string[];
143
+ };
144
+ interface EnvEntry {
145
+ key: string;
146
+ value: string;
147
+ line: number;
148
+ hasQuotes: boolean;
149
+ interpolated: boolean;
150
+ comment?: string;
151
+ }
152
+ interface EnvParseResult {
153
+ entries: EnvEntry[];
154
+ comments: Array<{
155
+ line: number;
156
+ text: string;
157
+ }>;
158
+ errors: Array<{
159
+ line: number;
160
+ message: string;
161
+ }>;
162
+ duplicates: string[];
163
+ }
164
+ declare function parseEnv(input: string): EnvParseResult;
165
+ declare function envToJson(input: string): string | {
166
+ error: string;
167
+ };
168
+ declare function envToExport(input: string): string;
169
+ declare function validateEnvKey(key: string): boolean;
170
+
171
+ type data_CsvParseResult = CsvParseResult;
172
+ type data_EnvEntry = EnvEntry;
173
+ type data_EnvParseResult = EnvParseResult;
174
+ type data_IniSection = IniSection;
175
+ type data_ParseOptions = ParseOptions;
176
+ type data_ParsedIni = ParsedIni;
177
+ type data_TomlFormatResult = TomlFormatResult;
178
+ type data_ValidationResult = ValidationResult;
179
+ type data_XmlFormatResult = XmlFormatResult;
180
+ type data_XmlToJsonOptions = XmlToJsonOptions;
181
+ declare const data_csvToJson: typeof csvToJson;
182
+ declare const data_detectDelimiter: typeof detectDelimiter;
183
+ declare const data_envToExport: typeof envToExport;
184
+ declare const data_envToJson: typeof envToJson;
185
+ declare const data_formatToml: typeof formatToml;
186
+ declare const data_formatXml: typeof formatXml;
187
+ declare const data_getSection: typeof getSection;
188
+ declare const data_getSectionNames: typeof getSectionNames;
189
+ declare const data_getTomlStats: typeof getTomlStats;
190
+ declare const data_getXmlStats: typeof getXmlStats;
191
+ declare const data_getYamlStats: typeof getYamlStats;
192
+ declare const data_iniToJson: typeof iniToJson;
193
+ declare const data_jsonToIni: typeof jsonToIni;
194
+ declare const data_jsonToToml: typeof jsonToToml;
195
+ declare const data_jsonToXml: typeof jsonToXml;
196
+ declare const data_minifyToml: typeof minifyToml;
197
+ declare const data_minifyXml: typeof minifyXml;
198
+ declare const data_parseCsv: typeof parseCsv;
199
+ declare const data_parseEnv: typeof parseEnv;
200
+ declare const data_parseIni: typeof parseIni;
201
+ declare const data_parseXmlToObject: typeof parseXmlToObject;
202
+ declare const data_stringifyIni: typeof stringifyIni;
203
+ declare const data_toCsvString: typeof toCsvString;
204
+ declare const data_tomlToJson: typeof tomlToJson;
205
+ declare const data_validateEnvKey: typeof validateEnvKey;
206
+ declare const data_validateIni: typeof validateIni;
207
+ declare const data_validateToml: typeof validateToml;
208
+ declare const data_validateXml: typeof validateXml;
209
+ declare const data_validateYaml: typeof validateYaml;
210
+ declare const data_xmlToJson: typeof xmlToJson;
211
+ declare namespace data {
212
+ export { type data_CsvParseResult as CsvParseResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_IniSection as IniSection, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, data_csvToJson as csvToJson, data_detectDelimiter as detectDelimiter, data_envToExport as envToExport, data_envToJson as envToJson, data_formatToml as formatToml, data_formatXml as formatXml, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseIni as parseIni, data_parseXmlToObject as parseXmlToObject, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
213
+ }
214
+
215
+ export { toCsvString as A, tomlToJson as B, type CsvParseResult as C, validateEnvKey as D, type EnvEntry as E, validateIni as F, validateToml as G, validateXml as H, type IniSection as I, validateYaml as J, xmlToJson as K, type ParseOptions as P, type TomlFormatResult as T, type ValidationResult as V, type XmlFormatResult as X, type EnvParseResult as a, type ParsedIni as b, type XmlToJsonOptions as c, data as d, csvToJson as e, detectDelimiter as f, envToExport as g, envToJson as h, formatToml as i, formatXml as j, getSection as k, getSectionNames as l, getTomlStats as m, getXmlStats as n, getYamlStats as o, iniToJson as p, jsonToIni as q, jsonToToml as r, jsonToXml as s, minifyToml as t, minifyXml as u, parseCsv as v, parseEnv as w, parseIni as x, parseXmlToObject as y, stringifyIni as z };
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @module data
3
+ * Data format tools for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - yaml-validator : validateYaml, getYamlStats
7
+ * - toml-formatter : formatToml, minifyToml, validateToml, tomlToJson, jsonToToml, getTomlStats
8
+ * - xml-formatter : validateXml, formatXml, minifyXml
9
+ * - xml-to-json : parseXmlToObject, xmlToJson, getXmlStats, jsonToXml
10
+ * - csv-viewer : detectDelimiter, parseCsv, csvToJson, toCsvString
11
+ * - ini-parser : parseIni, stringifyIni, iniToJson, jsonToIni, getSection, getSectionNames, validateIni
12
+ * - env-parser : parseEnv, envToJson, envToExport, validateEnvKey
13
+ */
14
+ interface ValidationResult {
15
+ valid: boolean;
16
+ error?: {
17
+ message: string;
18
+ line?: number;
19
+ column?: number;
20
+ };
21
+ documentCount: number;
22
+ keyCount: number;
23
+ }
24
+ declare function validateYaml(input: string): ValidationResult;
25
+ declare function getYamlStats(input: string): {
26
+ lines: number;
27
+ keys: number;
28
+ depth: number;
29
+ } | {
30
+ error: string;
31
+ };
32
+ interface TomlFormatResult {
33
+ output: string;
34
+ valid: boolean;
35
+ error?: string;
36
+ }
37
+ declare function formatToml(input: string): TomlFormatResult;
38
+ declare function minifyToml(input: string): TomlFormatResult;
39
+ declare function validateToml(input: string): {
40
+ valid: boolean;
41
+ error?: string;
42
+ };
43
+ declare function tomlToJson(input: string): string | {
44
+ error: string;
45
+ };
46
+ declare function jsonToToml(input: string): string | {
47
+ error: string;
48
+ };
49
+ declare function getTomlStats(input: string): {
50
+ keys: number;
51
+ tables: number;
52
+ arrays: number;
53
+ } | {
54
+ error: string;
55
+ };
56
+ interface XmlFormatResult {
57
+ output: string;
58
+ originalSize: number;
59
+ outputSize: number;
60
+ valid: boolean;
61
+ error?: string;
62
+ }
63
+ declare function validateXml(input: string): {
64
+ valid: boolean;
65
+ error?: string;
66
+ };
67
+ declare function formatXml(input: string, indentSize?: number): XmlFormatResult;
68
+ declare function minifyXml(input: string): XmlFormatResult;
69
+ interface XmlToJsonOptions {
70
+ compact?: boolean;
71
+ ignoreAttributes?: boolean;
72
+ attributePrefix?: string;
73
+ textKey?: string;
74
+ arrayMode?: boolean;
75
+ spaces?: number;
76
+ }
77
+ declare function parseXmlToObject(xml: string, options?: XmlToJsonOptions): Record<string, unknown> | {
78
+ error: string;
79
+ };
80
+ declare function xmlToJson(xml: string, options?: XmlToJsonOptions): string | {
81
+ error: string;
82
+ };
83
+ declare function getXmlStats(xml: string): {
84
+ elements: number;
85
+ attributes: number;
86
+ depth: number;
87
+ rootElement: string;
88
+ };
89
+ declare function jsonToXml(json: string, options?: {
90
+ rootElement?: string;
91
+ spaces?: number;
92
+ }): string | {
93
+ error: string;
94
+ };
95
+ interface ParseOptions {
96
+ delimiter?: string;
97
+ hasHeader?: boolean;
98
+ trimWhitespace?: boolean;
99
+ maxRows?: number;
100
+ }
101
+ interface CsvParseResult {
102
+ headers: string[];
103
+ rows: string[][];
104
+ totalRows: number;
105
+ totalCols: number;
106
+ warnings: string[];
107
+ }
108
+ declare function detectDelimiter(input: string): string;
109
+ declare function parseCsv(input: string, options?: ParseOptions): CsvParseResult | {
110
+ error: string;
111
+ };
112
+ declare function csvToJson(input: string, options?: ParseOptions): string | {
113
+ error: string;
114
+ };
115
+ declare function toCsvString(headers: string[], rows: string[][]): string;
116
+ interface IniSection {
117
+ name: string;
118
+ keys: Record<string, string>;
119
+ comments: string[];
120
+ lineStart: number;
121
+ lineEnd: number;
122
+ }
123
+ interface ParsedIni {
124
+ sections: IniSection[];
125
+ global: Record<string, string>;
126
+ raw: string;
127
+ }
128
+ declare function parseIni(input: string): ParsedIni | {
129
+ error: string;
130
+ };
131
+ declare function stringifyIni(parsed: ParsedIni): string;
132
+ declare function iniToJson(input: string): string | {
133
+ error: string;
134
+ };
135
+ declare function jsonToIni(json: string): string | {
136
+ error: string;
137
+ };
138
+ declare function getSection(parsed: ParsedIni, name: string): Record<string, string> | null;
139
+ declare function getSectionNames(parsed: ParsedIni): string[];
140
+ declare function validateIni(input: string): {
141
+ valid: boolean;
142
+ errors: string[];
143
+ };
144
+ interface EnvEntry {
145
+ key: string;
146
+ value: string;
147
+ line: number;
148
+ hasQuotes: boolean;
149
+ interpolated: boolean;
150
+ comment?: string;
151
+ }
152
+ interface EnvParseResult {
153
+ entries: EnvEntry[];
154
+ comments: Array<{
155
+ line: number;
156
+ text: string;
157
+ }>;
158
+ errors: Array<{
159
+ line: number;
160
+ message: string;
161
+ }>;
162
+ duplicates: string[];
163
+ }
164
+ declare function parseEnv(input: string): EnvParseResult;
165
+ declare function envToJson(input: string): string | {
166
+ error: string;
167
+ };
168
+ declare function envToExport(input: string): string;
169
+ declare function validateEnvKey(key: string): boolean;
170
+
171
+ type data_CsvParseResult = CsvParseResult;
172
+ type data_EnvEntry = EnvEntry;
173
+ type data_EnvParseResult = EnvParseResult;
174
+ type data_IniSection = IniSection;
175
+ type data_ParseOptions = ParseOptions;
176
+ type data_ParsedIni = ParsedIni;
177
+ type data_TomlFormatResult = TomlFormatResult;
178
+ type data_ValidationResult = ValidationResult;
179
+ type data_XmlFormatResult = XmlFormatResult;
180
+ type data_XmlToJsonOptions = XmlToJsonOptions;
181
+ declare const data_csvToJson: typeof csvToJson;
182
+ declare const data_detectDelimiter: typeof detectDelimiter;
183
+ declare const data_envToExport: typeof envToExport;
184
+ declare const data_envToJson: typeof envToJson;
185
+ declare const data_formatToml: typeof formatToml;
186
+ declare const data_formatXml: typeof formatXml;
187
+ declare const data_getSection: typeof getSection;
188
+ declare const data_getSectionNames: typeof getSectionNames;
189
+ declare const data_getTomlStats: typeof getTomlStats;
190
+ declare const data_getXmlStats: typeof getXmlStats;
191
+ declare const data_getYamlStats: typeof getYamlStats;
192
+ declare const data_iniToJson: typeof iniToJson;
193
+ declare const data_jsonToIni: typeof jsonToIni;
194
+ declare const data_jsonToToml: typeof jsonToToml;
195
+ declare const data_jsonToXml: typeof jsonToXml;
196
+ declare const data_minifyToml: typeof minifyToml;
197
+ declare const data_minifyXml: typeof minifyXml;
198
+ declare const data_parseCsv: typeof parseCsv;
199
+ declare const data_parseEnv: typeof parseEnv;
200
+ declare const data_parseIni: typeof parseIni;
201
+ declare const data_parseXmlToObject: typeof parseXmlToObject;
202
+ declare const data_stringifyIni: typeof stringifyIni;
203
+ declare const data_toCsvString: typeof toCsvString;
204
+ declare const data_tomlToJson: typeof tomlToJson;
205
+ declare const data_validateEnvKey: typeof validateEnvKey;
206
+ declare const data_validateIni: typeof validateIni;
207
+ declare const data_validateToml: typeof validateToml;
208
+ declare const data_validateXml: typeof validateXml;
209
+ declare const data_validateYaml: typeof validateYaml;
210
+ declare const data_xmlToJson: typeof xmlToJson;
211
+ declare namespace data {
212
+ export { type data_CsvParseResult as CsvParseResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_IniSection as IniSection, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, data_csvToJson as csvToJson, data_detectDelimiter as detectDelimiter, data_envToExport as envToExport, data_envToJson as envToJson, data_formatToml as formatToml, data_formatXml as formatXml, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseIni as parseIni, data_parseXmlToObject as parseXmlToObject, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
213
+ }
214
+
215
+ export { toCsvString as A, tomlToJson as B, type CsvParseResult as C, validateEnvKey as D, type EnvEntry as E, validateIni as F, validateToml as G, validateXml as H, type IniSection as I, validateYaml as J, xmlToJson as K, type ParseOptions as P, type TomlFormatResult as T, type ValidationResult as V, type XmlFormatResult as X, type EnvParseResult as a, type ParsedIni as b, type XmlToJsonOptions as c, data as d, csvToJson as e, detectDelimiter as f, envToExport as g, envToJson as h, formatToml as i, formatXml as j, getSection as k, getSectionNames as l, getTomlStats as m, getXmlStats as n, getYamlStats as o, iniToJson as p, jsonToIni as q, jsonToToml as r, jsonToXml as s, minifyToml as t, minifyXml as u, parseCsv as v, parseEnv as w, parseIni as x, parseXmlToObject as y, stringifyIni as z };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @module encoding
3
+ * Encoding/decoding utilities for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - base64 : encodeBase64, decodeBase64
7
+ * - url-encode: encodeUrl, decodeUrl, diffSegments
8
+ * - html-entities: encodeHtmlEntities, decodeHtmlEntities, encodeHtmlEntitiesAll
9
+ * - base32 : base32Encode, base32Decode, base32EncodeBytes, base32DecodeBytes, isValidBase32, ALPHABETS
10
+ */
11
+ type Base64Variant = 'standard' | 'urlsafe';
12
+ interface EncodeResult {
13
+ ok: true;
14
+ output: string;
15
+ inputBytes: number;
16
+ outputChars: number;
17
+ }
18
+ interface DecodeResult {
19
+ ok: true;
20
+ output: string;
21
+ outputBytes: number;
22
+ }
23
+ interface Base64Error {
24
+ ok: false;
25
+ error: string;
26
+ }
27
+ type Base64EncodeResult = EncodeResult | Base64Error;
28
+ type Base64DecodeResult = DecodeResult | Base64Error;
29
+ declare function encodeBase64(input: string, variant?: Base64Variant): Base64EncodeResult;
30
+ declare function decodeBase64(input: string, variant?: Base64Variant): Base64DecodeResult;
31
+ type UrlEncodeMode = 'component' | 'full';
32
+ interface UrlEncodeResult {
33
+ ok: true;
34
+ output: string;
35
+ changed: boolean;
36
+ }
37
+ interface UrlEncodeError {
38
+ ok: false;
39
+ error: string;
40
+ }
41
+ type UrlResult = UrlEncodeResult | UrlEncodeError;
42
+ /**
43
+ * component mode: encodeURIComponent — encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( )
44
+ * full mode: encodeURI — preserves :/?#[]@!$&'()*+,;= so a complete URL stays valid
45
+ */
46
+ declare function encodeUrl(input: string, mode?: UrlEncodeMode): UrlResult;
47
+ declare function decodeUrl(input: string, mode?: UrlEncodeMode): UrlResult;
48
+ declare function diffSegments(original: string, encoded: string): Array<{
49
+ text: string;
50
+ changed: boolean;
51
+ }>;
52
+ type encodeMode = 'minimal' | 'all';
53
+ /**
54
+ * Encode the 5 HTML special characters to named entities.
55
+ */
56
+ declare function encodeHtmlEntities(input: string): string;
57
+ /**
58
+ * Decode named HTML entities (a fixed set) and numeric entities (decimal and hex).
59
+ */
60
+ declare function decodeHtmlEntities(input: string): string;
61
+ /**
62
+ * Encode ALL printable non-ASCII characters (charCode > 127) plus the 5 HTML
63
+ * special characters as numeric entities.
64
+ */
65
+ declare function encodeHtmlEntitiesAll(input: string): string;
66
+ type Base32Alphabet = 'standard' | 'hex' | 'crockford' | 'z-base-32';
67
+ declare const ALPHABETS: Record<Base32Alphabet, string>;
68
+ declare function base32EncodeBytes(bytes: Uint8Array, alphabet?: Base32Alphabet): string;
69
+ declare function base32DecodeBytes(input: string, alphabet?: Base32Alphabet): Uint8Array | {
70
+ error: string;
71
+ };
72
+ declare function base32Encode(input: string, alphabet?: Base32Alphabet): string;
73
+ declare function base32Decode(input: string, alphabet?: Base32Alphabet): string | {
74
+ error: string;
75
+ };
76
+ declare function isValidBase32(input: string, alphabet?: Base32Alphabet): boolean;
77
+
78
+ declare const encoding_ALPHABETS: typeof ALPHABETS;
79
+ type encoding_Base32Alphabet = Base32Alphabet;
80
+ type encoding_Base64DecodeResult = Base64DecodeResult;
81
+ type encoding_Base64EncodeResult = Base64EncodeResult;
82
+ type encoding_Base64Error = Base64Error;
83
+ type encoding_Base64Variant = Base64Variant;
84
+ type encoding_DecodeResult = DecodeResult;
85
+ type encoding_EncodeResult = EncodeResult;
86
+ type encoding_UrlEncodeError = UrlEncodeError;
87
+ type encoding_UrlEncodeMode = UrlEncodeMode;
88
+ type encoding_UrlEncodeResult = UrlEncodeResult;
89
+ type encoding_UrlResult = UrlResult;
90
+ declare const encoding_base32Decode: typeof base32Decode;
91
+ declare const encoding_base32DecodeBytes: typeof base32DecodeBytes;
92
+ declare const encoding_base32Encode: typeof base32Encode;
93
+ declare const encoding_base32EncodeBytes: typeof base32EncodeBytes;
94
+ declare const encoding_decodeBase64: typeof decodeBase64;
95
+ declare const encoding_decodeHtmlEntities: typeof decodeHtmlEntities;
96
+ declare const encoding_decodeUrl: typeof decodeUrl;
97
+ declare const encoding_diffSegments: typeof diffSegments;
98
+ declare const encoding_encodeBase64: typeof encodeBase64;
99
+ declare const encoding_encodeHtmlEntities: typeof encodeHtmlEntities;
100
+ declare const encoding_encodeHtmlEntitiesAll: typeof encodeHtmlEntitiesAll;
101
+ type encoding_encodeMode = encodeMode;
102
+ declare const encoding_encodeUrl: typeof encodeUrl;
103
+ declare const encoding_isValidBase32: typeof isValidBase32;
104
+ declare namespace encoding {
105
+ export { encoding_ALPHABETS as ALPHABETS, type encoding_Base32Alphabet as Base32Alphabet, type encoding_Base64DecodeResult as Base64DecodeResult, type encoding_Base64EncodeResult as Base64EncodeResult, type encoding_Base64Error as Base64Error, type encoding_Base64Variant as Base64Variant, type encoding_DecodeResult as DecodeResult, type encoding_EncodeResult as EncodeResult, type encoding_UrlEncodeError as UrlEncodeError, type encoding_UrlEncodeMode as UrlEncodeMode, type encoding_UrlEncodeResult as UrlEncodeResult, type encoding_UrlResult as UrlResult, encoding_base32Decode as base32Decode, encoding_base32DecodeBytes as base32DecodeBytes, encoding_base32Encode as base32Encode, encoding_base32EncodeBytes as base32EncodeBytes, encoding_decodeBase64 as decodeBase64, encoding_decodeHtmlEntities as decodeHtmlEntities, encoding_decodeUrl as decodeUrl, encoding_diffSegments as diffSegments, encoding_encodeBase64 as encodeBase64, encoding_encodeHtmlEntities as encodeHtmlEntities, encoding_encodeHtmlEntitiesAll as encodeHtmlEntitiesAll, type encoding_encodeMode as encodeMode, encoding_encodeUrl as encodeUrl, encoding_isValidBase32 as isValidBase32 };
106
+ }
107
+
108
+ export { ALPHABETS as A, type Base32Alphabet as B, type DecodeResult as D, type EncodeResult as E, type UrlEncodeError as U, type Base64DecodeResult as a, type Base64EncodeResult as b, type Base64Error as c, type Base64Variant as d, encoding as e, type UrlEncodeMode as f, type UrlEncodeResult as g, type UrlResult as h, base32Decode as i, base32DecodeBytes as j, base32Encode as k, base32EncodeBytes as l, decodeBase64 as m, decodeHtmlEntities as n, decodeUrl as o, diffSegments as p, encodeBase64 as q, encodeHtmlEntities as r, encodeHtmlEntitiesAll as s, type encodeMode as t, encodeUrl as u, isValidBase32 as v };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @module encoding
3
+ * Encoding/decoding utilities for the @utilix/sdk Node.js SDK.
4
+ *
5
+ * Tools covered:
6
+ * - base64 : encodeBase64, decodeBase64
7
+ * - url-encode: encodeUrl, decodeUrl, diffSegments
8
+ * - html-entities: encodeHtmlEntities, decodeHtmlEntities, encodeHtmlEntitiesAll
9
+ * - base32 : base32Encode, base32Decode, base32EncodeBytes, base32DecodeBytes, isValidBase32, ALPHABETS
10
+ */
11
+ type Base64Variant = 'standard' | 'urlsafe';
12
+ interface EncodeResult {
13
+ ok: true;
14
+ output: string;
15
+ inputBytes: number;
16
+ outputChars: number;
17
+ }
18
+ interface DecodeResult {
19
+ ok: true;
20
+ output: string;
21
+ outputBytes: number;
22
+ }
23
+ interface Base64Error {
24
+ ok: false;
25
+ error: string;
26
+ }
27
+ type Base64EncodeResult = EncodeResult | Base64Error;
28
+ type Base64DecodeResult = DecodeResult | Base64Error;
29
+ declare function encodeBase64(input: string, variant?: Base64Variant): Base64EncodeResult;
30
+ declare function decodeBase64(input: string, variant?: Base64Variant): Base64DecodeResult;
31
+ type UrlEncodeMode = 'component' | 'full';
32
+ interface UrlEncodeResult {
33
+ ok: true;
34
+ output: string;
35
+ changed: boolean;
36
+ }
37
+ interface UrlEncodeError {
38
+ ok: false;
39
+ error: string;
40
+ }
41
+ type UrlResult = UrlEncodeResult | UrlEncodeError;
42
+ /**
43
+ * component mode: encodeURIComponent — encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( )
44
+ * full mode: encodeURI — preserves :/?#[]@!$&'()*+,;= so a complete URL stays valid
45
+ */
46
+ declare function encodeUrl(input: string, mode?: UrlEncodeMode): UrlResult;
47
+ declare function decodeUrl(input: string, mode?: UrlEncodeMode): UrlResult;
48
+ declare function diffSegments(original: string, encoded: string): Array<{
49
+ text: string;
50
+ changed: boolean;
51
+ }>;
52
+ type encodeMode = 'minimal' | 'all';
53
+ /**
54
+ * Encode the 5 HTML special characters to named entities.
55
+ */
56
+ declare function encodeHtmlEntities(input: string): string;
57
+ /**
58
+ * Decode named HTML entities (a fixed set) and numeric entities (decimal and hex).
59
+ */
60
+ declare function decodeHtmlEntities(input: string): string;
61
+ /**
62
+ * Encode ALL printable non-ASCII characters (charCode > 127) plus the 5 HTML
63
+ * special characters as numeric entities.
64
+ */
65
+ declare function encodeHtmlEntitiesAll(input: string): string;
66
+ type Base32Alphabet = 'standard' | 'hex' | 'crockford' | 'z-base-32';
67
+ declare const ALPHABETS: Record<Base32Alphabet, string>;
68
+ declare function base32EncodeBytes(bytes: Uint8Array, alphabet?: Base32Alphabet): string;
69
+ declare function base32DecodeBytes(input: string, alphabet?: Base32Alphabet): Uint8Array | {
70
+ error: string;
71
+ };
72
+ declare function base32Encode(input: string, alphabet?: Base32Alphabet): string;
73
+ declare function base32Decode(input: string, alphabet?: Base32Alphabet): string | {
74
+ error: string;
75
+ };
76
+ declare function isValidBase32(input: string, alphabet?: Base32Alphabet): boolean;
77
+
78
+ declare const encoding_ALPHABETS: typeof ALPHABETS;
79
+ type encoding_Base32Alphabet = Base32Alphabet;
80
+ type encoding_Base64DecodeResult = Base64DecodeResult;
81
+ type encoding_Base64EncodeResult = Base64EncodeResult;
82
+ type encoding_Base64Error = Base64Error;
83
+ type encoding_Base64Variant = Base64Variant;
84
+ type encoding_DecodeResult = DecodeResult;
85
+ type encoding_EncodeResult = EncodeResult;
86
+ type encoding_UrlEncodeError = UrlEncodeError;
87
+ type encoding_UrlEncodeMode = UrlEncodeMode;
88
+ type encoding_UrlEncodeResult = UrlEncodeResult;
89
+ type encoding_UrlResult = UrlResult;
90
+ declare const encoding_base32Decode: typeof base32Decode;
91
+ declare const encoding_base32DecodeBytes: typeof base32DecodeBytes;
92
+ declare const encoding_base32Encode: typeof base32Encode;
93
+ declare const encoding_base32EncodeBytes: typeof base32EncodeBytes;
94
+ declare const encoding_decodeBase64: typeof decodeBase64;
95
+ declare const encoding_decodeHtmlEntities: typeof decodeHtmlEntities;
96
+ declare const encoding_decodeUrl: typeof decodeUrl;
97
+ declare const encoding_diffSegments: typeof diffSegments;
98
+ declare const encoding_encodeBase64: typeof encodeBase64;
99
+ declare const encoding_encodeHtmlEntities: typeof encodeHtmlEntities;
100
+ declare const encoding_encodeHtmlEntitiesAll: typeof encodeHtmlEntitiesAll;
101
+ type encoding_encodeMode = encodeMode;
102
+ declare const encoding_encodeUrl: typeof encodeUrl;
103
+ declare const encoding_isValidBase32: typeof isValidBase32;
104
+ declare namespace encoding {
105
+ export { encoding_ALPHABETS as ALPHABETS, type encoding_Base32Alphabet as Base32Alphabet, type encoding_Base64DecodeResult as Base64DecodeResult, type encoding_Base64EncodeResult as Base64EncodeResult, type encoding_Base64Error as Base64Error, type encoding_Base64Variant as Base64Variant, type encoding_DecodeResult as DecodeResult, type encoding_EncodeResult as EncodeResult, type encoding_UrlEncodeError as UrlEncodeError, type encoding_UrlEncodeMode as UrlEncodeMode, type encoding_UrlEncodeResult as UrlEncodeResult, type encoding_UrlResult as UrlResult, encoding_base32Decode as base32Decode, encoding_base32DecodeBytes as base32DecodeBytes, encoding_base32Encode as base32Encode, encoding_base32EncodeBytes as base32EncodeBytes, encoding_decodeBase64 as decodeBase64, encoding_decodeHtmlEntities as decodeHtmlEntities, encoding_decodeUrl as decodeUrl, encoding_diffSegments as diffSegments, encoding_encodeBase64 as encodeBase64, encoding_encodeHtmlEntities as encodeHtmlEntities, encoding_encodeHtmlEntitiesAll as encodeHtmlEntitiesAll, type encoding_encodeMode as encodeMode, encoding_encodeUrl as encodeUrl, encoding_isValidBase32 as isValidBase32 };
106
+ }
107
+
108
+ export { ALPHABETS as A, type Base32Alphabet as B, type DecodeResult as D, type EncodeResult as E, type UrlEncodeError as U, type Base64DecodeResult as a, type Base64EncodeResult as b, type Base64Error as c, type Base64Variant as d, encoding as e, type UrlEncodeMode as f, type UrlEncodeResult as g, type UrlResult as h, base32Decode as i, base32DecodeBytes as j, base32Encode as k, base32EncodeBytes as l, decodeBase64 as m, decodeHtmlEntities as n, decodeUrl as o, diffSegments as p, encodeBase64 as q, encodeHtmlEntities as r, encodeHtmlEntitiesAll as s, type encodeMode as t, encodeUrl as u, isValidBase32 as v };