aiex-cli 0.1.1-beta.2 → 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 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-sZ01QiYJ.mjs";
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";
@@ -2874,7 +2874,7 @@ const PROPERTY_KEYS = new Set([
2874
2874
  "items",
2875
2875
  "required"
2876
2876
  ]);
2877
- const DRIZZLE_KEYS = new Set(["mode", "customType"]);
2877
+ const DRIZZLE_KEYS = new Set(["mode"]);
2878
2878
  const NESTED_KEYS = new Set(["enabled", "relation"]);
2879
2879
  const FOREIGN_KEY_KEYS = new Set(["table", "column"]);
2880
2880
  const TABLE_KEYS = new Set([
@@ -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.2";
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,
@@ -415,7 +415,6 @@ function getColumnChecks(prop, colName) {
415
415
  }
416
416
  function warnNonDrizzleBackedProperty(warnings, schemaPath, property) {
417
417
  if (property.pattern) warnings.push(`${schemaPath}.pattern is kept for extraction guidance but is not emitted as a SQLite constraint because SQLite has no portable REGEXP support.`);
418
- if (property.drizzle?.customType) warnings.push(`${schemaPath}.drizzle.customType is declared but not emitted. AIEX currently supports stable built-in Drizzle SQLite column types only.`);
419
418
  }
420
419
  function describeColumnType(columnType) {
421
420
  switch (columnType.class) {
@@ -541,6 +540,7 @@ function parseNestedObject(propName, property, parentTableName, warnings, mappin
541
540
  const columns = [];
542
541
  const checks = [];
543
542
  const relationType = property.nested?.relation === "has-many" ? "has-many" : "has-one";
543
+ const requiredFields = new Set(property.required ?? []);
544
544
  columns.push({
545
545
  name: "id",
546
546
  columnType: { class: "integer" },
@@ -591,7 +591,7 @@ function parseNestedObject(propName, property, parentTableName, warnings, mappin
591
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.`);
592
592
  continue;
593
593
  }
594
- const column = mapPropertyToColumn(childName, childProp, false);
594
+ const column = mapPropertyToColumn(childName, childProp, requiredFields.has(childName));
595
595
  columns.push(column);
596
596
  checks.push(...getColumnChecks(childProp, column.name));
597
597
  warnNonDrizzleBackedProperty(warnings, `$.properties.${propName}.properties.${childName}`, childProp);
@@ -660,10 +660,14 @@ const DrizzleModeSchema = z.enum([
660
660
  "boolean",
661
661
  "bigint"
662
662
  ]);
663
- const DrizzleExtensionSchema = z.object({
664
- mode: DrizzleModeSchema.optional(),
665
- customType: z.string().optional()
666
- }).optional();
663
+ const FormatSchema = z.enum([
664
+ "date-time",
665
+ "email",
666
+ "uri",
667
+ "json"
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");
670
+ const DrizzleExtensionSchema = z.object({ mode: DrizzleModeSchema.optional() }).strict().optional();
667
671
  const NestedConfigSchema = z.object({
668
672
  enabled: z.literal(true),
669
673
  relation: z.enum(["has-one", "has-many"])
@@ -683,7 +687,7 @@ const JsonSchemaPropertySchema = z.lazy(() => z.object({
683
687
  "array",
684
688
  "null"
685
689
  ]),
686
- format: z.string().optional(),
690
+ format: FormatSchema.optional(),
687
691
  pattern: z.string().optional(),
688
692
  enum: z.array(z.union([z.string(), z.number()])).optional(),
689
693
  primary: z.boolean().optional(),
@@ -699,7 +703,7 @@ const JsonSchemaPropertySchema = z.lazy(() => z.object({
699
703
  drizzle: DrizzleExtensionSchema,
700
704
  nested: NestedConfigSchema.optional(),
701
705
  foreignKey: ForeignKeyRefSchema.optional(),
702
- properties: z.record(z.string(), JsonSchemaPropertySchema).optional(),
706
+ properties: z.record(PropertyNameSchema, JsonSchemaPropertySchema).optional(),
703
707
  items: JsonSchemaPropertySchema.optional(),
704
708
  required: z.array(z.string()).optional()
705
709
  }));
@@ -718,7 +722,7 @@ const JsonSchemaDefinitionSchema = z.object({
718
722
  description: z.string().optional(),
719
723
  type: z.literal("object"),
720
724
  table: TableConfigSchema,
721
- properties: z.record(z.string(), JsonSchemaPropertySchema),
725
+ properties: z.record(PropertyNameSchema, JsonSchemaPropertySchema),
722
726
  required: z.array(z.string()).optional(),
723
727
  examples: z.array(ExamplePairSchema).optional()
724
728
  }).refine((schema) => Object.keys(schema.properties).length >= 1, {
package/dist/index.d.mts CHANGED
@@ -264,7 +264,7 @@ interface ForeignKeyRef {
264
264
  interface JsonSchemaProperty {
265
265
  description?: string;
266
266
  type: 'string' | 'integer' | 'number' | 'boolean' | 'object' | 'array' | 'null';
267
- format?: string;
267
+ format?: 'date-time' | 'email' | 'uri' | 'json';
268
268
  pattern?: string;
269
269
  enum?: (string | number)[];
270
270
  primary?: boolean;
@@ -279,7 +279,6 @@ interface JsonSchemaProperty {
279
279
  xPrompt?: string;
280
280
  drizzle?: {
281
281
  mode?: 'json' | 'timestamp' | 'timestamp_ms' | 'boolean' | 'bigint';
282
- customType?: string;
283
282
  };
284
283
  nested?: {
285
284
  enabled: true;
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-sZ01QiYJ.mjs";
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 };
@@ -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 are camelCase property names."
86
+ "description": "Column definitions. Keys must start with a letter and contain only letters, digits, or underscores."
83
87
  },
84
88
 
85
89
  "property": {
@@ -206,10 +210,6 @@
206
210
  "type": "string",
207
211
  "enum": ["json", "timestamp", "timestamp_ms", "boolean", "bigint"],
208
212
  "description": "Override Drizzle column mode. 'json' stores as TEXT(json), 'timestamp'/'timestamp_ms' as INTEGER, 'boolean' as INTEGER(boolean), 'bigint' as INTEGER(bigint)."
209
- },
210
- "customType": {
211
- "type": "string",
212
- "description": "Custom Drizzle type name. Accepted by the schema shape but not emitted by AIEX; generation reports a warning."
213
213
  }
214
214
  }
215
215
  },