aiex-cli 0.0.5-beta.2 → 0.0.5-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/README.md +11 -0
- package/dist/cli.mjs +385 -7
- package/dist/{doctor-collector-DZyLrpqA.mjs → doctor-collector-Cv7RArla.mjs} +21 -4
- package/dist/index.d.mts +91 -88
- package/dist/index.mjs +1 -1
- package/dist/web/assets/ExtractionViewer-BhhWrBs2.js +1 -0
- package/dist/web/assets/{index-Dlze68g1.js → index-CKV2X6sS.js} +2 -2
- package/dist/web/assets/index-Csdgio76.css +2 -0
- package/dist/web/index.html +2 -2
- package/dist/{zh-CN-Qcn0DHFh.mjs → zh-CN-CyL-61Ow.mjs} +7 -0
- package/package.json +1 -1
- package/dist/web/assets/ExtractionViewer-DqIrBGNK.js +0 -1
- package/dist/web/assets/index-CvY9TGny.css +0 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import Conf from "conf";
|
|
2
2
|
import { ZodError, z } from "zod";
|
|
3
|
+
import "@napi-rs/system-ocr";
|
|
3
4
|
|
|
4
|
-
//#region src/
|
|
5
|
+
//#region src/types/config.d.ts
|
|
6
|
+
interface AppConfig {
|
|
7
|
+
name?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
}
|
|
5
10
|
interface DoctorDiagnostics {
|
|
6
11
|
cli: {
|
|
7
12
|
name: string;
|
|
@@ -48,93 +53,6 @@ interface DoctorDiagnostics {
|
|
|
48
53
|
errors: string[];
|
|
49
54
|
};
|
|
50
55
|
}
|
|
51
|
-
declare function buildDoctorDiagnostics(input: {
|
|
52
|
-
pkg: {
|
|
53
|
-
name: string;
|
|
54
|
-
version: string;
|
|
55
|
-
};
|
|
56
|
-
executable: string;
|
|
57
|
-
node: string;
|
|
58
|
-
platform: string;
|
|
59
|
-
arch: string;
|
|
60
|
-
shell: string;
|
|
61
|
-
packageManager: string;
|
|
62
|
-
osType: string;
|
|
63
|
-
osRelease: string;
|
|
64
|
-
cwd: string;
|
|
65
|
-
imageOcr: DoctorDiagnostics['imageOcr'];
|
|
66
|
-
configPath: string;
|
|
67
|
-
configStoreKeys: string[];
|
|
68
|
-
project: DoctorDiagnostics['project'];
|
|
69
|
-
}): DoctorDiagnostics;
|
|
70
|
-
declare function formatDoctorDiagnosticsJson(d: DoctorDiagnostics): string;
|
|
71
|
-
declare function doctorDiagnosticsTableRows(d: DoctorDiagnostics): [string, string][];
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/config.d.ts
|
|
74
|
-
interface AppConfig {
|
|
75
|
-
name?: string;
|
|
76
|
-
version?: string;
|
|
77
|
-
}
|
|
78
|
-
declare function createConfig(): Conf<AppConfig>;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/core/doctor-collector.d.ts
|
|
81
|
-
interface CollectDoctorDiagnosticsOptions {
|
|
82
|
-
config?: ReturnType<typeof createConfig>;
|
|
83
|
-
}
|
|
84
|
-
declare function collectDoctorDiagnostics(options?: CollectDoctorDiagnosticsOptions): Promise<DoctorDiagnostics>;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/core/schema-sqlite/types.d.ts
|
|
87
|
-
interface ParsedColumn {
|
|
88
|
-
name: string;
|
|
89
|
-
drizzleType: string;
|
|
90
|
-
isPrimary: boolean;
|
|
91
|
-
isAutoIncrement: boolean;
|
|
92
|
-
isNullable: boolean;
|
|
93
|
-
isUnique: boolean;
|
|
94
|
-
defaultValue?: string;
|
|
95
|
-
isForeignKey?: boolean;
|
|
96
|
-
foreignKeyRef?: {
|
|
97
|
-
table: string;
|
|
98
|
-
column: string;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
interface ParsedTable {
|
|
102
|
-
name: string;
|
|
103
|
-
columns: ParsedColumn[];
|
|
104
|
-
}
|
|
105
|
-
interface ParsedRelation {
|
|
106
|
-
fromTable: string;
|
|
107
|
-
fromColumn: string;
|
|
108
|
-
toTable: string;
|
|
109
|
-
toColumn: string;
|
|
110
|
-
name: string;
|
|
111
|
-
}
|
|
112
|
-
interface ParsedReverseRelation {
|
|
113
|
-
type: 'has-one' | 'has-many';
|
|
114
|
-
fromTable: string;
|
|
115
|
-
toTable: string;
|
|
116
|
-
name: string;
|
|
117
|
-
}
|
|
118
|
-
interface ParseResult {
|
|
119
|
-
tables: ParsedTable[];
|
|
120
|
-
relations: ParsedRelation[];
|
|
121
|
-
reverseRelations: ParsedReverseRelation[];
|
|
122
|
-
warnings: string[];
|
|
123
|
-
}
|
|
124
|
-
interface MigrationConfig {
|
|
125
|
-
schemaPath: string;
|
|
126
|
-
drizzleSchemaPath: string;
|
|
127
|
-
migrationsPath: string;
|
|
128
|
-
databasePath: string;
|
|
129
|
-
drizzleConfigPath: string;
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/core/schema-sqlite/generator.d.ts
|
|
133
|
-
declare function generateDrizzleSchema(result: ParseResult): string;
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/core/schema-sqlite/migrator.d.ts
|
|
136
|
-
declare function createMigrationConfig(cwd: string): MigrationConfig;
|
|
137
|
-
declare function generateDrizzleConfig(): string;
|
|
138
56
|
//#endregion
|
|
139
57
|
//#region src/core/schema-sqlite/schemas.d.ts
|
|
140
58
|
|
|
@@ -328,6 +246,91 @@ interface JsonSchemaProperty {
|
|
|
328
246
|
}
|
|
329
247
|
type JsonSchemaDefinition = z.infer<typeof JsonSchemaDefinitionSchema>;
|
|
330
248
|
//#endregion
|
|
249
|
+
//#region src/types/database.d.ts
|
|
250
|
+
interface ParsedColumn {
|
|
251
|
+
name: string;
|
|
252
|
+
drizzleType: string;
|
|
253
|
+
isPrimary: boolean;
|
|
254
|
+
isAutoIncrement: boolean;
|
|
255
|
+
isNullable: boolean;
|
|
256
|
+
isUnique: boolean;
|
|
257
|
+
defaultValue?: string;
|
|
258
|
+
isForeignKey?: boolean;
|
|
259
|
+
foreignKeyRef?: {
|
|
260
|
+
table: string;
|
|
261
|
+
column: string;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
interface ParsedTable {
|
|
265
|
+
name: string;
|
|
266
|
+
columns: ParsedColumn[];
|
|
267
|
+
}
|
|
268
|
+
interface ParsedRelation {
|
|
269
|
+
fromTable: string;
|
|
270
|
+
fromColumn: string;
|
|
271
|
+
toTable: string;
|
|
272
|
+
toColumn: string;
|
|
273
|
+
name: string;
|
|
274
|
+
}
|
|
275
|
+
interface ParsedReverseRelation {
|
|
276
|
+
type: 'has-one' | 'has-many';
|
|
277
|
+
fromTable: string;
|
|
278
|
+
toTable: string;
|
|
279
|
+
name: string;
|
|
280
|
+
}
|
|
281
|
+
interface ParseResult {
|
|
282
|
+
tables: ParsedTable[];
|
|
283
|
+
relations: ParsedRelation[];
|
|
284
|
+
reverseRelations: ParsedReverseRelation[];
|
|
285
|
+
warnings: string[];
|
|
286
|
+
}
|
|
287
|
+
interface MigrationConfig {
|
|
288
|
+
schemaPath: string;
|
|
289
|
+
drizzleSchemaPath: string;
|
|
290
|
+
migrationsPath: string;
|
|
291
|
+
databasePath: string;
|
|
292
|
+
drizzleConfigPath: string;
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/core/doctor.d.ts
|
|
296
|
+
declare function buildDoctorDiagnostics(input: {
|
|
297
|
+
pkg: {
|
|
298
|
+
name: string;
|
|
299
|
+
version: string;
|
|
300
|
+
};
|
|
301
|
+
executable: string;
|
|
302
|
+
node: string;
|
|
303
|
+
platform: string;
|
|
304
|
+
arch: string;
|
|
305
|
+
shell: string;
|
|
306
|
+
packageManager: string;
|
|
307
|
+
osType: string;
|
|
308
|
+
osRelease: string;
|
|
309
|
+
cwd: string;
|
|
310
|
+
imageOcr: DoctorDiagnostics['imageOcr'];
|
|
311
|
+
configPath: string;
|
|
312
|
+
configStoreKeys: string[];
|
|
313
|
+
project: DoctorDiagnostics['project'];
|
|
314
|
+
}): DoctorDiagnostics;
|
|
315
|
+
declare function formatDoctorDiagnosticsJson(d: DoctorDiagnostics): string;
|
|
316
|
+
declare function doctorDiagnosticsTableRows(d: DoctorDiagnostics): [string, string][];
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/config.d.ts
|
|
319
|
+
declare function createConfig(): Conf<AppConfig>;
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/core/doctor-collector.d.ts
|
|
322
|
+
interface CollectDoctorDiagnosticsOptions {
|
|
323
|
+
config?: ReturnType<typeof createConfig>;
|
|
324
|
+
}
|
|
325
|
+
declare function collectDoctorDiagnostics(options?: CollectDoctorDiagnosticsOptions): Promise<DoctorDiagnostics>;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/core/schema-sqlite/generator.d.ts
|
|
328
|
+
declare function generateDrizzleSchema(result: ParseResult): string;
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/core/schema-sqlite/migrator.d.ts
|
|
331
|
+
declare function createMigrationConfig(cwd: string): MigrationConfig;
|
|
332
|
+
declare function generateDrizzleConfig(): string;
|
|
333
|
+
//#endregion
|
|
331
334
|
//#region src/core/schema-sqlite/parser.d.ts
|
|
332
335
|
declare function parseJsonSchema(schema: JsonSchemaDefinition): ParseResult;
|
|
333
336
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as doctorDiagnosticsTableRows, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, j as formatDoctorDiagnosticsJson, k as buildDoctorDiagnostics, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics } from "./doctor-collector-
|
|
1
|
+
import { A as doctorDiagnosticsTableRows, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, j as formatDoctorDiagnosticsJson, k as buildDoctorDiagnostics, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics } from "./doctor-collector-Cv7RArla.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,H as t,O as n,S as r,T as i,W as a,gt as o,ht as s,lt as c,n as l,r as u,tt as d,w as f,x as p,yt as m}from"./vue-i18n-Du42D0vb.js";import{_ as h,p as g,r as _}from"./api-client-b4ZBXpNH.js";var v={class:`flex h-full min-w-0 overflow-hidden`},y={key:0,class:`flex-1 flex flex-col items-center justify-center text-muted-foreground`},b={class:`text-sm`},x={key:1,class:`flex-1 flex items-center justify-center text-muted-foreground`},S={key:2,class:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden p-4`},C={class:`mb-4 flex shrink-0 flex-wrap items-center justify-between gap-2`},w={class:`m-0 text-lg font-semibold text-foreground`},T={class:`flex shrink-0 flex-wrap items-center justify-end gap-2`},E={class:`flex-1 min-h-0 overflow-auto`},D={class:`text-sm font-mono whitespace-pre-wrap text-foreground bg-secondary border border-border rounded-lg p-4`},O=e({__name:`ExtractionViewer`,props:{extractionName:{},record:{}},emits:[`notionSynced`],setup(e,{emit:O}){let k=e,A=O,{t:j}=l(),M=c(``),N=c(null),P=c(!1),F=c(!1),I=p(()=>k.record?.notionStatus===`synced`?j(`app.notionSynced`):k.record?.notionStatus===`failed`?j(`app.retryNotion`):j(`app.syncNotion`));async function L(){if(k.extractionName){P.value=!0,M.value=``,N.value=k.record?.evidenceSummary??null;try{let e=await _(k.extractionName);e.success&&e.content?(M.value=e.content,N.value=e.evidenceSummary??k.record?.evidenceSummary??null):h.error(e.error||j(`app.failedToLoadExtraction`))}catch{h.error(j(`app.failedToLoadExtraction`))}P.value=!1}}let R=p(()=>N.value?N.value.issueCount>0?`bg-yellow-500/10 text-yellow-700`:`bg-green-500/10 text-green-700`:`bg-secondary text-muted-foreground`);function z(){if(!k.extractionName||!M.value)return;let e=new Blob([M.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=k.extractionName,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}async function B(){if(k.extractionName){F.value=!0;try{let e=await g(k.extractionName);h.success(j(`app.notionSyncedToNotionDetail`,{count:e.notionPages?.length??0})),A(`notionSynced`)}catch(e){h.error(e instanceof Error?e.message:j(`app.notionSyncFailed`))}F.value=!1}}function V(e){return j(e===`synced`?`app.notionStatusSynced`:e===`failed`?`app.notionStatusFailed`:`app.notionStatusNotSynced`)}function H(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}return d(()=>k.extractionName,L),t(L),(t,c)=>(a(),i(`div`,v,[e.extractionName?P.value?(a(),i(`div`,x,m(t.$t(`app.loading`)),1)):(a(),i(`div`,S,[r(`div`,C,[r(`h2`,w,m(e.extractionName),1),r(`div`,T,[N.value?(a(),i(`span`,{key:0,class:o([`rounded px-2 py-1 text-xs font-medium`,R.value])},m(t.$t(`app.evidenceCoverage`))+` `+m(N.value.evidenceCount)+`/`+m(N.value.fieldCount)+` · `+m(t.$t(`app.evidenceIssues`))+` `+m(N.value.issueCount),3)):f(``,!0),e.record?(a(),i(`span`,{key:1,class:o([`rounded px-2 py-1 text-xs font-medium`,[e.record.notionStatus===`synced`?`bg-green-500/10 text-green-700`:e.record.notionStatus===`failed`?`bg-red-500/10 text-red-700`:`bg-secondary text-muted-foreground`]])},m(V(e.record.notionStatus)),3)):f(``,!0),n(s(u),{icon:`pi pi-refresh`,label:I.value,severity:`secondary`,size:`small`,loading:F.value,disabled:e.record?.notionStatus===`synced`,onClick:B},null,8,[`label`,`loading`,`disabled`]),n(s(u),{icon:`pi pi-download`,label:t.$t(`app.download`),severity:`secondary`,size:`small`,onClick:z},null,8,[`label`])])]),r(`div`,E,[r(`pre`,D,m(H(M.value)),1)])])):(a(),i(`div`,y,[c[0]||=r(`i`,{class:`pi pi-file text-4xl mb-3 opacity-50`},null,-1),r(`p`,b,m(t.$t(`app.selectExtraction`)),1)]))]))}});export{O as default};
|