@utilix-tech/sdk 0.80.0 → 0.82.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.
@@ -32,6 +32,8 @@
32
32
  * - markdown-footnote-extractor (extractMarkdownFootnotes)
33
33
  * - aria-validator (validateAria)
34
34
  * - connection-string-parser (parseConnectionString)
35
+ * - markdown-fence-lang-validator (validateFenceLanguageTags, KNOWN_LANGUAGE_TAGS)
36
+ * - sql-placeholder-counter (countSqlPlaceholders)
35
37
  */
36
38
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
37
39
  declare const ALL_FLAGS: RegexFlag[];
@@ -674,6 +676,48 @@ interface ConnectionStringResult {
674
676
  declare function parseConnectionString(input: string): ConnectionStringResult | {
675
677
  error: string;
676
678
  };
679
+ type FenceTagIssueType = 'missing' | 'unknown' | 'inconsistent-case';
680
+ interface FenceTagIssue {
681
+ line: number;
682
+ tag: string;
683
+ issue: FenceTagIssueType;
684
+ suggestion?: string;
685
+ }
686
+ interface FenceValidationResult {
687
+ totalFences: number;
688
+ issues: FenceTagIssue[];
689
+ }
690
+ declare const KNOWN_LANGUAGE_TAGS: Set<string>;
691
+ /**
692
+ * Scans a Markdown document's fenced code blocks and flags ones with a
693
+ * missing, unknown, or inconsistently-cased language tag (compared against
694
+ * a curated list of common syntax-highlighter language identifiers).
695
+ */
696
+ declare function validateFenceLanguageTags(markdown: string): FenceValidationResult;
697
+ type PlaceholderStyle = 'anonymous' | 'numbered' | 'named-colon' | 'named-at';
698
+ interface SqlPlaceholder {
699
+ style: PlaceholderStyle;
700
+ raw: string;
701
+ index: number;
702
+ name?: string;
703
+ number?: number;
704
+ }
705
+ interface SqlPlaceholderResult {
706
+ placeholders: SqlPlaceholder[];
707
+ counts: Record<PlaceholderStyle, number>;
708
+ stylesUsed: PlaceholderStyle[];
709
+ mixedStyles: boolean;
710
+ numberedGaps: number[];
711
+ numberedDuplicates: number[];
712
+ }
713
+ /**
714
+ * Scans a SQL query string for positional (`?`, `$1`) and named (`:name`,
715
+ * `@name`) parameter placeholders, skipping over single/double-quoted
716
+ * string literals and line/block comments so a placeholder-looking
717
+ * character inside either is never counted. Postgres dollar-quoted string
718
+ * bodies (`$$...$$`) are not specially recognized.
719
+ */
720
+ declare function countSqlPlaceholders(sql: string): SqlPlaceholderResult;
677
721
 
678
722
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
679
723
  type code_ApiEndpoint = ApiEndpoint;
@@ -710,6 +754,9 @@ type code_EnvParseResult = EnvParseResult;
710
754
  type code_ExportsIssue = ExportsIssue;
711
755
  type code_ExportsShape = ExportsShape;
712
756
  type code_ExportsValidationResult = ExportsValidationResult;
757
+ type code_FenceTagIssue = FenceTagIssue;
758
+ type code_FenceTagIssueType = FenceTagIssueType;
759
+ type code_FenceValidationResult = FenceValidationResult;
713
760
  type code_GitCommandConfig = GitCommandConfig;
714
761
  type code_GitCommandResult = GitCommandResult;
715
762
  type code_GitOperation = GitOperation;
@@ -722,6 +769,7 @@ type code_HtmlMinifyOptions = HtmlMinifyOptions;
722
769
  type code_HtmlMinifyResult = HtmlMinifyResult;
723
770
  type code_JsMinifyOptions = JsMinifyOptions;
724
771
  type code_JsMinifyResult = JsMinifyResult;
772
+ declare const code_KNOWN_LANGUAGE_TAGS: typeof KNOWN_LANGUAGE_TAGS;
725
773
  declare const code_MIME_TABLE: typeof MIME_TABLE;
726
774
  type code_MarkdownFootnoteDefinition = MarkdownFootnoteDefinition;
727
775
  type code_MarkdownFootnoteReference = MarkdownFootnoteReference;
@@ -731,6 +779,7 @@ type code_MimeEntry = MimeEntry;
731
779
  type code_MimeLookupResult = MimeLookupResult;
732
780
  declare const code_OPERATIONS: typeof OPERATIONS;
733
781
  type code_ParsedSpec = ParsedSpec;
782
+ type code_PlaceholderStyle = PlaceholderStyle;
734
783
  type code_RedosFinding = RedosFinding;
735
784
  type code_RedosResult = RedosResult;
736
785
  type code_RedosSeverity = RedosSeverity;
@@ -748,6 +797,8 @@ type code_Segment = Segment;
748
797
  type code_SpecVersion = SpecVersion;
749
798
  type code_SqlDialect = SqlDialect;
750
799
  type code_SqlFormatOptions = SqlFormatOptions;
800
+ type code_SqlPlaceholder = SqlPlaceholder;
801
+ type code_SqlPlaceholderResult = SqlPlaceholderResult;
751
802
  type code_SvgSpriteResult = SvgSpriteResult;
752
803
  type code_SvgSpriteSymbol = SvgSpriteSymbol;
753
804
  type code_TestPatternResult = TestPatternResult;
@@ -762,6 +813,7 @@ declare const code_collapseHtmlWhitespace: typeof collapseHtmlWhitespace;
762
813
  declare const code_collapseJsWhitespace: typeof collapseJsWhitespace;
763
814
  declare const code_countProperties: typeof countProperties;
764
815
  declare const code_countRules: typeof countRules;
816
+ declare const code_countSqlPlaceholders: typeof countSqlPlaceholders;
765
817
  declare const code_detectDialect: typeof detectDialect;
766
818
  declare const code_detectOperationType: typeof detectOperationType;
767
819
  declare const code_detectRedos: typeof detectRedos;
@@ -807,10 +859,11 @@ declare const code_testRegex: typeof testRegex;
807
859
  declare const code_validateAria: typeof validateAria;
808
860
  declare const code_validateEditorConfig: typeof validateEditorConfig;
809
861
  declare const code_validateEnvKey: typeof validateEnvKey;
862
+ declare const code_validateFenceLanguageTags: typeof validateFenceLanguageTags;
810
863
  declare const code_validatePackageExports: typeof validatePackageExports;
811
864
  declare const code_validateTsconfig: typeof validateTsconfig;
812
865
  declare namespace code {
813
- export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, type code_AriaIssue as AriaIssue, type code_AriaValidationResult as AriaValidationResult, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CommitTrailer as CommitTrailer, type code_CommitTrailerResult as CommitTrailerResult, type code_ConnectionStringHost as ConnectionStringHost, type code_ConnectionStringResult as ConnectionStringResult, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, 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, code_MIME_TABLE as MIME_TABLE, type code_MarkdownFootnoteDefinition as MarkdownFootnoteDefinition, type code_MarkdownFootnoteReference as MarkdownFootnoteReference, type code_MarkdownFootnoteResult as MarkdownFootnoteResult, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, 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_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, 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_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractMarkdownFootnotes as extractMarkdownFootnotes, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, 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_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, 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_parseCommitTrailers as parseCommitTrailers, code_parseConnectionString as parseConnectionString, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, 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_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateAria as validateAria, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
866
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, type code_AriaIssue as AriaIssue, type code_AriaValidationResult as AriaValidationResult, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CommitTrailer as CommitTrailer, type code_CommitTrailerResult as CommitTrailerResult, type code_ConnectionStringHost as ConnectionStringHost, type code_ConnectionStringResult as ConnectionStringResult, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_FenceTagIssue as FenceTagIssue, type code_FenceTagIssueType as FenceTagIssueType, type code_FenceValidationResult as FenceValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, 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, code_KNOWN_LANGUAGE_TAGS as KNOWN_LANGUAGE_TAGS, code_MIME_TABLE as MIME_TABLE, type code_MarkdownFootnoteDefinition as MarkdownFootnoteDefinition, type code_MarkdownFootnoteReference as MarkdownFootnoteReference, type code_MarkdownFootnoteResult as MarkdownFootnoteResult, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_PlaceholderStyle as PlaceholderStyle, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, 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_SqlPlaceholder as SqlPlaceholder, type code_SqlPlaceholderResult as SqlPlaceholderResult, type code_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, 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_countSqlPlaceholders as countSqlPlaceholders, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractMarkdownFootnotes as extractMarkdownFootnotes, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, 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_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, 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_parseCommitTrailers as parseCommitTrailers, code_parseConnectionString as parseConnectionString, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, 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_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateAria as validateAria, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validateFenceLanguageTags as validateFenceLanguageTags, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
814
867
  }
815
868
 
816
- export { type MimeEntry as $, ALL_FLAGS as A, type EditorConfigValidationResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type EnvEntry as F, type EnvParseResult as G, type ExportsIssue as H, type ExportsShape as I, type ExportsValidationResult as J, type GitCommandConfig as K, type GitCommandResult as L, type GitOperation as M, type GithubUrlInfo as N, type GithubUrlType as O, type GitignoreTestResult as P, type GqlFormatResult as Q, type HtmlFormatResult as R, type HtmlMinifyOptions as S, type HtmlMinifyResult as T, type JsMinifyOptions as U, type JsMinifyResult as V, MIME_TABLE as W, type MarkdownFootnoteDefinition as X, type MarkdownFootnoteReference as Y, type MarkdownFootnoteResult as Z, type MatchResult as _, type ApiEndpoint as a, parseGithubUrl as a$, type MimeLookupResult as a0, OPERATIONS as a1, type ParsedSpec as a2, type RedosFinding as a3, type RedosResult as a4, type RedosSeverity as a5, type RegexBackreferenceInfo as a6, type RegexError as a7, type RegexFlag as a8, type RegexGroupAnalysis as a9, detectRedos as aA, envToExport as aB, envToJson as aC, extractMarkdownFootnotes as aD, extractSvgSpriteSymbols as aE, formatCss as aF, formatGql as aG, formatHtml as aH, formatSql as aI, getEndpointsByTag as aJ, getHtmlStats as aK, getJsStats as aL, getMethodColor as aM, isValidTag as aN, lintConventionalCommit as aO, lookupMime as aP, minifyCss as aQ, minifyGql as aR, minifyHtml as aS, minifyJs as aT, minifySql as aU, normalizeRef as aV, parseCommitTrailers as aW, parseConnectionString as aX, parseDockerImage as aY, parseEnv as aZ, parseGitCommand as a_, type RegexGroupInfo as aa, type RegexGroupIssue as ab, type RegexMatch as ac, type RegexResult as ad, type RegexSuccess as ae, SQL_DEFAULT_OPTIONS as af, type Segment as ag, type SpecVersion as ah, type SqlDialect as ai, type SqlFormatOptions as aj, type SvgSpriteResult as ak, type SvgSpriteSymbol as al, type TestPatternResult as am, type TsconfigIssue as an, type TsconfigValidationResult as ao, analyzeRegexGroups as ap, auditDependencyRanges as aq, buildDockerPull as ar, buildDockerRun as as, buildGitCommand as at, collapseHtmlWhitespace as au, collapseJsWhitespace as av, countProperties as aw, countRules as ax, detectDialect as ay, detectOperationType as az, type ApiInfo as b, parseSpec as b0, removeConsoleCalls as b1, removeEmptyAttributes as b2, removeHtmlComments as b3, removeJsComments as b4, removeRedundantAttributes as b5, searchCheatsheet as b6, searchEndpoints as b7, splitStatements as b8, testGitignorePatterns as b9, testPattern as ba, testRegex as bb, validateAria as bc, validateEditorConfig as bd, validateEnvKey as be, validatePackageExports as bf, validateTsconfig as bg, code as c, type AriaIssue as d, type AriaValidationResult as e, type CheatsheetEntry as f, type CommitTrailer as g, type CommitTrailerResult as h, type ConnectionStringHost as i, type ConnectionStringResult as j, type ConventionalCommitFinding as k, type ConventionalCommitFooter as l, type ConventionalCommitOptions as m, type ConventionalCommitParsed as n, type ConventionalCommitResult as o, type ConventionalCommitSeverity as p, type CssResult as q, type DependencyAuditDuplicate as r, type DependencyAuditEntry as s, type DependencyAuditIssue as t, type DependencyAuditResult as u, type DependencyRangeType as v, type DependencySection as w, type DockerImageRef as x, type EditorConfigProperty as y, type EditorConfigSection as z };
869
+ export { type MarkdownFootnoteDefinition as $, ALL_FLAGS as A, type EditorConfigValidationResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type EnvEntry as F, type EnvParseResult as G, type ExportsIssue as H, type ExportsShape as I, type ExportsValidationResult as J, type FenceTagIssue as K, type FenceTagIssueType as L, type FenceValidationResult as M, type GitCommandConfig as N, type GitCommandResult as O, type GitOperation as P, type GithubUrlInfo as Q, type GithubUrlType as R, type GitignoreTestResult as S, type GqlFormatResult as T, type HtmlFormatResult as U, type HtmlMinifyOptions as V, type HtmlMinifyResult as W, type JsMinifyOptions as X, type JsMinifyResult as Y, KNOWN_LANGUAGE_TAGS as Z, MIME_TABLE as _, type ApiEndpoint as a, minifyJs as a$, type MarkdownFootnoteReference as a0, type MarkdownFootnoteResult as a1, type MatchResult as a2, type MimeEntry as a3, type MimeLookupResult as a4, OPERATIONS as a5, type ParsedSpec as a6, type PlaceholderStyle as a7, type RedosFinding as a8, type RedosResult as a9, buildGitCommand as aA, collapseHtmlWhitespace as aB, collapseJsWhitespace as aC, countProperties as aD, countRules as aE, countSqlPlaceholders as aF, detectDialect as aG, detectOperationType as aH, detectRedos as aI, envToExport as aJ, envToJson as aK, extractMarkdownFootnotes as aL, extractSvgSpriteSymbols as aM, formatCss as aN, formatGql as aO, formatHtml as aP, formatSql as aQ, getEndpointsByTag as aR, getHtmlStats as aS, getJsStats as aT, getMethodColor as aU, isValidTag as aV, lintConventionalCommit as aW, lookupMime as aX, minifyCss as aY, minifyGql as aZ, minifyHtml as a_, type RedosSeverity as aa, type RegexBackreferenceInfo as ab, type RegexError as ac, type RegexFlag as ad, type RegexGroupAnalysis as ae, type RegexGroupInfo as af, type RegexGroupIssue as ag, type RegexMatch as ah, type RegexResult as ai, type RegexSuccess as aj, SQL_DEFAULT_OPTIONS as ak, type Segment as al, type SpecVersion as am, type SqlDialect as an, type SqlFormatOptions as ao, type SqlPlaceholder as ap, type SqlPlaceholderResult as aq, type SvgSpriteResult as ar, type SvgSpriteSymbol as as, type TestPatternResult as at, type TsconfigIssue as au, type TsconfigValidationResult as av, analyzeRegexGroups as aw, auditDependencyRanges as ax, buildDockerPull as ay, buildDockerRun as az, type ApiInfo as b, minifySql as b0, normalizeRef as b1, parseCommitTrailers as b2, parseConnectionString as b3, parseDockerImage as b4, parseEnv as b5, parseGitCommand as b6, parseGithubUrl as b7, parseSpec as b8, removeConsoleCalls as b9, removeEmptyAttributes as ba, removeHtmlComments as bb, removeJsComments as bc, removeRedundantAttributes as bd, searchCheatsheet as be, searchEndpoints as bf, splitStatements as bg, testGitignorePatterns as bh, testPattern as bi, testRegex as bj, validateAria as bk, validateEditorConfig as bl, validateEnvKey as bm, validateFenceLanguageTags as bn, validatePackageExports as bo, validateTsconfig as bp, code as c, type AriaIssue as d, type AriaValidationResult as e, type CheatsheetEntry as f, type CommitTrailer as g, type CommitTrailerResult as h, type ConnectionStringHost as i, type ConnectionStringResult as j, type ConventionalCommitFinding as k, type ConventionalCommitFooter as l, type ConventionalCommitOptions as m, type ConventionalCommitParsed as n, type ConventionalCommitResult as o, type ConventionalCommitSeverity as p, type CssResult as q, type DependencyAuditDuplicate as r, type DependencyAuditEntry as s, type DependencyAuditIssue as t, type DependencyAuditResult as u, type DependencyRangeType as v, type DependencySection as w, type DockerImageRef as x, type EditorConfigProperty as y, type EditorConfigSection as z };
package/dist/index.cjs CHANGED
@@ -11724,6 +11724,7 @@ __export(network_exports, {
11724
11724
  extractMultipartBoundary: () => extractMultipartBoundary,
11725
11725
  formatCoordinates: () => formatCoordinates,
11726
11726
  formatTtl: () => formatTtl,
11727
+ generateRobotsTxt: () => generateRobotsTxt,
11727
11728
  getByCategory: () => getByCategory,
11728
11729
  getHeader: () => getHeader,
11729
11730
  getHeadersByCategory: () => getHeadersByCategory,
@@ -13397,6 +13398,40 @@ function validateRobotsTxt(text) {
13397
13398
  const valid = !issues.some((i) => i.severity === "error");
13398
13399
  return { groups, sitemaps, issues, valid };
13399
13400
  }
13401
+ function generateRobotsTxt(options) {
13402
+ if (!options || !Array.isArray(options.groups) || options.groups.length === 0) {
13403
+ return { error: "At least one group with a user-agent is required" };
13404
+ }
13405
+ const lines = [];
13406
+ for (const group of options.groups) {
13407
+ const userAgents = (group.userAgents ?? []).map((a) => a.trim()).filter(Boolean);
13408
+ if (userAgents.length === 0) return { error: "Each group needs at least one non-empty user-agent" };
13409
+ for (const ua of userAgents) lines.push(`User-agent: ${ua}`);
13410
+ const disallow = group.disallow ?? [];
13411
+ const allow = group.allow ?? [];
13412
+ if (disallow.length === 0 && allow.length === 0) {
13413
+ lines.push("Disallow:");
13414
+ } else {
13415
+ for (const value of disallow) lines.push(`Disallow: ${value}`);
13416
+ for (const value of allow) lines.push(`Allow: ${value}`);
13417
+ }
13418
+ if (group.crawlDelay !== void 0) {
13419
+ if (!Number.isFinite(group.crawlDelay) || group.crawlDelay < 0) {
13420
+ return { error: "crawlDelay must be a non-negative number" };
13421
+ }
13422
+ lines.push(`Crawl-delay: ${group.crawlDelay}`);
13423
+ }
13424
+ lines.push("");
13425
+ }
13426
+ for (const sitemap of options.sitemaps ?? []) {
13427
+ if (!/^https?:\/\//i.test(sitemap)) {
13428
+ return { error: `Sitemap URL "${sitemap}" must be absolute (start with http:// or https://)` };
13429
+ }
13430
+ lines.push(`Sitemap: ${sitemap}`);
13431
+ }
13432
+ while (lines.length > 0 && lines[lines.length - 1] === "") lines.pop();
13433
+ return { text: lines.join("\n") + "\n" };
13434
+ }
13400
13435
  var UA_BOT_PATTERNS = [
13401
13436
  [/googlebot/i, "Googlebot"],
13402
13437
  [/bingbot/i, "Bingbot"],
@@ -16736,6 +16771,7 @@ __export(code_exports, {
16736
16771
  ALL_FLAGS: () => ALL_FLAGS,
16737
16772
  CHEATSHEET: () => CHEATSHEET,
16738
16773
  DEFAULT_COMMIT_TYPES: () => DEFAULT_COMMIT_TYPES,
16774
+ KNOWN_LANGUAGE_TAGS: () => KNOWN_LANGUAGE_TAGS,
16739
16775
  MIME_TABLE: () => MIME_TABLE,
16740
16776
  OPERATIONS: () => OPERATIONS,
16741
16777
  SQL_DEFAULT_OPTIONS: () => SQL_DEFAULT_OPTIONS,
@@ -16748,6 +16784,7 @@ __export(code_exports, {
16748
16784
  collapseJsWhitespace: () => collapseJsWhitespace,
16749
16785
  countProperties: () => countProperties,
16750
16786
  countRules: () => countRules,
16787
+ countSqlPlaceholders: () => countSqlPlaceholders,
16751
16788
  detectDialect: () => detectDialect,
16752
16789
  detectOperationType: () => detectOperationType,
16753
16790
  detectRedos: () => detectRedos,
@@ -16793,6 +16830,7 @@ __export(code_exports, {
16793
16830
  validateAria: () => validateAria,
16794
16831
  validateEditorConfig: () => validateEditorConfig,
16795
16832
  validateEnvKey: () => validateEnvKey2,
16833
+ validateFenceLanguageTags: () => validateFenceLanguageTags,
16796
16834
  validatePackageExports: () => validatePackageExports,
16797
16835
  validateTsconfig: () => validateTsconfig
16798
16836
  });
@@ -20653,6 +20691,347 @@ function parseConnectionString(input) {
20653
20691
  }
20654
20692
  return { scheme, user, password, hosts, database, params };
20655
20693
  }
20694
+ var KNOWN_LANGUAGE_TAGS = /* @__PURE__ */ new Set([
20695
+ "js",
20696
+ "jsx",
20697
+ "mjs",
20698
+ "cjs",
20699
+ "javascript",
20700
+ "ts",
20701
+ "tsx",
20702
+ "typescript",
20703
+ "json",
20704
+ "json5",
20705
+ "jsonc",
20706
+ "jsonl",
20707
+ "ndjson",
20708
+ "yaml",
20709
+ "yml",
20710
+ "toml",
20711
+ "ini",
20712
+ "cfg",
20713
+ "conf",
20714
+ "properties",
20715
+ "env",
20716
+ "dotenv",
20717
+ "html",
20718
+ "htm",
20719
+ "xml",
20720
+ "svg",
20721
+ "xhtml",
20722
+ "css",
20723
+ "scss",
20724
+ "sass",
20725
+ "less",
20726
+ "stylus",
20727
+ "styl",
20728
+ "markdown",
20729
+ "md",
20730
+ "mdx",
20731
+ "bash",
20732
+ "sh",
20733
+ "shell",
20734
+ "zsh",
20735
+ "fish",
20736
+ "console",
20737
+ "powershell",
20738
+ "ps1",
20739
+ "bat",
20740
+ "cmd",
20741
+ "python",
20742
+ "py",
20743
+ "py3",
20744
+ "ipynb",
20745
+ "ruby",
20746
+ "rb",
20747
+ "erb",
20748
+ "php",
20749
+ "java",
20750
+ "kotlin",
20751
+ "kt",
20752
+ "kts",
20753
+ "groovy",
20754
+ "gradle",
20755
+ "swift",
20756
+ "objectivec",
20757
+ "objc",
20758
+ "go",
20759
+ "golang",
20760
+ "rust",
20761
+ "rs",
20762
+ "c",
20763
+ "h",
20764
+ "cpp",
20765
+ "cc",
20766
+ "cxx",
20767
+ "hpp",
20768
+ "c++",
20769
+ "csharp",
20770
+ "cs",
20771
+ "fsharp",
20772
+ "fs",
20773
+ "perl",
20774
+ "pl",
20775
+ "lua",
20776
+ "r",
20777
+ "matlab",
20778
+ "m",
20779
+ "scala",
20780
+ "nim",
20781
+ "zig",
20782
+ "julia",
20783
+ "jl",
20784
+ "haskell",
20785
+ "hs",
20786
+ "elixir",
20787
+ "ex",
20788
+ "exs",
20789
+ "erlang",
20790
+ "erl",
20791
+ "clojure",
20792
+ "clj",
20793
+ "cljs",
20794
+ "dart",
20795
+ "ocaml",
20796
+ "ml",
20797
+ "sql",
20798
+ "mysql",
20799
+ "postgresql",
20800
+ "plsql",
20801
+ "sqlite",
20802
+ "graphql",
20803
+ "gql",
20804
+ "dockerfile",
20805
+ "docker",
20806
+ "makefile",
20807
+ "make",
20808
+ "cmake",
20809
+ "nginx",
20810
+ "apache",
20811
+ "diff",
20812
+ "patch",
20813
+ "git",
20814
+ "http",
20815
+ "proto",
20816
+ "protobuf",
20817
+ "csv",
20818
+ "tsv",
20819
+ "vim",
20820
+ "viml",
20821
+ "tex",
20822
+ "latex",
20823
+ "bibtex",
20824
+ "plaintext",
20825
+ "text",
20826
+ "txt",
20827
+ "nohighlight",
20828
+ "none",
20829
+ "asciidoc",
20830
+ "adoc",
20831
+ "rst",
20832
+ "vue",
20833
+ "svelte",
20834
+ "astro",
20835
+ "wasm",
20836
+ "wat",
20837
+ "handlebars",
20838
+ "hbs",
20839
+ "pug",
20840
+ "jade",
20841
+ "coffee",
20842
+ "coffeescript",
20843
+ "actionscript",
20844
+ "terraform",
20845
+ "tf",
20846
+ "hcl",
20847
+ "puppet",
20848
+ "ansible"
20849
+ ]);
20850
+ function _parseFenceLine(line) {
20851
+ const match = line.match(/^( {0,3})(`{3,}|~{3,})(.*)$/);
20852
+ if (!match) return null;
20853
+ const [, indent, marker, rest] = match;
20854
+ const char = marker[0];
20855
+ if (char === "`" && rest.includes("`")) return null;
20856
+ return { indent: indent.length, char, length: marker.length, infoString: rest.trim() };
20857
+ }
20858
+ function _isClosingFence(line, fenceChar, fenceLength) {
20859
+ const match = line.match(/^ {0,3}(`+|~+)\s*$/);
20860
+ if (!match) return false;
20861
+ const marker = match[1];
20862
+ return marker[0] === fenceChar && marker.length >= fenceLength;
20863
+ }
20864
+ function validateFenceLanguageTags(markdown) {
20865
+ const lines = markdown.split("\n");
20866
+ const issues = [];
20867
+ let totalFences = 0;
20868
+ let open = null;
20869
+ for (let i = 0; i < lines.length; i++) {
20870
+ const lineNumber = i + 1;
20871
+ const line = lines[i];
20872
+ if (open) {
20873
+ if (_isClosingFence(line, open.char, open.length)) open = null;
20874
+ continue;
20875
+ }
20876
+ const fence = _parseFenceLine(line);
20877
+ if (!fence) continue;
20878
+ totalFences++;
20879
+ const tag = fence.infoString.split(/\s+/)[0] ?? "";
20880
+ open = { char: fence.char, length: fence.length };
20881
+ if (tag === "") {
20882
+ issues.push({ line: lineNumber, tag, issue: "missing" });
20883
+ continue;
20884
+ }
20885
+ const lower = tag.toLowerCase();
20886
+ if (!KNOWN_LANGUAGE_TAGS.has(lower)) {
20887
+ issues.push({ line: lineNumber, tag, issue: "unknown" });
20888
+ continue;
20889
+ }
20890
+ if (tag !== lower) {
20891
+ issues.push({ line: lineNumber, tag, issue: "inconsistent-case", suggestion: lower });
20892
+ }
20893
+ }
20894
+ return { totalFences, issues };
20895
+ }
20896
+ var _IDENT_START = /[A-Za-z_]/;
20897
+ var _IDENT_CHAR = /[A-Za-z0-9_]/;
20898
+ function _readIdentifier(sql, start) {
20899
+ let end = start;
20900
+ while (end < sql.length && _IDENT_CHAR.test(sql[end])) end++;
20901
+ return sql.slice(start, end);
20902
+ }
20903
+ function countSqlPlaceholders(sql) {
20904
+ const placeholders = [];
20905
+ let state = "normal";
20906
+ let i = 0;
20907
+ while (i < sql.length) {
20908
+ const ch = sql[i];
20909
+ const next = sql[i + 1];
20910
+ if (state === "single") {
20911
+ if (ch === "'" && next === "'") {
20912
+ i += 2;
20913
+ continue;
20914
+ }
20915
+ if (ch === "'") {
20916
+ state = "normal";
20917
+ i++;
20918
+ continue;
20919
+ }
20920
+ i++;
20921
+ continue;
20922
+ }
20923
+ if (state === "double") {
20924
+ if (ch === '"' && next === '"') {
20925
+ i += 2;
20926
+ continue;
20927
+ }
20928
+ if (ch === '"') {
20929
+ state = "normal";
20930
+ i++;
20931
+ continue;
20932
+ }
20933
+ i++;
20934
+ continue;
20935
+ }
20936
+ if (state === "line-comment") {
20937
+ if (ch === "\n") state = "normal";
20938
+ i++;
20939
+ continue;
20940
+ }
20941
+ if (state === "block-comment") {
20942
+ if (ch === "*" && next === "/") {
20943
+ state = "normal";
20944
+ i += 2;
20945
+ continue;
20946
+ }
20947
+ i++;
20948
+ continue;
20949
+ }
20950
+ if (ch === "'") {
20951
+ state = "single";
20952
+ i++;
20953
+ continue;
20954
+ }
20955
+ if (ch === '"') {
20956
+ state = "double";
20957
+ i++;
20958
+ continue;
20959
+ }
20960
+ if (ch === "-" && next === "-") {
20961
+ state = "line-comment";
20962
+ i += 2;
20963
+ continue;
20964
+ }
20965
+ if (ch === "/" && next === "*") {
20966
+ state = "block-comment";
20967
+ i += 2;
20968
+ continue;
20969
+ }
20970
+ if (ch === "?") {
20971
+ placeholders.push({ style: "anonymous", raw: "?", index: i });
20972
+ i++;
20973
+ continue;
20974
+ }
20975
+ if (ch === "$" && /[0-9]/.test(next ?? "")) {
20976
+ let end = i + 1;
20977
+ while (end < sql.length && /[0-9]/.test(sql[end])) end++;
20978
+ const raw = sql.slice(i, end);
20979
+ placeholders.push({ style: "numbered", raw, index: i, number: parseInt(raw.slice(1), 10) });
20980
+ i = end;
20981
+ continue;
20982
+ }
20983
+ if (ch === ":") {
20984
+ if (next === ":") {
20985
+ i += 2;
20986
+ continue;
20987
+ }
20988
+ if (next && _IDENT_START.test(next)) {
20989
+ const name = _readIdentifier(sql, i + 1);
20990
+ placeholders.push({ style: "named-colon", raw: `:${name}`, index: i, name });
20991
+ i += 1 + name.length;
20992
+ continue;
20993
+ }
20994
+ i++;
20995
+ continue;
20996
+ }
20997
+ if (ch === "@") {
20998
+ if (next === "@") {
20999
+ i += 2;
21000
+ continue;
21001
+ }
21002
+ if (next && _IDENT_START.test(next)) {
21003
+ const name = _readIdentifier(sql, i + 1);
21004
+ placeholders.push({ style: "named-at", raw: `@${name}`, index: i, name });
21005
+ i += 1 + name.length;
21006
+ continue;
21007
+ }
21008
+ i++;
21009
+ continue;
21010
+ }
21011
+ i++;
21012
+ }
21013
+ const counts = { anonymous: 0, numbered: 0, "named-colon": 0, "named-at": 0 };
21014
+ for (const p of placeholders) counts[p.style]++;
21015
+ const stylesUsed = ["anonymous", "numbered", "named-colon", "named-at"].filter((s) => counts[s] > 0);
21016
+ const numbers = placeholders.filter((p) => p.style === "numbered").map((p) => p.number);
21017
+ const maxNumber = numbers.length > 0 ? Math.max(...numbers) : 0;
21018
+ const seen = new Set(numbers);
21019
+ const numberedGaps = [];
21020
+ for (let n = 1; n < maxNumber; n++) {
21021
+ if (!seen.has(n)) numberedGaps.push(n);
21022
+ }
21023
+ const countedMap = /* @__PURE__ */ new Map();
21024
+ for (const n of numbers) countedMap.set(n, (countedMap.get(n) ?? 0) + 1);
21025
+ const numberedDuplicates = [...countedMap.entries()].filter(([, c]) => c > 1).map(([n]) => n).sort((a, b) => a - b);
21026
+ return {
21027
+ placeholders,
21028
+ counts,
21029
+ stylesUsed,
21030
+ mixedStyles: stylesUsed.length > 1,
21031
+ numberedGaps,
21032
+ numberedDuplicates
21033
+ };
21034
+ }
20656
21035
 
20657
21036
  // src/tools/color.ts
20658
21037
  var color_exports = {};
package/dist/index.d.cts CHANGED
@@ -6,9 +6,9 @@ export { d as data } from './data-DIyBrJ6l.cjs';
6
6
  export { g as generators } from './generators-DAXXrMvG.cjs';
7
7
  export { t as time } from './time-KqJjdqII.cjs';
8
8
  export { u as units } from './units-D7YRRwei.cjs';
9
- export { n as network } from './network-BskZe1n2.cjs';
9
+ export { n as network } from './network-ylRtLPEs.cjs';
10
10
  export { a as api } from './api-CQnIUrVB.cjs';
11
- export { c as code } from './code-C4n621_i.cjs';
11
+ export { c as code } from './code-B8yHwP3m.cjs';
12
12
  export { c as color } from './color-tPwZCr9H.cjs';
13
13
  export { c as css } from './css-Cf7AMGM-.cjs';
14
14
  export { m as misc } from './misc-CA3N198T.cjs';
package/dist/index.d.ts CHANGED
@@ -6,9 +6,9 @@ export { d as data } from './data-DIyBrJ6l.js';
6
6
  export { g as generators } from './generators-DAXXrMvG.js';
7
7
  export { t as time } from './time-KqJjdqII.js';
8
8
  export { u as units } from './units-D7YRRwei.js';
9
- export { n as network } from './network-BskZe1n2.js';
9
+ export { n as network } from './network-ylRtLPEs.js';
10
10
  export { a as api } from './api-CQnIUrVB.js';
11
- export { c as code } from './code-C4n621_i.js';
11
+ export { c as code } from './code-B8yHwP3m.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';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { media_exports as media } from './chunk-ZWFZRDQ4.js';
2
2
  export { units_exports as units } from './chunk-OFLNVDNX.js';
3
- export { network_exports as network } from './chunk-KWS4ZCYG.js';
3
+ export { network_exports as network } from './chunk-SW3J5CAI.js';
4
4
  export { api_exports as api } from './chunk-U2HREMZU.js';
5
- export { code_exports as code } from './chunk-RYSN5JNA.js';
5
+ export { code_exports as code } from './chunk-FPFA4ZHC.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';