aiex-cli 0.0.2-beta.11 → 0.0.2-beta.13

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 { S as version, T as formatDoctorDiagnosticsJson, _ as createConfig, a as parseJsonSchema, b as name, c as getDefaultAIConfig, d as DEFAULT_MARKITDOWN_CONFIG, f as DEFAULT_MINERU_CONFIG, g as AIConfigSchema, h as PLACEHOLDER_TEXT, i as JsonSchemaDefinitionSchema, l as readAIConfig, m as PLACEHOLDER_SCHEMA, n as createMigrationConfig, o as toSnakeCase, p as DEFAULT_PROMPT_CONFIG, s as generateDrizzleSchema, t as collectDoctorDiagnostics, u as writeAIConfig, v as seedConfig, w as doctorDiagnosticsTableRows, x as package_default, y as description } from "./doctor-collector-BEyduuZS.mjs";
1
+ import { S as version, T as formatDoctorDiagnosticsJson, _ as createConfig, a as parseJsonSchema, b as name, c as getDefaultAIConfig, d as DEFAULT_MARKITDOWN_CONFIG, f as DEFAULT_MINERU_CONFIG, g as AIConfigSchema, h as PLACEHOLDER_TEXT, i as JsonSchemaDefinitionSchema, l as readAIConfig, m as PLACEHOLDER_SCHEMA, n as createMigrationConfig, o as toSnakeCase, p as DEFAULT_PROMPT_CONFIG, s as generateDrizzleSchema, t as collectDoctorDiagnostics, u as writeAIConfig, v as seedConfig, w as doctorDiagnosticsTableRows, x as package_default, y as description } from "./doctor-collector-CRWhyGN4.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import fs from "node:fs/promises";
4
4
  import os from "node:os";
@@ -14964,6 +14964,7 @@ function aiRoutes(config) {
14964
14964
  //#region src/server/routes/data.ts
14965
14965
  const FILE_REGEX = /\.json$/;
14966
14966
  const EXTRACTION_TIMESTAMP_RE = /-\d{4}-\d{2}-\d{2}T/;
14967
+ const INTERNAL_ROWID_COLUMN = "__aiex_rowid";
14967
14968
  const TIMESTAMP_CLEANUP = /(\d{2})-(\d{2})-(\d{2})/;
14968
14969
  const TIMESTAMP_TZ = /(\d{3})Z/;
14969
14970
  const tableParamSchema = z.object({ name: z.string().regex(/^[a-z][a-z0-9_]*$/) });
@@ -15129,23 +15130,23 @@ function dataRoutes(config) {
15129
15130
  const offset = (page - 1) * pageSize;
15130
15131
  const totalPages = Math.max(1, Math.ceil(total / pageSize));
15131
15132
  const result = await sql`
15132
- select *
15133
+ select rowid as ${sql.raw(INTERNAL_ROWID_COLUMN)}, *
15133
15134
  from ${sql.table(tableName)}
15134
15135
  ${searchCondition}
15135
15136
  ${orderBy}
15136
15137
  limit ${pageSize}
15137
15138
  offset ${offset}
15138
15139
  `.execute(db);
15139
- const primaryKey = columns.find((column) => column.pk);
15140
15140
  const actionsByRowId = await getRowExtractionActions(aiexDir, tableName);
15141
- const rowActions = primaryKey ? Object.fromEntries(result.rows.map((row, index) => {
15142
- const rowId = row[primaryKey.name];
15141
+ const rowActions = Object.fromEntries(result.rows.map((row, index) => {
15142
+ const rowId = row[INTERNAL_ROWID_COLUMN];
15143
15143
  const action = rowId === null || rowId === void 0 ? void 0 : actionsByRowId.get(String(rowId));
15144
15144
  return action ? [String(index), action] : null;
15145
- }).filter((entry) => !!entry)) : {};
15145
+ }).filter((entry) => !!entry));
15146
+ const rows = result.rows.map(({ [INTERNAL_ROWID_COLUMN]: _rowid, ...row }) => row);
15146
15147
  return c.json({
15147
15148
  columns,
15148
- rows: result.rows,
15149
+ rows,
15149
15150
  rowActions,
15150
15151
  total,
15151
15152
  page,
@@ -65,7 +65,7 @@ function doctorDiagnosticsTableRows(d) {
65
65
  //#endregion
66
66
  //#region package.json
67
67
  var name = "aiex-cli";
68
- var version = "0.0.2-beta.11";
68
+ var version = "0.0.2-beta.13";
69
69
  var description = "JSON Schema → SQLite with AI-powered data extraction";
70
70
  var package_default = {
71
71
  name,
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { C as buildDoctorDiagnostics, T as formatDoctorDiagnosticsJson, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics, w as doctorDiagnosticsTableRows } from "./doctor-collector-BEyduuZS.mjs";
1
+ import { C as buildDoctorDiagnostics, T as formatDoctorDiagnosticsJson, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics, w as doctorDiagnosticsTableRows } from "./doctor-collector-CRWhyGN4.mjs";
2
2
 
3
3
  export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };