nx-md-parser 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +32 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/markdown-transformer.d.ts +105 -0
- package/dist/src/lib/markdown-transformer.d.ts.map +1 -0
- package/dist/src/lib/markdown-transformer.js +455 -0
- package/dist/src/lib/markdown-transformer.js.map +1 -0
- package/docs/QUICKSTART.md +197 -0
- package/docs/README.md +366 -0
- package/docs/SUMMARY.md +270 -0
- package/examples/integration-example.ts +531 -0
- package/examples/markdown-example.ts +221 -0
- package/package.json +55 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown to JSON Transformer
|
|
3
|
+
*
|
|
4
|
+
* A powerful library that parses markdown text and transforms it into JSON objects
|
|
5
|
+
* matching a desired schema with intelligent auto-fixing capabilities.
|
|
6
|
+
*/
|
|
7
|
+
export { JSONTransformer } from './lib/markdown-transformer';
|
|
8
|
+
export { Schema } from './lib/markdown-transformer';
|
|
9
|
+
export { MarkdownParser, mergeTransformResults, jsonToMarkdown, loadSchemaFromFile, createTransformerFromSchemaFile } from './lib/markdown-transformer';
|
|
10
|
+
export type { SchemaType, ValidationStatus, TransformResult, MarkdownSection, } from './lib/markdown-transformer';
|
|
11
|
+
export { mergeNoRedundancy, mergeMultiple, mergeWithRoles, loadJson, toCamelCase, fromCamelToTitle, toTitleCase, anyToMarkdownString } from 'nx-helpers';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,+BAA+B,EAChC,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACpB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown to JSON Transformer
|
|
4
|
+
*
|
|
5
|
+
* A powerful library that parses markdown text and transforms it into JSON objects
|
|
6
|
+
* matching a desired schema with intelligent auto-fixing capabilities.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.anyToMarkdownString = exports.toTitleCase = exports.fromCamelToTitle = exports.toCamelCase = exports.loadJson = exports.mergeWithRoles = exports.mergeMultiple = exports.mergeNoRedundancy = exports.createTransformerFromSchemaFile = exports.loadSchemaFromFile = exports.jsonToMarkdown = exports.mergeTransformResults = exports.MarkdownParser = exports.Schema = exports.JSONTransformer = void 0;
|
|
10
|
+
// Core functionality - what most users need
|
|
11
|
+
var markdown_transformer_1 = require("./lib/markdown-transformer");
|
|
12
|
+
Object.defineProperty(exports, "JSONTransformer", { enumerable: true, get: function () { return markdown_transformer_1.JSONTransformer; } });
|
|
13
|
+
var markdown_transformer_2 = require("./lib/markdown-transformer");
|
|
14
|
+
Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return markdown_transformer_2.Schema; } });
|
|
15
|
+
// Advanced functionality - optional utilities
|
|
16
|
+
var markdown_transformer_3 = require("./lib/markdown-transformer");
|
|
17
|
+
Object.defineProperty(exports, "MarkdownParser", { enumerable: true, get: function () { return markdown_transformer_3.MarkdownParser; } });
|
|
18
|
+
Object.defineProperty(exports, "mergeTransformResults", { enumerable: true, get: function () { return markdown_transformer_3.mergeTransformResults; } });
|
|
19
|
+
Object.defineProperty(exports, "jsonToMarkdown", { enumerable: true, get: function () { return markdown_transformer_3.jsonToMarkdown; } });
|
|
20
|
+
Object.defineProperty(exports, "loadSchemaFromFile", { enumerable: true, get: function () { return markdown_transformer_3.loadSchemaFromFile; } });
|
|
21
|
+
Object.defineProperty(exports, "createTransformerFromSchemaFile", { enumerable: true, get: function () { return markdown_transformer_3.createTransformerFromSchemaFile; } });
|
|
22
|
+
// Essential nx-helpers re-exports (for advanced usage)
|
|
23
|
+
var nx_helpers_1 = require("nx-helpers");
|
|
24
|
+
Object.defineProperty(exports, "mergeNoRedundancy", { enumerable: true, get: function () { return nx_helpers_1.mergeNoRedundancy; } });
|
|
25
|
+
Object.defineProperty(exports, "mergeMultiple", { enumerable: true, get: function () { return nx_helpers_1.mergeMultiple; } });
|
|
26
|
+
Object.defineProperty(exports, "mergeWithRoles", { enumerable: true, get: function () { return nx_helpers_1.mergeWithRoles; } });
|
|
27
|
+
Object.defineProperty(exports, "loadJson", { enumerable: true, get: function () { return nx_helpers_1.loadJson; } });
|
|
28
|
+
Object.defineProperty(exports, "toCamelCase", { enumerable: true, get: function () { return nx_helpers_1.toCamelCase; } });
|
|
29
|
+
Object.defineProperty(exports, "fromCamelToTitle", { enumerable: true, get: function () { return nx_helpers_1.fromCamelToTitle; } });
|
|
30
|
+
Object.defineProperty(exports, "toTitleCase", { enumerable: true, get: function () { return nx_helpers_1.toTitleCase; } });
|
|
31
|
+
Object.defineProperty(exports, "anyToMarkdownString", { enumerable: true, get: function () { return nx_helpers_1.anyToMarkdownString; } });
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,4CAA4C;AAC5C,mEAA6D;AAApD,uHAAA,eAAe,OAAA;AACxB,mEAAoD;AAA3C,8GAAA,MAAM,OAAA;AAEf,8CAA8C;AAC9C,mEAMoC;AALlC,sHAAA,cAAc,OAAA;AACd,6HAAA,qBAAqB,OAAA;AACrB,sHAAA,cAAc,OAAA;AACd,0HAAA,kBAAkB,OAAA;AAClB,uIAAA,+BAA+B,OAAA;AAWjC,uDAAuD;AACvD,yCASoB;AARlB,+GAAA,iBAAiB,OAAA;AACjB,2GAAA,aAAa,OAAA;AACb,4GAAA,cAAc,OAAA;AACd,sGAAA,QAAQ,OAAA;AACR,yGAAA,WAAW,OAAA;AACX,8GAAA,gBAAgB,OAAA;AAChB,yGAAA,WAAW,OAAA;AACX,iHAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown to JSON Transformer with Schema Validation
|
|
3
|
+
* Converts structured markdown text to JSON matching a desired schema
|
|
4
|
+
*/
|
|
5
|
+
export type SchemaType = {
|
|
6
|
+
type: 'string';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'number';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'boolean';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'array';
|
|
13
|
+
items: SchemaType;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'object';
|
|
16
|
+
properties: Record<string, SchemaType>;
|
|
17
|
+
};
|
|
18
|
+
export type ValidationStatus = 'validated' | 'fixed' | 'failed';
|
|
19
|
+
export interface TransformResult<T = any> {
|
|
20
|
+
status: ValidationStatus;
|
|
21
|
+
result: T | null;
|
|
22
|
+
errors?: string[];
|
|
23
|
+
fixes?: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const Schema: {
|
|
26
|
+
string: () => SchemaType;
|
|
27
|
+
number: () => SchemaType;
|
|
28
|
+
boolean: () => SchemaType;
|
|
29
|
+
array: (items: SchemaType) => SchemaType;
|
|
30
|
+
object: (properties: Record<string, SchemaType>) => SchemaType;
|
|
31
|
+
};
|
|
32
|
+
export interface MarkdownSection {
|
|
33
|
+
heading: string;
|
|
34
|
+
content: string;
|
|
35
|
+
level: number;
|
|
36
|
+
}
|
|
37
|
+
export declare class MarkdownParser {
|
|
38
|
+
/**
|
|
39
|
+
* Parse markdown into sections based on headings
|
|
40
|
+
*/
|
|
41
|
+
static parseSections(markdown: string): MarkdownSection[];
|
|
42
|
+
/**
|
|
43
|
+
* Convert markdown content to appropriate data type
|
|
44
|
+
*/
|
|
45
|
+
static parseContent(content: string): any;
|
|
46
|
+
private static isList;
|
|
47
|
+
private static parseList;
|
|
48
|
+
private static isKeyValuePairs;
|
|
49
|
+
private static parseKeyValuePairs;
|
|
50
|
+
/**
|
|
51
|
+
* Convert markdown sections to a flat object
|
|
52
|
+
*/
|
|
53
|
+
static sectionsToObject(sections: MarkdownSection[]): Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
export declare class JSONTransformer {
|
|
56
|
+
private schema;
|
|
57
|
+
private fuzzyMatchThreshold;
|
|
58
|
+
private fixes;
|
|
59
|
+
private errors;
|
|
60
|
+
private wasFixed;
|
|
61
|
+
constructor(schema: SchemaType, fuzzyMatchThreshold?: number);
|
|
62
|
+
/**
|
|
63
|
+
* Transform markdown text to JSON matching schema
|
|
64
|
+
*/
|
|
65
|
+
transformMarkdown(markdown: string): TransformResult;
|
|
66
|
+
/**
|
|
67
|
+
* Transform any input to match desired schema
|
|
68
|
+
*/
|
|
69
|
+
transform(input: any): TransformResult;
|
|
70
|
+
private transformValue;
|
|
71
|
+
private toString;
|
|
72
|
+
private toNumber;
|
|
73
|
+
private toBoolean;
|
|
74
|
+
private toArray;
|
|
75
|
+
private toObject;
|
|
76
|
+
private extractNestedProperties;
|
|
77
|
+
private findMatchingKey;
|
|
78
|
+
private similarity;
|
|
79
|
+
private levenshtein;
|
|
80
|
+
private getDefaultValue;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Merge two transformation results using nx-helpers mergeNoRedundancy
|
|
84
|
+
*/
|
|
85
|
+
export declare function mergeTransformResults<T extends object>(base: TransformResult<T>, override: TransformResult<T>): TransformResult<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Merge multiple transformation results using nx-helpers mergeMultiple
|
|
88
|
+
*/
|
|
89
|
+
export declare function mergeTransformResults<T extends object>(...results: TransformResult<T>[]): TransformResult<T>;
|
|
90
|
+
/**
|
|
91
|
+
* Convert JSON data to markdown using nx-helpers anyToMarkdownString
|
|
92
|
+
* Useful for generating documentation or round-trip conversions
|
|
93
|
+
*/
|
|
94
|
+
export declare function jsonToMarkdown(data: any, level?: number): string;
|
|
95
|
+
/**
|
|
96
|
+
* Load a schema definition from a JSON file
|
|
97
|
+
* Useful for storing complex schemas in separate files
|
|
98
|
+
*/
|
|
99
|
+
export declare function loadSchemaFromFile(filePath: string): SchemaType;
|
|
100
|
+
/**
|
|
101
|
+
* Create a JSONTransformer from a schema file
|
|
102
|
+
* Convenience function for loading schema and creating transformer in one step
|
|
103
|
+
*/
|
|
104
|
+
export declare function createTransformerFromSchemaFile(schemaFilePath: string): JSONTransformer;
|
|
105
|
+
//# sourceMappingURL=markdown-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-transformer.d.ts","sourceRoot":"","sources":["../../../src/lib/markdown-transformer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,OAAO,GA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AAe;IASpD;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,eAAe;IA+BtC,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,QAAQ;IA0BhB,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,QAAQ;IA+DhB,OAAO,CAAC,uBAAuB;IAuC/B,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,WAAW;IA4BnB,OAAO,CAAC,eAAe;CAqBxB;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,eAAe,CAAC,CAAC,CAAC,CAAC;AACtB;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,GAAG,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAC/B,eAAe,CAAC,CAAC,CAAC,CAAC;AAqDtB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAMD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAE/D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,cAAc,EAAE,MAAM,GAAG,eAAe,CAGvF"}
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown to JSON Transformer with Schema Validation
|
|
4
|
+
* Converts structured markdown text to JSON matching a desired schema
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.JSONTransformer = exports.MarkdownParser = exports.Schema = void 0;
|
|
8
|
+
exports.mergeTransformResults = mergeTransformResults;
|
|
9
|
+
exports.jsonToMarkdown = jsonToMarkdown;
|
|
10
|
+
exports.loadSchemaFromFile = loadSchemaFromFile;
|
|
11
|
+
exports.createTransformerFromSchemaFile = createTransformerFromSchemaFile;
|
|
12
|
+
const nx_helpers_1 = require("nx-helpers");
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Schema Builder Helpers
|
|
15
|
+
// ============================================================================
|
|
16
|
+
exports.Schema = {
|
|
17
|
+
string: () => ({ type: 'string' }),
|
|
18
|
+
number: () => ({ type: 'number' }),
|
|
19
|
+
boolean: () => ({ type: 'boolean' }),
|
|
20
|
+
array: (items) => ({ type: 'array', items }),
|
|
21
|
+
object: (properties) => ({
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
class MarkdownParser {
|
|
27
|
+
/**
|
|
28
|
+
* Parse markdown into sections based on headings
|
|
29
|
+
*/
|
|
30
|
+
static parseSections(markdown) {
|
|
31
|
+
const lines = markdown.split('\n');
|
|
32
|
+
const sections = [];
|
|
33
|
+
let currentSection = null;
|
|
34
|
+
for (const line of lines) {
|
|
35
|
+
const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
36
|
+
if (headingMatch) {
|
|
37
|
+
// Save previous section
|
|
38
|
+
if (currentSection) {
|
|
39
|
+
currentSection.content = currentSection.content.trim();
|
|
40
|
+
sections.push(currentSection);
|
|
41
|
+
}
|
|
42
|
+
// Start new section
|
|
43
|
+
currentSection = {
|
|
44
|
+
heading: headingMatch[2].trim(),
|
|
45
|
+
content: '',
|
|
46
|
+
level: headingMatch[1].length,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else if (currentSection) {
|
|
50
|
+
// Add content to current section
|
|
51
|
+
currentSection.content += line + '\n';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Save last section
|
|
55
|
+
if (currentSection) {
|
|
56
|
+
currentSection.content = currentSection.content.trim();
|
|
57
|
+
sections.push(currentSection);
|
|
58
|
+
}
|
|
59
|
+
return sections;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Convert markdown content to appropriate data type
|
|
63
|
+
*/
|
|
64
|
+
static parseContent(content) {
|
|
65
|
+
const trimmed = content.trim();
|
|
66
|
+
// Empty content
|
|
67
|
+
if (!trimmed) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
// Check if it's a list
|
|
71
|
+
if (this.isList(trimmed)) {
|
|
72
|
+
return this.parseList(trimmed);
|
|
73
|
+
}
|
|
74
|
+
// Check if it's structured data (key: value pairs)
|
|
75
|
+
if (this.isKeyValuePairs(trimmed)) {
|
|
76
|
+
return this.parseKeyValuePairs(trimmed);
|
|
77
|
+
}
|
|
78
|
+
// Default: return as string
|
|
79
|
+
return trimmed;
|
|
80
|
+
}
|
|
81
|
+
static isList(content) {
|
|
82
|
+
const lines = content.split('\n').filter(l => l.trim());
|
|
83
|
+
return lines.length > 1 && lines.every(line => /^[-*•]\s/.test(line.trim()) || /^\d+\.\s/.test(line.trim()));
|
|
84
|
+
}
|
|
85
|
+
static parseList(content) {
|
|
86
|
+
return content
|
|
87
|
+
.split('\n')
|
|
88
|
+
.filter(line => line.trim())
|
|
89
|
+
.map(line => line.replace(/^[-*•]\s*/, '').replace(/^\d+\.\s*/, '').trim());
|
|
90
|
+
}
|
|
91
|
+
static isKeyValuePairs(content) {
|
|
92
|
+
const lines = content.split('\n').filter(l => l.trim());
|
|
93
|
+
return lines.some(line => /^[\w\s]+[:=]\s*.+/.test(line));
|
|
94
|
+
}
|
|
95
|
+
static parseKeyValuePairs(content) {
|
|
96
|
+
const result = {};
|
|
97
|
+
const lines = content.split('\n').filter(l => l.trim());
|
|
98
|
+
for (const line of lines) {
|
|
99
|
+
const match = line.match(/^([\w\s]+)[:=]\s*(.+)$/);
|
|
100
|
+
if (match) {
|
|
101
|
+
const key = (0, nx_helpers_1.toCamelCase)(match[1].trim());
|
|
102
|
+
const value = match[2].trim().replace(/^["']|["']$/g, '');
|
|
103
|
+
result[key] = value;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Convert markdown sections to a flat object
|
|
110
|
+
*/
|
|
111
|
+
static sectionsToObject(sections) {
|
|
112
|
+
const result = {};
|
|
113
|
+
for (const section of sections) {
|
|
114
|
+
const key = (0, nx_helpers_1.toCamelCase)(section.heading);
|
|
115
|
+
result[key] = this.parseContent(section.content);
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.MarkdownParser = MarkdownParser;
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// JSON Transformer with Schema
|
|
123
|
+
// ============================================================================
|
|
124
|
+
class JSONTransformer {
|
|
125
|
+
constructor(schema, fuzzyMatchThreshold = 0.7) {
|
|
126
|
+
this.schema = schema;
|
|
127
|
+
this.fuzzyMatchThreshold = fuzzyMatchThreshold;
|
|
128
|
+
this.fixes = [];
|
|
129
|
+
this.errors = [];
|
|
130
|
+
this.wasFixed = false;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Transform markdown text to JSON matching schema
|
|
134
|
+
*/
|
|
135
|
+
transformMarkdown(markdown) {
|
|
136
|
+
// Parse markdown to object
|
|
137
|
+
const sections = MarkdownParser.parseSections(markdown);
|
|
138
|
+
const parsed = MarkdownParser.sectionsToObject(sections);
|
|
139
|
+
// Transform to match schema
|
|
140
|
+
return this.transform(parsed);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Transform any input to match desired schema
|
|
144
|
+
*/
|
|
145
|
+
transform(input) {
|
|
146
|
+
this.fixes = [];
|
|
147
|
+
this.errors = [];
|
|
148
|
+
this.wasFixed = false;
|
|
149
|
+
try {
|
|
150
|
+
const result = this.transformValue(input, this.schema, 'root');
|
|
151
|
+
if (this.errors.length > 0) {
|
|
152
|
+
return {
|
|
153
|
+
status: 'failed',
|
|
154
|
+
result: null,
|
|
155
|
+
errors: this.errors,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
status: this.wasFixed ? 'fixed' : 'validated',
|
|
160
|
+
result,
|
|
161
|
+
fixes: this.wasFixed ? this.fixes : undefined,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
this.errors.push(`Transformation failed: ${error}`);
|
|
166
|
+
return {
|
|
167
|
+
status: 'failed',
|
|
168
|
+
result: null,
|
|
169
|
+
errors: this.errors,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
transformValue(input, schema, path) {
|
|
174
|
+
switch (schema.type) {
|
|
175
|
+
case 'string':
|
|
176
|
+
return this.toString(input, path);
|
|
177
|
+
case 'number':
|
|
178
|
+
return this.toNumber(input, path);
|
|
179
|
+
case 'boolean':
|
|
180
|
+
return this.toBoolean(input, path);
|
|
181
|
+
case 'array':
|
|
182
|
+
return this.toArray(input, schema.items, path);
|
|
183
|
+
case 'object':
|
|
184
|
+
return this.toObject(input, schema.properties, path);
|
|
185
|
+
default:
|
|
186
|
+
throw new Error(`Unknown schema type: ${schema.type}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
toString(value, path) {
|
|
190
|
+
if (typeof value === 'string') {
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
this.wasFixed = true;
|
|
194
|
+
this.fixes.push(`${path}: Converted ${typeof value} to string`);
|
|
195
|
+
if (typeof value === 'object') {
|
|
196
|
+
return JSON.stringify(value);
|
|
197
|
+
}
|
|
198
|
+
return String(value);
|
|
199
|
+
}
|
|
200
|
+
toNumber(value, path) {
|
|
201
|
+
if (typeof value === 'number' && !isNaN(value)) {
|
|
202
|
+
return value;
|
|
203
|
+
}
|
|
204
|
+
this.wasFixed = true;
|
|
205
|
+
if (typeof value === 'string') {
|
|
206
|
+
const cleaned = value.replace(/,/g, '').trim();
|
|
207
|
+
const num = cleaned.includes('.') ? parseFloat(cleaned) : parseInt(cleaned, 10);
|
|
208
|
+
if (!isNaN(num)) {
|
|
209
|
+
this.fixes.push(`${path}: Parsed '${value}' to number`);
|
|
210
|
+
return num;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (typeof value === 'boolean') {
|
|
214
|
+
this.fixes.push(`${path}: Converted boolean to number`);
|
|
215
|
+
return value ? 1 : 0;
|
|
216
|
+
}
|
|
217
|
+
this.fixes.push(`${path}: Could not convert to number, using 0`);
|
|
218
|
+
return 0;
|
|
219
|
+
}
|
|
220
|
+
toBoolean(value, path) {
|
|
221
|
+
if (typeof value === 'boolean') {
|
|
222
|
+
return value;
|
|
223
|
+
}
|
|
224
|
+
this.wasFixed = true;
|
|
225
|
+
if (typeof value === 'string') {
|
|
226
|
+
const lower = value.toLowerCase().trim();
|
|
227
|
+
const result = ['true', '1', 'yes', 'y', 'on'].includes(lower);
|
|
228
|
+
this.fixes.push(`${path}: Parsed '${value}' to boolean`);
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
this.fixes.push(`${path}: Converted ${typeof value} to boolean`);
|
|
232
|
+
return Boolean(value);
|
|
233
|
+
}
|
|
234
|
+
toArray(value, itemSchema, path) {
|
|
235
|
+
if (Array.isArray(value)) {
|
|
236
|
+
return value.map((item, i) => this.transformValue(item, itemSchema, `${path}[${i}]`));
|
|
237
|
+
}
|
|
238
|
+
this.wasFixed = true;
|
|
239
|
+
if (typeof value === 'string') {
|
|
240
|
+
this.fixes.push(`${path}: Wrapped string in array`);
|
|
241
|
+
return [this.transformValue(value, itemSchema, `${path}[0]`)];
|
|
242
|
+
}
|
|
243
|
+
this.fixes.push(`${path}: Wrapped ${typeof value} in array`);
|
|
244
|
+
return [this.transformValue(value, itemSchema, `${path}[0]`)];
|
|
245
|
+
}
|
|
246
|
+
toObject(value, properties, path) {
|
|
247
|
+
// If input is a string and schema has one string property
|
|
248
|
+
if (typeof value === 'string' && Object.keys(properties).length === 1) {
|
|
249
|
+
const [propName, propSchema] = Object.entries(properties)[0];
|
|
250
|
+
if (propSchema.type === 'string') {
|
|
251
|
+
this.wasFixed = true;
|
|
252
|
+
this.fixes.push(`${path}: Wrapped string in object property '${propName}'`);
|
|
253
|
+
return { [propName]: value };
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// If input is not an object
|
|
257
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
258
|
+
this.wasFixed = true;
|
|
259
|
+
this.fixes.push(`${path}: Converted ${typeof value} to object`);
|
|
260
|
+
value = {};
|
|
261
|
+
}
|
|
262
|
+
const result = {};
|
|
263
|
+
const usedKeys = new Set();
|
|
264
|
+
// Process each property in schema
|
|
265
|
+
for (const [propName, propSchema] of Object.entries(properties)) {
|
|
266
|
+
const matchedKey = this.findMatchingKey(propName, Object.keys(value));
|
|
267
|
+
if (matchedKey) {
|
|
268
|
+
if (matchedKey !== propName) {
|
|
269
|
+
this.wasFixed = true;
|
|
270
|
+
this.fixes.push(`${path}: Mapped key '${matchedKey}' -> '${propName}'`);
|
|
271
|
+
}
|
|
272
|
+
result[propName] = this.transformValue(value[matchedKey], propSchema, `${path}.${propName}`);
|
|
273
|
+
usedKeys.add(matchedKey);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
// Check if it's a nested object that needs values from parent
|
|
277
|
+
if (propSchema.type === 'object') {
|
|
278
|
+
const nestedResult = this.extractNestedProperties(value, propSchema.properties, usedKeys, `${path}.${propName}`);
|
|
279
|
+
result[propName] = nestedResult;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
// Property missing - use default
|
|
283
|
+
this.wasFixed = true;
|
|
284
|
+
this.fixes.push(`${path}: Added missing property '${propName}'`);
|
|
285
|
+
result[propName] = this.getDefaultValue(propSchema);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return result;
|
|
290
|
+
}
|
|
291
|
+
extractNestedProperties(value, nestedProps, usedKeys, path) {
|
|
292
|
+
const result = {};
|
|
293
|
+
let foundAny = false;
|
|
294
|
+
for (const [nestedProp, nestedSchema] of Object.entries(nestedProps)) {
|
|
295
|
+
const nestedKey = this.findMatchingKey(nestedProp, Object.keys(value));
|
|
296
|
+
if (nestedKey && !usedKeys.has(nestedKey)) {
|
|
297
|
+
result[nestedProp] = this.transformValue(value[nestedKey], nestedSchema, `${path}.${nestedProp}`);
|
|
298
|
+
usedKeys.add(nestedKey);
|
|
299
|
+
foundAny = true;
|
|
300
|
+
if (nestedKey !== nestedProp) {
|
|
301
|
+
this.wasFixed = true;
|
|
302
|
+
this.fixes.push(`${path}: Moved '${nestedKey}' into nested object as '${nestedProp}'`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
result[nestedProp] = this.getDefaultValue(nestedSchema);
|
|
307
|
+
if (!foundAny) {
|
|
308
|
+
this.wasFixed = true;
|
|
309
|
+
this.fixes.push(`${path}: Added missing property '${nestedProp}'`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
findMatchingKey(target, available) {
|
|
316
|
+
// Exact match
|
|
317
|
+
if (available.includes(target)) {
|
|
318
|
+
return target;
|
|
319
|
+
}
|
|
320
|
+
// Case-insensitive match
|
|
321
|
+
const lowerTarget = target.toLowerCase();
|
|
322
|
+
for (const key of available) {
|
|
323
|
+
if (key.toLowerCase() === lowerTarget) {
|
|
324
|
+
return key;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// Fuzzy match
|
|
328
|
+
const matches = available
|
|
329
|
+
.map(key => ({
|
|
330
|
+
key,
|
|
331
|
+
score: this.similarity(target.toLowerCase(), key.toLowerCase()),
|
|
332
|
+
}))
|
|
333
|
+
.filter(m => m.score >= this.fuzzyMatchThreshold)
|
|
334
|
+
.sort((a, b) => b.score - a.score);
|
|
335
|
+
return matches.length > 0 ? matches[0].key : null;
|
|
336
|
+
}
|
|
337
|
+
similarity(s1, s2) {
|
|
338
|
+
const longer = s1.length > s2.length ? s1 : s2;
|
|
339
|
+
const shorter = s1.length > s2.length ? s2 : s1;
|
|
340
|
+
if (longer.length === 0)
|
|
341
|
+
return 1.0;
|
|
342
|
+
const editDistance = this.levenshtein(s1, s2);
|
|
343
|
+
return (longer.length - editDistance) / longer.length;
|
|
344
|
+
}
|
|
345
|
+
levenshtein(s1, s2) {
|
|
346
|
+
const matrix = [];
|
|
347
|
+
for (let i = 0; i <= s2.length; i++) {
|
|
348
|
+
matrix[i] = [i];
|
|
349
|
+
}
|
|
350
|
+
for (let j = 0; j <= s1.length; j++) {
|
|
351
|
+
matrix[0][j] = j;
|
|
352
|
+
}
|
|
353
|
+
for (let i = 1; i <= s2.length; i++) {
|
|
354
|
+
for (let j = 1; j <= s1.length; j++) {
|
|
355
|
+
if (s2.charAt(i - 1) === s1.charAt(j - 1)) {
|
|
356
|
+
matrix[i][j] = matrix[i - 1][j - 1];
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j] + 1);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return matrix[s2.length][s1.length];
|
|
364
|
+
}
|
|
365
|
+
getDefaultValue(schema) {
|
|
366
|
+
switch (schema.type) {
|
|
367
|
+
case 'string':
|
|
368
|
+
return '';
|
|
369
|
+
case 'number':
|
|
370
|
+
return 0;
|
|
371
|
+
case 'boolean':
|
|
372
|
+
return false;
|
|
373
|
+
case 'array':
|
|
374
|
+
return [];
|
|
375
|
+
case 'object': {
|
|
376
|
+
const result = {};
|
|
377
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
378
|
+
result[key] = this.getDefaultValue(propSchema);
|
|
379
|
+
}
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
default:
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
exports.JSONTransformer = JSONTransformer;
|
|
388
|
+
function mergeTransformResults(...results) {
|
|
389
|
+
if (results.length === 0) {
|
|
390
|
+
return {
|
|
391
|
+
status: 'validated',
|
|
392
|
+
result: {},
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (results.length === 1) {
|
|
396
|
+
return results[0];
|
|
397
|
+
}
|
|
398
|
+
// Check if any results failed
|
|
399
|
+
const failedResults = results.filter(r => r.status === 'failed');
|
|
400
|
+
if (failedResults.length > 0) {
|
|
401
|
+
const allErrors = results.flatMap(r => r.errors || []);
|
|
402
|
+
return {
|
|
403
|
+
status: 'failed',
|
|
404
|
+
result: null,
|
|
405
|
+
errors: allErrors.length > 0 ? allErrors : undefined,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
// Merge successful results
|
|
409
|
+
const validResults = results.filter(r => r.result != null);
|
|
410
|
+
if (validResults.length === 0) {
|
|
411
|
+
return {
|
|
412
|
+
status: 'validated',
|
|
413
|
+
result: {},
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
const resultObjects = validResults.map(r => r.result);
|
|
417
|
+
const mergedResult = (0, nx_helpers_1.mergeMultiple)(...resultObjects);
|
|
418
|
+
// Collect all fixes
|
|
419
|
+
const allFixes = results.flatMap(r => r.fixes || []);
|
|
420
|
+
const status = allFixes.length > 0 ? 'fixed' : 'validated';
|
|
421
|
+
return {
|
|
422
|
+
status,
|
|
423
|
+
result: mergedResult,
|
|
424
|
+
fixes: allFixes.length > 0 ? allFixes : undefined,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
// ============================================================================
|
|
428
|
+
// Utility: JSON to Markdown Generation
|
|
429
|
+
// ============================================================================
|
|
430
|
+
/**
|
|
431
|
+
* Convert JSON data to markdown using nx-helpers anyToMarkdownString
|
|
432
|
+
* Useful for generating documentation or round-trip conversions
|
|
433
|
+
*/
|
|
434
|
+
function jsonToMarkdown(data, level) {
|
|
435
|
+
return (0, nx_helpers_1.anyToMarkdownString)(data, { level, fenceJsonFallback: true });
|
|
436
|
+
}
|
|
437
|
+
// ============================================================================
|
|
438
|
+
// Utility: Schema Loading from JSON Files
|
|
439
|
+
// ============================================================================
|
|
440
|
+
/**
|
|
441
|
+
* Load a schema definition from a JSON file
|
|
442
|
+
* Useful for storing complex schemas in separate files
|
|
443
|
+
*/
|
|
444
|
+
function loadSchemaFromFile(filePath) {
|
|
445
|
+
return (0, nx_helpers_1.loadJson)(filePath);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Create a JSONTransformer from a schema file
|
|
449
|
+
* Convenience function for loading schema and creating transformer in one step
|
|
450
|
+
*/
|
|
451
|
+
function createTransformerFromSchemaFile(schemaFilePath) {
|
|
452
|
+
const schema = loadSchemaFromFile(schemaFilePath);
|
|
453
|
+
return new JSONTransformer(schema);
|
|
454
|
+
}
|
|
455
|
+
//# sourceMappingURL=markdown-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-transformer.js","sourceRoot":"","sources":["../../../src/lib/markdown-transformer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4gBH,sDA8CC;AAUD,wCAEC;AAUD,gDAEC;AAMD,0EAGC;AAzlBD,2CAA6H;AAsB7H,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAElE,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,GAAe,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9C,MAAM,EAAE,GAAe,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9C,OAAO,EAAE,GAAe,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAChD,KAAK,EAAE,CAAC,KAAiB,EAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAA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