@memberjunction/db-auto-doc 2.109.0
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 +244 -0
- package/bin/run.js +5 -0
- package/dist/ai/simple-ai-client.d.ts +70 -0
- package/dist/ai/simple-ai-client.d.ts.map +1 -0
- package/dist/ai/simple-ai-client.js +181 -0
- package/dist/ai/simple-ai-client.js.map +1 -0
- package/dist/analyzers/analyzer.d.ts +23 -0
- package/dist/analyzers/analyzer.d.ts.map +1 -0
- package/dist/analyzers/analyzer.js +127 -0
- package/dist/analyzers/analyzer.js.map +1 -0
- package/dist/cli-old/cli.d.ts +3 -0
- package/dist/cli-old/cli.d.ts.map +1 -0
- package/dist/cli-old/cli.js +388 -0
- package/dist/cli-old/cli.js.map +1 -0
- package/dist/commands/analyze.d.ts +13 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +98 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/export.d.ts +13 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +117 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +163 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/reset.d.ts +10 -0
- package/dist/commands/reset.d.ts.map +1 -0
- package/dist/commands/reset.js +37 -0
- package/dist/commands/reset.js.map +1 -0
- package/dist/commands/review.d.ts +11 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +82 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/database/connection.d.ts +40 -0
- package/dist/database/connection.d.ts.map +1 -0
- package/dist/database/connection.js +136 -0
- package/dist/database/connection.js.map +1 -0
- package/dist/database/introspection.d.ts +59 -0
- package/dist/database/introspection.d.ts.map +1 -0
- package/dist/database/introspection.js +124 -0
- package/dist/database/introspection.js.map +1 -0
- package/dist/generators/markdown-generator.d.ts +8 -0
- package/dist/generators/markdown-generator.d.ts.map +1 -0
- package/dist/generators/markdown-generator.js +106 -0
- package/dist/generators/markdown-generator.js.map +1 -0
- package/dist/generators/sql-generator.d.ts +20 -0
- package/dist/generators/sql-generator.d.ts.map +1 -0
- package/dist/generators/sql-generator.js +83 -0
- package/dist/generators/sql-generator.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/state/state-manager.d.ts +95 -0
- package/dist/state/state-manager.d.ts.map +1 -0
- package/dist/state/state-manager.js +236 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/types/state-file.d.ts +124 -0
- package/dist/types/state-file.d.ts.map +1 -0
- package/dist/types/state-file.js +79 -0
- package/dist/types/state-file.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.StateManager = void 0;
|
|
27
|
+
const fs = __importStar(require("fs/promises"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const state_file_1 = require("../types/state-file");
|
|
30
|
+
/**
|
|
31
|
+
* State file manager - handles read/write/merge of db-doc-state.json
|
|
32
|
+
*/
|
|
33
|
+
class StateManager {
|
|
34
|
+
constructor(options = {}) {
|
|
35
|
+
this.stateFilePath = options.stateFilePath || path.join(process.cwd(), 'db-doc-state.json');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Load state file (or create if doesn't exist)
|
|
39
|
+
*/
|
|
40
|
+
async load(server, database) {
|
|
41
|
+
try {
|
|
42
|
+
const content = await fs.readFile(this.stateFilePath, 'utf-8');
|
|
43
|
+
this.state = JSON.parse(content);
|
|
44
|
+
return this.state;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
// File doesn't exist, create new
|
|
48
|
+
if (server && database) {
|
|
49
|
+
this.state = (0, state_file_1.createEmptyStateFile)(server, database);
|
|
50
|
+
await this.save();
|
|
51
|
+
return this.state;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`State file not found at ${this.stateFilePath} and no server/database provided`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Save state file
|
|
58
|
+
*/
|
|
59
|
+
async save() {
|
|
60
|
+
if (!this.state) {
|
|
61
|
+
throw new Error('No state to save');
|
|
62
|
+
}
|
|
63
|
+
this.state.lastModified = new Date().toISOString();
|
|
64
|
+
const content = JSON.stringify(this.state, null, 2);
|
|
65
|
+
await fs.writeFile(this.stateFilePath, content, 'utf-8');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get current state
|
|
69
|
+
*/
|
|
70
|
+
getState() {
|
|
71
|
+
if (!this.state) {
|
|
72
|
+
throw new Error('State not loaded');
|
|
73
|
+
}
|
|
74
|
+
return this.state;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Update table with AI-generated documentation
|
|
78
|
+
*/
|
|
79
|
+
updateTableAI(schemaName, tableName, aiDoc) {
|
|
80
|
+
if (!this.state)
|
|
81
|
+
throw new Error('State not loaded');
|
|
82
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
83
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
84
|
+
table.aiGenerated = {
|
|
85
|
+
description: aiDoc.description,
|
|
86
|
+
purpose: aiDoc.purpose,
|
|
87
|
+
usageNotes: aiDoc.usageNotes,
|
|
88
|
+
businessDomain: aiDoc.businessDomain,
|
|
89
|
+
confidence: aiDoc.confidence,
|
|
90
|
+
generatedAt: new Date().toISOString(),
|
|
91
|
+
model: aiDoc.model,
|
|
92
|
+
tokensUsed: aiDoc.tokensUsed,
|
|
93
|
+
relationships: aiDoc.relationships,
|
|
94
|
+
};
|
|
95
|
+
table.lastModified = new Date().toISOString();
|
|
96
|
+
// Update final description
|
|
97
|
+
table.finalDescription = (0, state_file_1.mergeFinalDescription)(table.userDescription, table.userNotes, table.aiGenerated.description);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Update column with AI-generated documentation
|
|
101
|
+
*/
|
|
102
|
+
updateColumnAI(schemaName, tableName, columnName, aiDoc) {
|
|
103
|
+
if (!this.state)
|
|
104
|
+
throw new Error('State not loaded');
|
|
105
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
106
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
107
|
+
const column = (0, state_file_1.getOrCreateColumn)(table, columnName);
|
|
108
|
+
column.aiGenerated = {
|
|
109
|
+
description: aiDoc.description,
|
|
110
|
+
purpose: aiDoc.purpose,
|
|
111
|
+
validValues: aiDoc.validValues,
|
|
112
|
+
usageNotes: aiDoc.usageNotes,
|
|
113
|
+
confidence: aiDoc.confidence,
|
|
114
|
+
generatedAt: new Date().toISOString(),
|
|
115
|
+
model: aiDoc.model,
|
|
116
|
+
};
|
|
117
|
+
column.lastModified = new Date().toISOString();
|
|
118
|
+
// Update final description
|
|
119
|
+
column.finalDescription = (0, state_file_1.mergeFinalDescription)(column.userDescription, column.userNotes, column.aiGenerated.description);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Mark table as user approved
|
|
123
|
+
*/
|
|
124
|
+
approveTable(schemaName, tableName) {
|
|
125
|
+
if (!this.state)
|
|
126
|
+
throw new Error('State not loaded');
|
|
127
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
128
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
129
|
+
table.userApproved = true;
|
|
130
|
+
table.lastModified = new Date().toISOString();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Mark column as user approved
|
|
134
|
+
*/
|
|
135
|
+
approveColumn(schemaName, tableName, columnName) {
|
|
136
|
+
if (!this.state)
|
|
137
|
+
throw new Error('State not loaded');
|
|
138
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
139
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
140
|
+
const column = (0, state_file_1.getOrCreateColumn)(table, columnName);
|
|
141
|
+
column.userApproved = true;
|
|
142
|
+
column.lastModified = new Date().toISOString();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Add user notes to table
|
|
146
|
+
*/
|
|
147
|
+
addTableNotes(schemaName, tableName, notes) {
|
|
148
|
+
if (!this.state)
|
|
149
|
+
throw new Error('State not loaded');
|
|
150
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
151
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
152
|
+
table.userNotes = notes;
|
|
153
|
+
table.lastModified = new Date().toISOString();
|
|
154
|
+
// Update final description
|
|
155
|
+
table.finalDescription = (0, state_file_1.mergeFinalDescription)(table.userDescription, table.userNotes, table.aiGenerated?.description);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Add user notes to column
|
|
159
|
+
*/
|
|
160
|
+
addColumnNotes(schemaName, tableName, columnName, notes) {
|
|
161
|
+
if (!this.state)
|
|
162
|
+
throw new Error('State not loaded');
|
|
163
|
+
const schema = (0, state_file_1.getOrCreateSchema)(this.state, schemaName);
|
|
164
|
+
const table = (0, state_file_1.getOrCreateTable)(schema, tableName);
|
|
165
|
+
const column = (0, state_file_1.getOrCreateColumn)(table, columnName);
|
|
166
|
+
column.userNotes = notes;
|
|
167
|
+
column.lastModified = new Date().toISOString();
|
|
168
|
+
// Update final description
|
|
169
|
+
column.finalDescription = (0, state_file_1.mergeFinalDescription)(column.userDescription, column.userNotes, column.aiGenerated?.description);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Add run history entry
|
|
173
|
+
*/
|
|
174
|
+
addRunHistory(entry) {
|
|
175
|
+
if (!this.state)
|
|
176
|
+
throw new Error('State not loaded');
|
|
177
|
+
this.state.runHistory.push(entry);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get tables that need processing (no AI generation yet)
|
|
181
|
+
*/
|
|
182
|
+
getTablesNeedingProcessing(schemaName) {
|
|
183
|
+
if (!this.state)
|
|
184
|
+
throw new Error('State not loaded');
|
|
185
|
+
const tables = [];
|
|
186
|
+
for (const [schema, schemaState] of Object.entries(this.state.schemas)) {
|
|
187
|
+
if (schemaName && schema !== schemaName)
|
|
188
|
+
continue;
|
|
189
|
+
for (const [table, tableState] of Object.entries(schemaState.tables)) {
|
|
190
|
+
if (!tableState.aiGenerated) {
|
|
191
|
+
tables.push({ schema, table });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return tables;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get unapproved tables
|
|
199
|
+
*/
|
|
200
|
+
getUnapprovedTables(schemaName) {
|
|
201
|
+
if (!this.state)
|
|
202
|
+
throw new Error('State not loaded');
|
|
203
|
+
const tables = [];
|
|
204
|
+
for (const [schema, schemaState] of Object.entries(this.state.schemas)) {
|
|
205
|
+
if (schemaName && schema !== schemaName)
|
|
206
|
+
continue;
|
|
207
|
+
for (const [table, tableState] of Object.entries(schemaState.tables)) {
|
|
208
|
+
if (tableState.aiGenerated && !tableState.userApproved) {
|
|
209
|
+
tables.push({ schema, table });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return tables;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Check if state file exists
|
|
217
|
+
*/
|
|
218
|
+
async exists() {
|
|
219
|
+
try {
|
|
220
|
+
await fs.access(this.stateFilePath);
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Reset state file
|
|
229
|
+
*/
|
|
230
|
+
async reset(server, database) {
|
|
231
|
+
this.state = (0, state_file_1.createEmptyStateFile)(server, database);
|
|
232
|
+
await this.save();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.StateManager = StateManager;
|
|
236
|
+
//# sourceMappingURL=state-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-manager.js","sourceRoot":"","sources":["../../src/state/state-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,2CAA6B;AAC7B,oDAW6B;AAM7B;;GAEG;AACH,MAAa,YAAY;IAIvB,YAAY,UAA+B,EAAE;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IA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M,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;CACF;AArRD,oCAqRC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State file type definitions for SQL Server Documentation Generator
|
|
3
|
+
* This file is persisted as db-doc-state.json and tracks all documentation state
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* AI-generated documentation with metadata
|
|
7
|
+
*/
|
|
8
|
+
export interface AIGenerated {
|
|
9
|
+
description: string;
|
|
10
|
+
confidence: number;
|
|
11
|
+
generatedAt: string;
|
|
12
|
+
model: string;
|
|
13
|
+
tokensUsed?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Column state in the documentation
|
|
17
|
+
*/
|
|
18
|
+
export interface ColumnState {
|
|
19
|
+
userNotes?: string;
|
|
20
|
+
userDescription?: string;
|
|
21
|
+
userApproved?: boolean;
|
|
22
|
+
aiGenerated?: AIGenerated & {
|
|
23
|
+
purpose?: string;
|
|
24
|
+
validValues?: string;
|
|
25
|
+
usageNotes?: string;
|
|
26
|
+
};
|
|
27
|
+
finalDescription?: string;
|
|
28
|
+
lastModified?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Table state in the documentation
|
|
32
|
+
*/
|
|
33
|
+
export interface TableState {
|
|
34
|
+
userNotes?: string;
|
|
35
|
+
userDescription?: string;
|
|
36
|
+
userApproved?: boolean;
|
|
37
|
+
userBusinessDomain?: string;
|
|
38
|
+
aiGenerated?: AIGenerated & {
|
|
39
|
+
purpose?: string;
|
|
40
|
+
usageNotes?: string;
|
|
41
|
+
businessDomain?: string;
|
|
42
|
+
relationships?: Array<{
|
|
43
|
+
type: 'parent' | 'child';
|
|
44
|
+
table: string;
|
|
45
|
+
description: string;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
finalDescription?: string;
|
|
49
|
+
columns: Record<string, ColumnState>;
|
|
50
|
+
lastModified?: string;
|
|
51
|
+
lastAnalyzed?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Schema state in the documentation
|
|
55
|
+
*/
|
|
56
|
+
export interface SchemaState {
|
|
57
|
+
description?: string;
|
|
58
|
+
businessDomain?: string;
|
|
59
|
+
userNotes?: string;
|
|
60
|
+
tables: Record<string, TableState>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Seed context provided by user
|
|
64
|
+
*/
|
|
65
|
+
export interface SeedContext {
|
|
66
|
+
overallPurpose?: string;
|
|
67
|
+
businessDomains?: string[];
|
|
68
|
+
customInstructions?: string;
|
|
69
|
+
industryContext?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Run history entry
|
|
73
|
+
*/
|
|
74
|
+
export interface RunHistoryEntry {
|
|
75
|
+
timestamp: string;
|
|
76
|
+
phase: 'analyze' | 'review' | 'export';
|
|
77
|
+
tablesProcessed?: number;
|
|
78
|
+
schemasProcessed?: number;
|
|
79
|
+
tokensUsed?: number;
|
|
80
|
+
cost?: number;
|
|
81
|
+
duration?: number;
|
|
82
|
+
errors?: string[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Database connection info (no credentials - those go in .env)
|
|
86
|
+
*/
|
|
87
|
+
export interface DatabaseInfo {
|
|
88
|
+
server: string;
|
|
89
|
+
database: string;
|
|
90
|
+
lastConnected?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Complete state file structure
|
|
94
|
+
*/
|
|
95
|
+
export interface StateFile {
|
|
96
|
+
version: string;
|
|
97
|
+
database: DatabaseInfo;
|
|
98
|
+
seedContext?: SeedContext;
|
|
99
|
+
schemas: Record<string, SchemaState>;
|
|
100
|
+
runHistory: RunHistoryEntry[];
|
|
101
|
+
createdAt: string;
|
|
102
|
+
lastModified: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Default empty state file
|
|
106
|
+
*/
|
|
107
|
+
export declare function createEmptyStateFile(server: string, database: string): StateFile;
|
|
108
|
+
/**
|
|
109
|
+
* Helper to get or create schema state
|
|
110
|
+
*/
|
|
111
|
+
export declare function getOrCreateSchema(state: StateFile, schemaName: string): SchemaState;
|
|
112
|
+
/**
|
|
113
|
+
* Helper to get or create table state
|
|
114
|
+
*/
|
|
115
|
+
export declare function getOrCreateTable(schema: SchemaState, tableName: string): TableState;
|
|
116
|
+
/**
|
|
117
|
+
* Helper to get or create column state
|
|
118
|
+
*/
|
|
119
|
+
export declare function getOrCreateColumn(table: TableState, columnName: string): ColumnState;
|
|
120
|
+
/**
|
|
121
|
+
* Merge AI-generated description with user input to create final description
|
|
122
|
+
*/
|
|
123
|
+
export declare function mergeFinalDescription(userDescription?: string, userNotes?: string, aiDescription?: string): string | undefined;
|
|
124
|
+
//# sourceMappingURL=state-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-file.d.ts","sourceRoot":"","sources":["../../src/types/state-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,WAAW,CAAC,EAAE,WAAW,GAAG;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAGF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW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|
+
/**
|
|
3
|
+
* State file type definitions for SQL Server Documentation Generator
|
|
4
|
+
* This file is persisted as db-doc-state.json and tracks all documentation state
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.mergeFinalDescription = exports.getOrCreateColumn = exports.getOrCreateTable = exports.getOrCreateSchema = exports.createEmptyStateFile = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Default empty state file
|
|
10
|
+
*/
|
|
11
|
+
function createEmptyStateFile(server, database) {
|
|
12
|
+
const now = new Date().toISOString();
|
|
13
|
+
return {
|
|
14
|
+
version: '1.0',
|
|
15
|
+
database: {
|
|
16
|
+
server,
|
|
17
|
+
database,
|
|
18
|
+
lastConnected: now,
|
|
19
|
+
},
|
|
20
|
+
schemas: {},
|
|
21
|
+
runHistory: [],
|
|
22
|
+
createdAt: now,
|
|
23
|
+
lastModified: now,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.createEmptyStateFile = createEmptyStateFile;
|
|
27
|
+
/**
|
|
28
|
+
* Helper to get or create schema state
|
|
29
|
+
*/
|
|
30
|
+
function getOrCreateSchema(state, schemaName) {
|
|
31
|
+
if (!state.schemas[schemaName]) {
|
|
32
|
+
state.schemas[schemaName] = {
|
|
33
|
+
tables: {},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return state.schemas[schemaName];
|
|
37
|
+
}
|
|
38
|
+
exports.getOrCreateSchema = getOrCreateSchema;
|
|
39
|
+
/**
|
|
40
|
+
* Helper to get or create table state
|
|
41
|
+
*/
|
|
42
|
+
function getOrCreateTable(schema, tableName) {
|
|
43
|
+
if (!schema.tables[tableName]) {
|
|
44
|
+
schema.tables[tableName] = {
|
|
45
|
+
columns: {},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return schema.tables[tableName];
|
|
49
|
+
}
|
|
50
|
+
exports.getOrCreateTable = getOrCreateTable;
|
|
51
|
+
/**
|
|
52
|
+
* Helper to get or create column state
|
|
53
|
+
*/
|
|
54
|
+
function getOrCreateColumn(table, columnName) {
|
|
55
|
+
if (!table.columns[columnName]) {
|
|
56
|
+
table.columns[columnName] = {};
|
|
57
|
+
}
|
|
58
|
+
return table.columns[columnName];
|
|
59
|
+
}
|
|
60
|
+
exports.getOrCreateColumn = getOrCreateColumn;
|
|
61
|
+
/**
|
|
62
|
+
* Merge AI-generated description with user input to create final description
|
|
63
|
+
*/
|
|
64
|
+
function mergeFinalDescription(userDescription, userNotes, aiDescription) {
|
|
65
|
+
// Priority: user description > AI description
|
|
66
|
+
if (userDescription) {
|
|
67
|
+
return userDescription;
|
|
68
|
+
}
|
|
69
|
+
if (aiDescription) {
|
|
70
|
+
// If user notes exist, prepend them
|
|
71
|
+
if (userNotes) {
|
|
72
|
+
return `${userNotes}. ${aiDescription}`;
|
|
73
|
+
}
|
|
74
|
+
return aiDescription;
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
exports.mergeFinalDescription = mergeFinalDescription;
|
|
79
|
+
//# sourceMappingURL=state-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-file.js","sourceRoot":"","sources":["../../src/types/state-file.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiIH;;GAEG;AACH,SAAgB,oBAAoB,CAAC,MAAc,EAAE,QAAgB;IACnE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE;YACR,MAAM;YACN,QAAQ;YACR,aAAa,EAAE,GAAG;SACnB;QACD,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,GAAG;QACd,YAAY,EAAE,GAAG;KAClB,CAAC;AACJ,CAAC;AAfD,oDAeC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAgB,EAAE,UAAkB;IACpE,IAAI,CAAC,KA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
2
|
+
"name": "@memberjunction/db-auto-doc",
|
|
3
|
+
"version": "2.109.0",
|
|
4
|
+
"description": "AI-powered SQL Server database documentation generator. Analyzes your database structure, uses AI to generate comprehensive descriptions, and saves them as extended properties. Works standalone - no MemberJunction runtime required.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"db-auto-doc": "bin/run.js"
|
|
9
|
+
},
|
|
10
|
+
"oclif": {
|
|
11
|
+
"bin": "db-auto-doc",
|
|
12
|
+
"commands": "./dist/commands",
|
|
13
|
+
"dirname": "db-auto-doc",
|
|
14
|
+
"topicSeparator": " ",
|
|
15
|
+
"plugins": [
|
|
16
|
+
"@oclif/plugin-help"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"/bin",
|
|
21
|
+
"/dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"start": "ts-node-dev src/cli/cli.ts",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"watch": "tsc --watch",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"sql-server",
|
|
32
|
+
"database",
|
|
33
|
+
"documentation",
|
|
34
|
+
"ai",
|
|
35
|
+
"metadata",
|
|
36
|
+
"extended-properties",
|
|
37
|
+
"database-documentation",
|
|
38
|
+
"sql-server-documentation",
|
|
39
|
+
"auto-documentation"
|
|
40
|
+
],
|
|
41
|
+
"author": "MemberJunction.com",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/inquirer": "^9.0.7",
|
|
45
|
+
"@types/mssql": "^9.1.1",
|
|
46
|
+
"@types/node": "^20.10.0",
|
|
47
|
+
"ts-node-dev": "^2.0.0",
|
|
48
|
+
"typescript": "^5.4.5"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@inquirer/prompts": "^5.0.6",
|
|
52
|
+
"@oclif/core": "^3.27.0",
|
|
53
|
+
"@oclif/plugin-help": "^6.2.33",
|
|
54
|
+
"chalk": "^4.1.2",
|
|
55
|
+
"commander": "^11.1.0",
|
|
56
|
+
"dotenv": "^16.3.1",
|
|
57
|
+
"inquirer": "^8.2.5",
|
|
58
|
+
"mssql": "^10.0.1",
|
|
59
|
+
"ora": "^5.4.1",
|
|
60
|
+
"zod": "^3.22.4"
|
|
61
|
+
}
|
|
62
|
+
}
|