@utilix-tech/sdk 0.1.2 → 0.2.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.
@@ -13,10 +13,13 @@ __export(code_exports, {
13
13
  buildGitCommand: () => buildGitCommand,
14
14
  collapseHtmlWhitespace: () => collapseHtmlWhitespace,
15
15
  collapseJsWhitespace: () => collapseJsWhitespace,
16
+ countProperties: () => countProperties,
17
+ countRules: () => countRules,
16
18
  detectDialect: () => detectDialect,
17
19
  detectOperationType: () => detectOperationType,
18
20
  envToExport: () => envToExport,
19
21
  envToJson: () => envToJson,
22
+ formatCss: () => formatCss,
20
23
  formatGql: () => formatGql,
21
24
  formatHtml: () => formatHtml,
22
25
  formatSql: () => formatSql,
@@ -25,6 +28,7 @@ __export(code_exports, {
25
28
  getJsStats: () => getJsStats,
26
29
  getMethodColor: () => getMethodColor,
27
30
  isValidTag: () => isValidTag,
31
+ minifyCss: () => minifyCss,
28
32
  minifyGql: () => minifyGql,
29
33
  minifyHtml: () => minifyHtml,
30
34
  minifyJs: () => minifyJs,
@@ -2211,5 +2215,68 @@ function envToExport(input) {
2211
2215
  function validateEnvKey(key) {
2212
2216
  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(key);
2213
2217
  }
2218
+ function _calcCssResult(input, output) {
2219
+ const originalSize = input.length;
2220
+ const outputSize = output.length;
2221
+ const savingsPercent = originalSize === 0 ? 0 : Math.round((originalSize - outputSize) / originalSize * 100 * 100) / 100;
2222
+ return { output, originalSize, outputSize, savingsPercent };
2223
+ }
2224
+ function minifyCss(input) {
2225
+ let output = input;
2226
+ output = output.replace(/\/\*[\s\S]*?\*\//g, "");
2227
+ output = output.replace(/\s+/g, " ");
2228
+ output = output.replace(/\s*{\s*/g, "{");
2229
+ output = output.replace(/\s*}\s*/g, "}");
2230
+ output = output.replace(/\s*:\s*/g, ":");
2231
+ output = output.replace(/\s*;\s*/g, ";");
2232
+ output = output.replace(/\s*,\s*/g, ",");
2233
+ output = output.replace(/;}/g, "}");
2234
+ output = output.trim();
2235
+ return _calcCssResult(input, output);
2236
+ }
2237
+ function formatCss(input, indentSize = 2) {
2238
+ const indent = " ".repeat(indentSize);
2239
+ const { output: minified } = minifyCss(input);
2240
+ let result = "";
2241
+ let insideBlock = false;
2242
+ let i = 0;
2243
+ while (i < minified.length) {
2244
+ const char = minified[i];
2245
+ if (char === "{") {
2246
+ result += " {\n";
2247
+ insideBlock = true;
2248
+ } else if (char === "}") {
2249
+ result = result.trimEnd() + "\n";
2250
+ result += "}\n\n";
2251
+ insideBlock = false;
2252
+ } else if (char === ";" && insideBlock) {
2253
+ result += ";\n";
2254
+ if (i + 1 < minified.length && minified[i + 1] !== "}") result += indent;
2255
+ } else {
2256
+ if (insideBlock && result.endsWith("{\n")) result += indent;
2257
+ result += char;
2258
+ }
2259
+ i++;
2260
+ }
2261
+ return _calcCssResult(input, result.trimEnd());
2262
+ }
2263
+ function countRules(css) {
2264
+ return (css.match(/{/g) ?? []).length;
2265
+ }
2266
+ function countProperties(css) {
2267
+ let count = 0;
2268
+ let insideBlock = false;
2269
+ for (const char of css) {
2270
+ if (char === "{") insideBlock = true;
2271
+ else if (char === "}") insideBlock = false;
2272
+ else if (char === ";" && insideBlock) count++;
2273
+ }
2274
+ css.replace(/{[^{}]*}/g, (block) => {
2275
+ const last = block.slice(1, -1).trim().split(";").pop()?.trim();
2276
+ if (last?.includes(":")) count++;
2277
+ return block;
2278
+ });
2279
+ return count;
2280
+ }
2214
2281
 
2215
- export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, detectDialect, detectOperationType, envToExport, envToJson, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey };
2282
+ export { ALL_FLAGS, CHEATSHEET, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey };
@@ -1,4 +1,5 @@
1
1
  import { __export } from './chunk-MLKGABMK.js';
2
+ import QRCode from 'qrcode';
2
3
 
3
4
  // src/tools/misc.ts
4
5
  var misc_exports = {};
@@ -6,6 +7,7 @@ __export(misc_exports, {
6
7
  COLOR_PRESETS: () => COLOR_PRESETS,
7
8
  DATA_TYPES: () => DATA_TYPES,
8
9
  DEFAULT_CONFIG: () => DEFAULT_CONFIG,
10
+ DEFAULT_QR_OPTIONS: () => DEFAULT_QR_OPTIONS,
9
11
  FORMAT_EXTENSIONS: () => FORMAT_EXTENSIONS,
10
12
  FORMAT_LABELS: () => FORMAT_LABELS,
11
13
  analyzeString: () => analyzeString,
@@ -21,6 +23,9 @@ __export(misc_exports, {
21
23
  formatSvg: () => formatSvg,
22
24
  fromUnicodeEscape: () => fromUnicodeEscape,
23
25
  generateData: () => generateData,
26
+ generateMetaHtml: () => generateMetaHtml,
27
+ generateQrDataUrl: () => generateQrDataUrl,
28
+ generateQrSvg: () => generateQrSvg,
24
29
  generateSingle: () => generateSingle,
25
30
  generateSvgFavicon: () => generateSvgFavicon,
26
31
  getConversionWarnings: () => getConversionWarnings,
@@ -34,10 +39,12 @@ __export(misc_exports, {
34
39
  numberToWords: () => numberToWords,
35
40
  optimizeSvg: () => optimizeSvg,
36
41
  ordinalWords: () => ordinalWords,
42
+ parseMetaTags: () => parseMetaTags,
37
43
  romanToNumber: () => romanToNumber,
38
44
  sanitizeSvg: () => sanitizeSvg,
39
45
  svgToDataUrl: () => svgToDataUrl,
40
- toUnicodeEscape: () => toUnicodeEscape
46
+ toUnicodeEscape: () => toUnicodeEscape,
47
+ validateOgTags: () => validateOgTags
41
48
  });
42
49
  var NAMED_HTML_ENTITIES = {
43
50
  34: "&quot;",
@@ -1082,5 +1089,129 @@ function generateData(config) {
1082
1089
  }
1083
1090
  return results;
1084
1091
  }
1092
+ var DEFAULT_QR_OPTIONS = {
1093
+ errorLevel: "M",
1094
+ size: 256,
1095
+ margin: 1,
1096
+ darkColor: "#000000",
1097
+ lightColor: "#ffffff"
1098
+ };
1099
+ async function generateQrSvg(text, options) {
1100
+ const o = { ...DEFAULT_QR_OPTIONS, ...options };
1101
+ return QRCode.toString(text, {
1102
+ type: "svg",
1103
+ errorCorrectionLevel: o.errorLevel,
1104
+ margin: o.margin,
1105
+ color: { dark: o.darkColor, light: o.lightColor }
1106
+ });
1107
+ }
1108
+ async function generateQrDataUrl(text, options) {
1109
+ const o = { ...DEFAULT_QR_OPTIONS, ...options };
1110
+ return QRCode.toDataURL(text, {
1111
+ width: o.size,
1112
+ errorCorrectionLevel: o.errorLevel,
1113
+ margin: o.margin,
1114
+ color: { dark: o.darkColor, light: o.lightColor }
1115
+ });
1116
+ }
1117
+ function _getMetaContent(html, property) {
1118
+ const esc = property.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1119
+ const patterns = [
1120
+ new RegExp(`<meta[^>]+property=["']${esc}["'][^>]+content=["']([^"']*)["']`, "i"),
1121
+ new RegExp(`<meta[^>]+content=["']([^"']*)["'][^>]+property=["']${esc}["']`, "i"),
1122
+ new RegExp(`<meta[^>]+name=["']${esc}["'][^>]+content=["']([^"']*)["']`, "i"),
1123
+ new RegExp(`<meta[^>]+content=["']([^"']*)["'][^>]+name=["']${esc}["']`, "i")
1124
+ ];
1125
+ for (const p of patterns) {
1126
+ const m = html.match(p);
1127
+ if (m) return m[1];
1128
+ }
1129
+ return void 0;
1130
+ }
1131
+ function parseMetaTags(html) {
1132
+ const titleMatch = html.match(/<title[^>]*>([^<]*)<\/title>/i);
1133
+ const canonicalMatch = html.match(/<link[^>]+rel=["']canonical["'][^>]+href=["']([^"']*)["']/i) || html.match(/<link[^>]+href=["']([^"']*)["'][^>]+rel=["']canonical["']/i);
1134
+ const charsetMatch = html.match(/<meta[^>]+charset=["']([^"']*)["']/i) || html.match(/<meta[^>]+charset=([^\s>]*)/i);
1135
+ return {
1136
+ og: {
1137
+ title: _getMetaContent(html, "og:title"),
1138
+ description: _getMetaContent(html, "og:description"),
1139
+ image: _getMetaContent(html, "og:image"),
1140
+ imageAlt: _getMetaContent(html, "og:image:alt"),
1141
+ imageWidth: _getMetaContent(html, "og:image:width"),
1142
+ imageHeight: _getMetaContent(html, "og:image:height"),
1143
+ url: _getMetaContent(html, "og:url"),
1144
+ type: _getMetaContent(html, "og:type"),
1145
+ siteName: _getMetaContent(html, "og:site_name"),
1146
+ locale: _getMetaContent(html, "og:locale")
1147
+ },
1148
+ twitter: {
1149
+ card: _getMetaContent(html, "twitter:card"),
1150
+ site: _getMetaContent(html, "twitter:site"),
1151
+ creator: _getMetaContent(html, "twitter:creator"),
1152
+ title: _getMetaContent(html, "twitter:title"),
1153
+ description: _getMetaContent(html, "twitter:description"),
1154
+ image: _getMetaContent(html, "twitter:image")
1155
+ },
1156
+ standard: {
1157
+ title: titleMatch ? titleMatch[1].trim() : void 0,
1158
+ description: _getMetaContent(html, "description"),
1159
+ keywords: _getMetaContent(html, "keywords"),
1160
+ canonical: canonicalMatch ? canonicalMatch[1] : void 0,
1161
+ robots: _getMetaContent(html, "robots"),
1162
+ viewport: _getMetaContent(html, "viewport"),
1163
+ charset: charsetMatch ? charsetMatch[1] : void 0
1164
+ }
1165
+ };
1166
+ }
1167
+ function validateOgTags(tags) {
1168
+ const warnings = [];
1169
+ const missing = [];
1170
+ const required = ["title", "description", "image", "url", "type"];
1171
+ for (const field of required) {
1172
+ if (!tags[field]) missing.push(`og:${field}`);
1173
+ }
1174
+ if (tags.image && !/^https?:\/\//i.test(tags.image))
1175
+ warnings.push("og:image should be an absolute URL");
1176
+ if (tags.url && !/^https?:\/\//i.test(tags.url))
1177
+ warnings.push("og:url should be an absolute URL");
1178
+ if (tags.title && tags.title.length > 95)
1179
+ warnings.push("og:title is longer than 95 characters and may be truncated");
1180
+ if (tags.description && tags.description.length > 300)
1181
+ warnings.push("og:description is longer than 300 characters and may be truncated");
1182
+ const standardTypes = ["website", "article", "video.movie", "video.episode", "music.song", "music.album", "book", "profile"];
1183
+ if (tags.type && !standardTypes.includes(tags.type))
1184
+ warnings.push(`og:type "${tags.type}" is not a standard type`);
1185
+ return { warnings, missing };
1186
+ }
1187
+ function generateMetaHtml(tags) {
1188
+ const lines = [];
1189
+ const ogMap = {
1190
+ title: "og:title",
1191
+ description: "og:description",
1192
+ image: "og:image",
1193
+ imageAlt: "og:image:alt",
1194
+ imageWidth: "og:image:width",
1195
+ imageHeight: "og:image:height",
1196
+ url: "og:url",
1197
+ type: "og:type",
1198
+ siteName: "og:site_name",
1199
+ locale: "og:locale"
1200
+ };
1201
+ const twitterMap = {
1202
+ card: "twitter:card",
1203
+ site: "twitter:site",
1204
+ creator: "twitter:creator"
1205
+ };
1206
+ for (const [key, property] of Object.entries(ogMap)) {
1207
+ const v = tags[key];
1208
+ if (v) lines.push(`<meta property="${property}" content="${v}" />`);
1209
+ }
1210
+ for (const [key, name] of Object.entries(twitterMap)) {
1211
+ const v = tags[key];
1212
+ if (v) lines.push(`<meta name="${name}" content="${v}" />`);
1213
+ }
1214
+ return lines.join("\n");
1215
+ }
1085
1216
 
1086
- export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, misc_exports, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape };
1217
+ export { COLOR_PRESETS, DATA_TYPES, DEFAULT_CONFIG, DEFAULT_QR_OPTIONS, FORMAT_EXTENSIONS, FORMAT_LABELS, analyzeString, analyzeSvg, calcResizeDimensions, calcSavings, charToCodePoint, codePointToChar, detectFormatFromDataUrl, detectFormatFromFilename, formatBytes, formatLabel, formatSvg, fromUnicodeEscape, generateData, generateMetaHtml, generateQrDataUrl, generateQrSvg, generateSingle, generateSvgFavicon, getConversionWarnings, getDefaultQuality, getDownloadFilename, getSupportedFormats, getSupportedOutputFormats, minifySvg, misc_exports, numberToOrdinal, numberToRoman, numberToWords, optimizeSvg, ordinalWords, parseMetaTags, romanToNumber, sanitizeSvg, svgToDataUrl, toUnicodeEscape, validateOgTags };
@@ -16,6 +16,7 @@
16
16
  * removeConsoleCalls, getJsStats)
17
17
  * - openapi-viewer (parseSpec, getEndpointsByTag, searchEndpoints, getMethodColor)
18
18
  * - env-parser (parseEnv, envToJson, envToExport, validateEnvKey)
19
+ * - css-minifier (minifyCss, formatCss, countRules, countProperties)
19
20
  */
20
21
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
21
22
  declare const ALL_FLAGS: RegexFlag[];
@@ -251,12 +252,23 @@ declare function envToJson(input: string): string | {
251
252
  };
252
253
  declare function envToExport(input: string): string;
253
254
  declare function validateEnvKey(key: string): boolean;
255
+ interface CssResult {
256
+ output: string;
257
+ originalSize: number;
258
+ outputSize: number;
259
+ savingsPercent: number;
260
+ }
261
+ declare function minifyCss(input: string): CssResult;
262
+ declare function formatCss(input: string, indentSize?: number): CssResult;
263
+ declare function countRules(css: string): number;
264
+ declare function countProperties(css: string): number;
254
265
 
255
266
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
256
267
  type code_ApiEndpoint = ApiEndpoint;
257
268
  type code_ApiInfo = ApiInfo;
258
269
  declare const code_CHEATSHEET: typeof CHEATSHEET;
259
270
  type code_CheatsheetEntry = CheatsheetEntry;
271
+ type code_CssResult = CssResult;
260
272
  type code_DockerImageRef = DockerImageRef;
261
273
  type code_EnvEntry = EnvEntry;
262
274
  type code_EnvParseResult = EnvParseResult;
@@ -288,10 +300,13 @@ declare const code_buildDockerRun: typeof buildDockerRun;
288
300
  declare const code_buildGitCommand: typeof buildGitCommand;
289
301
  declare const code_collapseHtmlWhitespace: typeof collapseHtmlWhitespace;
290
302
  declare const code_collapseJsWhitespace: typeof collapseJsWhitespace;
303
+ declare const code_countProperties: typeof countProperties;
304
+ declare const code_countRules: typeof countRules;
291
305
  declare const code_detectDialect: typeof detectDialect;
292
306
  declare const code_detectOperationType: typeof detectOperationType;
293
307
  declare const code_envToExport: typeof envToExport;
294
308
  declare const code_envToJson: typeof envToJson;
309
+ declare const code_formatCss: typeof formatCss;
295
310
  declare const code_formatGql: typeof formatGql;
296
311
  declare const code_formatHtml: typeof formatHtml;
297
312
  declare const code_formatSql: typeof formatSql;
@@ -300,6 +315,7 @@ declare const code_getHtmlStats: typeof getHtmlStats;
300
315
  declare const code_getJsStats: typeof getJsStats;
301
316
  declare const code_getMethodColor: typeof getMethodColor;
302
317
  declare const code_isValidTag: typeof isValidTag;
318
+ declare const code_minifyCss: typeof minifyCss;
303
319
  declare const code_minifyGql: typeof minifyGql;
304
320
  declare const code_minifyHtml: typeof minifyHtml;
305
321
  declare const code_minifyJs: typeof minifyJs;
@@ -321,7 +337,7 @@ declare const code_testPattern: typeof testPattern;
321
337
  declare const code_testRegex: typeof testRegex;
322
338
  declare const code_validateEnvKey: typeof validateEnvKey;
323
339
  declare namespace code {
324
- export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, type code_MatchResult as MatchResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
340
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CssResult as CssResult, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, type code_MatchResult as MatchResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
325
341
  }
326
342
 
327
- export { normalizeRef as $, ALL_FLAGS as A, envToExport as B, CHEATSHEET as C, type DockerImageRef as D, type EnvEntry as E, envToJson as F, type GitCommandConfig as G, type HtmlFormatResult as H, formatGql as I, type JsMinifyOptions as J, formatHtml as K, formatSql as L, type MatchResult as M, getEndpointsByTag as N, OPERATIONS as O, type ParsedSpec as P, getHtmlStats as Q, type RegexError as R, SQL_DEFAULT_OPTIONS as S, type TestPatternResult as T, getJsStats as U, getMethodColor as V, isValidTag as W, minifyGql as X, minifyHtml as Y, minifyJs as Z, minifySql as _, type ApiEndpoint as a, parseDockerImage as a0, parseEnv as a1, parseGitCommand as a2, parseSpec as a3, removeConsoleCalls as a4, removeEmptyAttributes as a5, removeHtmlComments as a6, removeJsComments as a7, removeRedundantAttributes as a8, searchCheatsheet as a9, searchEndpoints as aa, splitStatements as ab, testPattern as ac, testRegex as ad, validateEnvKey as ae, type ApiInfo as b, code as c, type CheatsheetEntry as d, type EnvParseResult as e, type GitCommandResult as f, type GitOperation as g, type GqlFormatResult as h, type HtmlMinifyOptions as i, type HtmlMinifyResult as j, type JsMinifyResult as k, type RegexFlag as l, type RegexMatch as m, type RegexResult as n, type RegexSuccess as o, type Segment as p, type SpecVersion as q, type SqlDialect as r, type SqlFormatOptions as s, buildDockerPull as t, buildDockerRun as u, buildGitCommand as v, collapseHtmlWhitespace as w, collapseJsWhitespace as x, detectDialect as y, detectOperationType as z };
343
+ export { minifyCss as $, ALL_FLAGS as A, countRules as B, CHEATSHEET as C, type DockerImageRef as D, type EnvEntry as E, detectDialect as F, type GitCommandConfig as G, type HtmlFormatResult as H, detectOperationType as I, type JsMinifyOptions as J, envToExport as K, envToJson as L, type MatchResult as M, formatCss as N, OPERATIONS as O, type ParsedSpec as P, formatGql as Q, type RegexError as R, SQL_DEFAULT_OPTIONS as S, type TestPatternResult as T, formatHtml as U, formatSql as V, getEndpointsByTag as W, getHtmlStats as X, getJsStats as Y, getMethodColor as Z, isValidTag as _, type ApiEndpoint as a, minifyGql as a0, minifyHtml as a1, minifyJs as a2, minifySql as a3, normalizeRef as a4, parseDockerImage as a5, parseEnv as a6, parseGitCommand as a7, parseSpec as a8, removeConsoleCalls as a9, removeEmptyAttributes as aa, removeHtmlComments as ab, removeJsComments as ac, removeRedundantAttributes as ad, searchCheatsheet as ae, searchEndpoints as af, splitStatements as ag, testPattern as ah, testRegex as ai, validateEnvKey as aj, type ApiInfo as b, code as c, type CheatsheetEntry as d, type CssResult as e, type EnvParseResult as f, type GitCommandResult as g, type GitOperation as h, type GqlFormatResult as i, type HtmlMinifyOptions as j, type HtmlMinifyResult as k, type JsMinifyResult as l, type RegexFlag as m, type RegexMatch as n, type RegexResult as o, type RegexSuccess as p, type Segment as q, type SpecVersion as r, type SqlDialect as s, type SqlFormatOptions as t, buildDockerPull as u, buildDockerRun as v, buildGitCommand as w, collapseHtmlWhitespace as x, collapseJsWhitespace as y, countProperties as z };
@@ -16,6 +16,7 @@
16
16
  * removeConsoleCalls, getJsStats)
17
17
  * - openapi-viewer (parseSpec, getEndpointsByTag, searchEndpoints, getMethodColor)
18
18
  * - env-parser (parseEnv, envToJson, envToExport, validateEnvKey)
19
+ * - css-minifier (minifyCss, formatCss, countRules, countProperties)
19
20
  */
20
21
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
21
22
  declare const ALL_FLAGS: RegexFlag[];
@@ -251,12 +252,23 @@ declare function envToJson(input: string): string | {
251
252
  };
252
253
  declare function envToExport(input: string): string;
253
254
  declare function validateEnvKey(key: string): boolean;
255
+ interface CssResult {
256
+ output: string;
257
+ originalSize: number;
258
+ outputSize: number;
259
+ savingsPercent: number;
260
+ }
261
+ declare function minifyCss(input: string): CssResult;
262
+ declare function formatCss(input: string, indentSize?: number): CssResult;
263
+ declare function countRules(css: string): number;
264
+ declare function countProperties(css: string): number;
254
265
 
255
266
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
256
267
  type code_ApiEndpoint = ApiEndpoint;
257
268
  type code_ApiInfo = ApiInfo;
258
269
  declare const code_CHEATSHEET: typeof CHEATSHEET;
259
270
  type code_CheatsheetEntry = CheatsheetEntry;
271
+ type code_CssResult = CssResult;
260
272
  type code_DockerImageRef = DockerImageRef;
261
273
  type code_EnvEntry = EnvEntry;
262
274
  type code_EnvParseResult = EnvParseResult;
@@ -288,10 +300,13 @@ declare const code_buildDockerRun: typeof buildDockerRun;
288
300
  declare const code_buildGitCommand: typeof buildGitCommand;
289
301
  declare const code_collapseHtmlWhitespace: typeof collapseHtmlWhitespace;
290
302
  declare const code_collapseJsWhitespace: typeof collapseJsWhitespace;
303
+ declare const code_countProperties: typeof countProperties;
304
+ declare const code_countRules: typeof countRules;
291
305
  declare const code_detectDialect: typeof detectDialect;
292
306
  declare const code_detectOperationType: typeof detectOperationType;
293
307
  declare const code_envToExport: typeof envToExport;
294
308
  declare const code_envToJson: typeof envToJson;
309
+ declare const code_formatCss: typeof formatCss;
295
310
  declare const code_formatGql: typeof formatGql;
296
311
  declare const code_formatHtml: typeof formatHtml;
297
312
  declare const code_formatSql: typeof formatSql;
@@ -300,6 +315,7 @@ declare const code_getHtmlStats: typeof getHtmlStats;
300
315
  declare const code_getJsStats: typeof getJsStats;
301
316
  declare const code_getMethodColor: typeof getMethodColor;
302
317
  declare const code_isValidTag: typeof isValidTag;
318
+ declare const code_minifyCss: typeof minifyCss;
303
319
  declare const code_minifyGql: typeof minifyGql;
304
320
  declare const code_minifyHtml: typeof minifyHtml;
305
321
  declare const code_minifyJs: typeof minifyJs;
@@ -321,7 +337,7 @@ declare const code_testPattern: typeof testPattern;
321
337
  declare const code_testRegex: typeof testRegex;
322
338
  declare const code_validateEnvKey: typeof validateEnvKey;
323
339
  declare namespace code {
324
- export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, type code_MatchResult as MatchResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
340
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CssResult as CssResult, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, type code_MatchResult as MatchResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
325
341
  }
326
342
 
327
- export { normalizeRef as $, ALL_FLAGS as A, envToExport as B, CHEATSHEET as C, type DockerImageRef as D, type EnvEntry as E, envToJson as F, type GitCommandConfig as G, type HtmlFormatResult as H, formatGql as I, type JsMinifyOptions as J, formatHtml as K, formatSql as L, type MatchResult as M, getEndpointsByTag as N, OPERATIONS as O, type ParsedSpec as P, getHtmlStats as Q, type RegexError as R, SQL_DEFAULT_OPTIONS as S, type TestPatternResult as T, getJsStats as U, getMethodColor as V, isValidTag as W, minifyGql as X, minifyHtml as Y, minifyJs as Z, minifySql as _, type ApiEndpoint as a, parseDockerImage as a0, parseEnv as a1, parseGitCommand as a2, parseSpec as a3, removeConsoleCalls as a4, removeEmptyAttributes as a5, removeHtmlComments as a6, removeJsComments as a7, removeRedundantAttributes as a8, searchCheatsheet as a9, searchEndpoints as aa, splitStatements as ab, testPattern as ac, testRegex as ad, validateEnvKey as ae, type ApiInfo as b, code as c, type CheatsheetEntry as d, type EnvParseResult as e, type GitCommandResult as f, type GitOperation as g, type GqlFormatResult as h, type HtmlMinifyOptions as i, type HtmlMinifyResult as j, type JsMinifyResult as k, type RegexFlag as l, type RegexMatch as m, type RegexResult as n, type RegexSuccess as o, type Segment as p, type SpecVersion as q, type SqlDialect as r, type SqlFormatOptions as s, buildDockerPull as t, buildDockerRun as u, buildGitCommand as v, collapseHtmlWhitespace as w, collapseJsWhitespace as x, detectDialect as y, detectOperationType as z };
343
+ export { minifyCss as $, ALL_FLAGS as A, countRules as B, CHEATSHEET as C, type DockerImageRef as D, type EnvEntry as E, detectDialect as F, type GitCommandConfig as G, type HtmlFormatResult as H, detectOperationType as I, type JsMinifyOptions as J, envToExport as K, envToJson as L, type MatchResult as M, formatCss as N, OPERATIONS as O, type ParsedSpec as P, formatGql as Q, type RegexError as R, SQL_DEFAULT_OPTIONS as S, type TestPatternResult as T, formatHtml as U, formatSql as V, getEndpointsByTag as W, getHtmlStats as X, getJsStats as Y, getMethodColor as Z, isValidTag as _, type ApiEndpoint as a, minifyGql as a0, minifyHtml as a1, minifyJs as a2, minifySql as a3, normalizeRef as a4, parseDockerImage as a5, parseEnv as a6, parseGitCommand as a7, parseSpec as a8, removeConsoleCalls as a9, removeEmptyAttributes as aa, removeHtmlComments as ab, removeJsComments as ac, removeRedundantAttributes as ad, searchCheatsheet as ae, searchEndpoints as af, splitStatements as ag, testPattern as ah, testRegex as ai, validateEnvKey as aj, type ApiInfo as b, code as c, type CheatsheetEntry as d, type CssResult as e, type EnvParseResult as f, type GitCommandResult as g, type GitOperation as h, type GqlFormatResult as i, type HtmlMinifyOptions as j, type HtmlMinifyResult as k, type JsMinifyResult as l, type RegexFlag as m, type RegexMatch as n, type RegexResult as o, type RegexSuccess as p, type Segment as q, type SpecVersion as r, type SqlDialect as s, type SqlFormatOptions as t, buildDockerPull as u, buildDockerRun as v, buildGitCommand as w, collapseHtmlWhitespace as x, collapseJsWhitespace as y, countProperties as z };