aiex-cli 0.1.1-beta.3 → 0.1.1-beta.4
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/cli.mjs +1 -1
- package/dist/{generate-drizzle-schema-DbJcRtaQ.mjs → generate-drizzle-schema-BZ2FvHyR.mjs} +6 -4
- package/dist/index.mjs +1 -1
- package/dist/table-schema.json +5 -1
- package/dist/web/assets/JsonSchemaEditor-3RNZpMrN.js +570 -0
- package/dist/web/assets/index-BPjoJ1T3.css +2 -0
- package/dist/web/assets/{index-CivTtAYN.js → index-CaO28Qd9.js} +3 -3
- package/dist/web/assets/object-utils-DsuRi0p9.js +1 -0
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/JsonSchemaEditor-tjxtfHIF.js +0 -570
- package/dist/web/assets/index-BdQzcBMn.css +0 -2
- package/dist/web/assets/object-utils-BahkewF-.js +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as package_default, C as DEFAULT_PROMPT_CONFIG, D as seedConfig, E as createConfig, O as description, S as DEFAULT_MINERU_CONFIG, T as PLACEHOLDER_TEXT, _ as doctorDiagnosticsSeverityRows, a as recognizeImageText, b as DEFAULT_LITEPARSE_CONFIG, c as t, d as writeAIConfig, f as AIConfigSchema, h as toSnakeCase, j as version, k as name, l as getDefaultAIConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, o as shouldUseImageOcrFallback, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, s as initI18n, t as generateDrizzleSchema, u as readAIConfig, v as doctorDiagnosticsTableRows, w as PLACEHOLDER_SCHEMA, x as DEFAULT_MINERU_API_CONFIG, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-
|
|
1
|
+
import { A as package_default, C as DEFAULT_PROMPT_CONFIG, D as seedConfig, E as createConfig, O as description, S as DEFAULT_MINERU_CONFIG, T as PLACEHOLDER_TEXT, _ as doctorDiagnosticsSeverityRows, a as recognizeImageText, b as DEFAULT_LITEPARSE_CONFIG, c as t, d as writeAIConfig, f as AIConfigSchema, h as toSnakeCase, j as version, k as name, l as getDefaultAIConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, o as shouldUseImageOcrFallback, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, s as initI18n, t as generateDrizzleSchema, u as readAIConfig, v as doctorDiagnosticsTableRows, w as PLACEHOLDER_SCHEMA, x as DEFAULT_MINERU_API_CONFIG, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-BZ2FvHyR.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import os from "node:os";
|
|
@@ -11,7 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
13
|
var name = "aiex-cli";
|
|
14
|
-
var version = "0.1.1-beta.
|
|
14
|
+
var version = "0.1.1-beta.4";
|
|
15
15
|
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
16
16
|
var package_default = {
|
|
17
17
|
name,
|
|
@@ -540,6 +540,7 @@ function parseNestedObject(propName, property, parentTableName, warnings, mappin
|
|
|
540
540
|
const columns = [];
|
|
541
541
|
const checks = [];
|
|
542
542
|
const relationType = property.nested?.relation === "has-many" ? "has-many" : "has-one";
|
|
543
|
+
const requiredFields = new Set(property.required ?? []);
|
|
543
544
|
columns.push({
|
|
544
545
|
name: "id",
|
|
545
546
|
columnType: { class: "integer" },
|
|
@@ -590,7 +591,7 @@ function parseNestedObject(propName, property, parentTableName, warnings, mappin
|
|
|
590
591
|
warnings.push(`Nested property "${childName}" inside "${nestedTableName}" is skipped — only one level of nesting is supported. Remove nested.enabled or use drizzle.mode: 'json' instead.`);
|
|
591
592
|
continue;
|
|
592
593
|
}
|
|
593
|
-
const column = mapPropertyToColumn(childName, childProp,
|
|
594
|
+
const column = mapPropertyToColumn(childName, childProp, requiredFields.has(childName));
|
|
594
595
|
columns.push(column);
|
|
595
596
|
checks.push(...getColumnChecks(childProp, column.name));
|
|
596
597
|
warnNonDrizzleBackedProperty(warnings, `$.properties.${propName}.properties.${childName}`, childProp);
|
|
@@ -665,6 +666,7 @@ const FormatSchema = z.enum([
|
|
|
665
666
|
"uri",
|
|
666
667
|
"json"
|
|
667
668
|
]);
|
|
669
|
+
const PropertyNameSchema = z.string().regex(/^[a-z]\w*$/i, "Property name must start with a letter and contain only letters, digits, or underscores");
|
|
668
670
|
const DrizzleExtensionSchema = z.object({ mode: DrizzleModeSchema.optional() }).strict().optional();
|
|
669
671
|
const NestedConfigSchema = z.object({
|
|
670
672
|
enabled: z.literal(true),
|
|
@@ -701,7 +703,7 @@ const JsonSchemaPropertySchema = z.lazy(() => z.object({
|
|
|
701
703
|
drizzle: DrizzleExtensionSchema,
|
|
702
704
|
nested: NestedConfigSchema.optional(),
|
|
703
705
|
foreignKey: ForeignKeyRefSchema.optional(),
|
|
704
|
-
properties: z.record(
|
|
706
|
+
properties: z.record(PropertyNameSchema, JsonSchemaPropertySchema).optional(),
|
|
705
707
|
items: JsonSchemaPropertySchema.optional(),
|
|
706
708
|
required: z.array(z.string()).optional()
|
|
707
709
|
}));
|
|
@@ -720,7 +722,7 @@ const JsonSchemaDefinitionSchema = z.object({
|
|
|
720
722
|
description: z.string().optional(),
|
|
721
723
|
type: z.literal("object"),
|
|
722
724
|
table: TableConfigSchema,
|
|
723
|
-
properties: z.record(
|
|
725
|
+
properties: z.record(PropertyNameSchema, JsonSchemaPropertySchema),
|
|
724
726
|
required: z.array(z.string()).optional(),
|
|
725
727
|
examples: z.array(ExamplePairSchema).optional()
|
|
726
728
|
}).refine((schema) => Object.keys(schema.properties).length >= 1, {
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as doctorDiagnosticsSeverityRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as doctorDiagnosticsTableRows, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-
|
|
1
|
+
import { _ as doctorDiagnosticsSeverityRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as doctorDiagnosticsTableRows, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-BZ2FvHyR.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsSeverityRows, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
package/dist/table-schema.json
CHANGED
|
@@ -78,8 +78,12 @@
|
|
|
78
78
|
"properties": {
|
|
79
79
|
"type": "object",
|
|
80
80
|
"minProperties": 1,
|
|
81
|
+
"propertyNames": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$"
|
|
84
|
+
},
|
|
81
85
|
"additionalProperties": { "$ref": "#/$defs/property" },
|
|
82
|
-
"description": "Column definitions. Keys
|
|
86
|
+
"description": "Column definitions. Keys must start with a letter and contain only letters, digits, or underscores."
|
|
83
87
|
},
|
|
84
88
|
|
|
85
89
|
"property": {
|