aiex-cli 0.0.6 → 0.0.7-beta.2

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.
@@ -0,0 +1 @@
1
+ import{ft as e}from"./vue-i18n-Du42D0vb.js";var t={$schema:`http://json-schema.org/draft-07/schema#`,$id:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`,title:`aiex Table Schema`,description:`Defines a database table and its columns for aiex-cli schema-to-SQLite migration.`,type:`object`,required:[`title`,`type`,`table`,`properties`],additionalProperties:!1,properties:{$schema:{type:`string`,description:`Pointer to this schema file for IDE validation.`,format:`uri`,default:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`},title:{type:`string`,minLength:1,description:`Human-readable table title (e.g. 'User', 'OrderItem').`},description:{type:`string`,description:`Optional table description.`},type:{type:`string`,const:`object`,description:`Must be 'object' — each file defines one table.`},table:{$ref:`#/$defs/tableConfig`,description:`Table-level configuration.`},properties:{$ref:`#/$defs/properties`,description:`Column definitions keyed by property name (camelCase).`},required:{type:`array`,items:{type:`string`},description:`List of property names that are NOT NULL.`,default:[]}},$defs:{tableConfig:{type:`object`,required:[`name`],additionalProperties:!1,properties:{name:{type:`string`,minLength:1,pattern:`^[a-z][a-z0-9_]*$`,description:`SQLite table name in snake_case (lowercase letters, digits, underscores).`,examples:[`users`,`order_items`,`blog_posts`]},timestamps:{type:`boolean`,default:!1,description:`Automatically add created_at and updated_at TIMESTAMP columns.`},softDelete:{type:`boolean`,default:!1,description:`Automatically add deleted_at nullable TIMESTAMP column.`}}},properties:{type:`object`,minProperties:1,additionalProperties:{$ref:`#/$defs/property`},description:`Column definitions. Keys are camelCase property names.`},property:{type:`object`,required:[`type`],additionalProperties:!1,properties:{description:{type:`string`,description:`Description of the column.`},type:{$ref:`#/$defs/columnType`,description:`Column data type.`},format:{$ref:`#/$defs/formatType`,description:`Semantic format hint that influences the SQLite column type.`},primary:{type:`boolean`,default:!1,description:`Mark this column as PRIMARY KEY. Only one per table.`},autoIncrement:{type:`boolean`,default:!1,description:`AUTO_INCREMENT for integer primary keys.`},unique:{type:`boolean`,default:!1,description:`Add UNIQUE constraint.`},default:{description:`Default value for the column. Type should match the column type.`},pattern:{type:`string`,description:`Regular expression constraint for string values.`},enum:{type:`array`,items:{type:`string`},description:`Enumeration of allowed values for this field.`},examples:{type:`array`,description:`Example values for this field (injected into AI prompt).`,items:{}},xPrompt:{type:`string`,description:`Custom extraction instruction for this field, overrides the default AI prompt (prefixed with 'x-' to stay valid JSON Schema).`},minLength:{type:`integer`,minimum:0,description:`Minimum string length (validation only, not a DB constraint).`},maxLength:{type:`integer`,minimum:1,description:`Maximum string length (validation only, not a DB constraint).`},minimum:{type:`number`,description:`Minimum numeric value (validation only, not a DB constraint).`},maximum:{type:`number`,description:`Maximum numeric value (validation only, not a DB constraint).`},drizzle:{$ref:`#/$defs/drizzleConfig`,description:`Drizzle ORM specific overrides.`},nested:{$ref:`#/$defs/nestedConfig`,description:`Create a separate related table instead of embedding as JSON.`},foreignKey:{$ref:`#/$defs/foreignKeyRef`,description:`Foreign key reference to another table.`},properties:{$ref:`#/$defs/properties`,description:`Sub-properties when type is 'object'. Ignored unless nested.enabled or drizzle.mode='json'.`},items:{$ref:`#/$defs/property`,description:`Item schema when type is 'array'. Ignored unless items.nested.enabled.`},required:{type:`array`,items:{type:`string`},description:`Required sub-properties for nested objects.`}}},columnType:{type:`string`,enum:[`string`,`integer`,`number`,`boolean`,`object`,`array`,`null`],description:`Data type. Maps to SQLite as: string→TEXT, integer→INTEGER, number→REAL, boolean→INTEGER(boolean), object→TEXT(json), array→TEXT(json), null→TEXT.`},formatType:{type:`string`,enum:[`date-time`,`email`,`uri`,`json`],description:`Format hints: 'date-time' → INTEGER(timestamp), 'json' → TEXT(json), 'email'/'uri' → TEXT (no special mapping).`},drizzleConfig:{type:`object`,additionalProperties:!1,properties:{mode:{type:`string`,enum:[`json`,`timestamp`,`timestamp_ms`,`boolean`,`bigint`],description:`Override Drizzle column mode. 'json' stores as TEXT(json), 'timestamp'/'timestamp_ms' as INTEGER, 'boolean' as INTEGER(boolean), 'bigint' as INTEGER(bigint).`},customType:{type:`string`,description:`Custom Drizzle type name (reserved for future use).`}}},nestedConfig:{type:`object`,required:[`enabled`,`relation`],additionalProperties:!1,properties:{enabled:{type:`boolean`,const:!0,description:`Must be true to activate nested table creation.`},relation:{type:`string`,enum:[`has-one`,`has-many`],description:`'has-one' → one() relation, 'has-many' → many() relation. Only one level of nesting is supported.`}}},foreignKeyRef:{type:`object`,required:[`table`,`column`],additionalProperties:!1,properties:{table:{type:`string`,minLength:1,description:`Target table name (snake_case).`},column:{type:`string`,minLength:1,description:`Target column name in the referenced table.`}}}}},n=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(i(n,t))return n}function i(e,t){var a,o,s;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((o=e.length)===t.length)for(;o--&&i(e[o],t[o]););return o===-1}if(a===Set){if(e.size!==t.size)return!1;for(o of e)if(s=o,s&&typeof s==`object`&&(s=r(t,s),!s)||!t.has(s))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(o of e)if(s=o[0],s&&typeof s==`object`&&(s=r(t,s),!s)||!i(o[1],t.get(s)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return o===-1}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return o===-1}if(!a||typeof e==`object`){for(a in o=0,e)if(n.call(e,a)&&++o&&!n.call(t,a)||!(a in t)||!i(e[a],t[a]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}function a(t){let n=e(t);try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}}function o(e,t){return i(e,t)}export{o as n,t as r,a as t};
@@ -16,11 +16,11 @@
16
16
  if (dark) document.documentElement.classList.add("jscb-dark")
17
17
  })()
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index-D7eI2nAX.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-BL42R5MF.js"></script>
20
20
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-DWTEM3RW.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/chunk-DtRyYLXJ.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/vue-i18n-Du42D0vb.js">
23
- <link rel="modulepreload" crossorigin href="/assets/object-utils-C6FkG7fw.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/object-utils-CqCiBqJ4.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/api-client-b4ZBXpNH.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/dialog-CnZ7jH1l.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/dist-CElVIpns.js">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiex-cli",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.7-beta.2",
5
5
  "description": "JSON Schema → SQLite with AI-powered data extraction",
6
6
  "author": "OSpoon <zxin088@gmail.com>",
7
7
  "license": "MIT",
@@ -1,14 +1 @@
1
- export function sanitizeMigrationName(name?: string): string | undefined {
2
- if (!name)
3
- return undefined
4
-
5
- const slug = name
6
- .trim()
7
- .toLowerCase()
8
- .replace(/[^a-z0-9_\s-]/g, '_')
9
- .replace(/[\s-]+/g, '_')
10
- .replace(/_+/g, '_')
11
- .replace(/^_+|_+$/g, '')
12
-
13
- return slug || undefined
14
- }
1
+ export { sanitizeMigrationName } from '@/infrastructure/schema/migration-name'
@@ -1 +0,0 @@
1
- import{ft as e}from"./vue-i18n-Du42D0vb.js";var t={$schema:`http://json-schema.org/draft-07/schema#`,$id:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`,title:`aiex Table Schema`,description:`Defines a database table and its columns for aiex-cli schema-to-SQLite migration.`,type:`object`,required:[`title`,`type`,`table`,`properties`],additionalProperties:!1,properties:{$schema:{type:`string`,description:`Pointer to this schema file for IDE validation.`,format:`uri`,default:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`},title:{type:`string`,minLength:1,description:`Human-readable table title (e.g. 'User', 'OrderItem').`},description:{type:`string`,description:`Optional table description.`},type:{type:`string`,const:`object`,description:`Must be 'object' — each file defines one table.`},table:{$ref:`#/$defs/tableConfig`,description:`Table-level configuration.`},properties:{$ref:`#/$defs/properties`,description:`Column definitions keyed by property name (camelCase).`},required:{type:`array`,items:{type:`string`},description:`List of property names that are NOT NULL.`,default:[]}},$defs:{tableConfig:{type:`object`,required:[`name`],additionalProperties:!1,properties:{name:{type:`string`,minLength:1,pattern:`^[a-z][a-z0-9_]*$`,description:`SQLite table name in snake_case (lowercase letters, digits, underscores).`,examples:[`users`,`order_items`,`blog_posts`]},timestamps:{type:`boolean`,default:!1,description:`Automatically add created_at and updated_at TIMESTAMP columns.`},softDelete:{type:`boolean`,default:!1,description:`Automatically add deleted_at nullable TIMESTAMP column.`}}},properties:{type:`object`,minProperties:1,additionalProperties:{$ref:`#/$defs/property`},description:`Column definitions. Keys are camelCase property names.`},property:{type:`object`,required:[`type`],additionalProperties:!1,properties:{description:{type:`string`,description:`Description of the column.`},type:{$ref:`#/$defs/columnType`,description:`Column data type.`},format:{$ref:`#/$defs/formatType`,description:`Semantic format hint that influences the SQLite column type.`},primary:{type:`boolean`,default:!1,description:`Mark this column as PRIMARY KEY. Only one per table.`},autoIncrement:{type:`boolean`,default:!1,description:`AUTO_INCREMENT for integer primary keys.`},unique:{type:`boolean`,default:!1,description:`Add UNIQUE constraint.`},default:{description:`Default value for the column. Type should match the column type.`},minLength:{type:`integer`,minimum:0,description:`Minimum string length (validation only, not a DB constraint).`},maxLength:{type:`integer`,minimum:1,description:`Maximum string length (validation only, not a DB constraint).`},minimum:{type:`number`,description:`Minimum numeric value (validation only, not a DB constraint).`},maximum:{type:`number`,description:`Maximum numeric value (validation only, not a DB constraint).`},drizzle:{$ref:`#/$defs/drizzleConfig`,description:`Drizzle ORM specific overrides.`},nested:{$ref:`#/$defs/nestedConfig`,description:`Create a separate related table instead of embedding as JSON.`},foreignKey:{$ref:`#/$defs/foreignKeyRef`,description:`Foreign key reference to another table.`},properties:{$ref:`#/$defs/properties`,description:`Sub-properties when type is 'object'. Ignored unless nested.enabled or drizzle.mode='json'.`},items:{$ref:`#/$defs/property`,description:`Item schema when type is 'array'. Ignored unless items.nested.enabled.`},required:{type:`array`,items:{type:`string`},description:`Required sub-properties for nested objects.`}}},columnType:{type:`string`,enum:[`string`,`integer`,`number`,`boolean`,`object`,`array`,`null`],description:`Data type. Maps to SQLite as: string→TEXT, integer→INTEGER, number→REAL, boolean→INTEGER(boolean), object→TEXT(json), array→TEXT(json), null→TEXT.`},formatType:{type:`string`,enum:[`date-time`,`email`,`uri`,`json`],description:`Format hints: 'date-time' → INTEGER(timestamp), 'json' → TEXT(json), 'email'/'uri' → TEXT (no special mapping).`},drizzleConfig:{type:`object`,additionalProperties:!1,properties:{mode:{type:`string`,enum:[`json`,`timestamp`,`timestamp_ms`,`boolean`,`bigint`],description:`Override Drizzle column mode. 'json' stores as TEXT(json), 'timestamp'/'timestamp_ms' as INTEGER, 'boolean' as INTEGER(boolean), 'bigint' as INTEGER(bigint).`},customType:{type:`string`,description:`Custom Drizzle type name (reserved for future use).`}}},nestedConfig:{type:`object`,required:[`enabled`,`relation`],additionalProperties:!1,properties:{enabled:{type:`boolean`,const:!0,description:`Must be true to activate nested table creation.`},relation:{type:`string`,enum:[`has-one`,`has-many`],description:`'has-one' → one() relation, 'has-many' → many() relation. Only one level of nesting is supported.`}}},foreignKeyRef:{type:`object`,required:[`table`,`column`],additionalProperties:!1,properties:{table:{type:`string`,minLength:1,description:`Target table name (snake_case).`},column:{type:`string`,minLength:1,description:`Target column name in the referenced table.`}}}}},n=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(i(n,t))return n}function i(e,t){var a,o,s;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((o=e.length)===t.length)for(;o--&&i(e[o],t[o]););return o===-1}if(a===Set){if(e.size!==t.size)return!1;for(o of e)if(s=o,s&&typeof s==`object`&&(s=r(t,s),!s)||!t.has(s))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(o of e)if(s=o[0],s&&typeof s==`object`&&(s=r(t,s),!s)||!i(o[1],t.get(s)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return o===-1}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return o===-1}if(!a||typeof e==`object`){for(a in o=0,e)if(n.call(e,a)&&++o&&!n.call(t,a)||!(a in t)||!i(e[a],t[a]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}function a(t){let n=e(t);try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}}function o(e,t){return i(e,t)}export{o as n,t as r,a as t};