@power-maverick/tool-erd-generator 0.0.7 → 0.0.8
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/MIGRATION_COMPLETE.md +181 -0
- package/README.md +118 -359
- package/index.html +18 -1
- package/package.json +12 -27
- package/tsconfig.json +20 -15
- package/{webview/vite.config.ts → vite.config.ts} +1 -1
- package/CONVERSION_SUMMARY.md +0 -288
- package/REFACTORING_COMPLETE.md +0 -352
- package/TYPESCRIPT_NOTES.md +0 -57
- package/dist/src/components/ERDGenerator.d.ts +0 -44
- package/dist/src/components/ERDGenerator.d.ts.map +0 -1
- package/dist/src/components/ERDGenerator.js +0 -232
- package/dist/src/components/ERDGenerator.js.map +0 -1
- package/dist/src/dvdtIntegration/integration.d.ts +0 -47
- package/dist/src/dvdtIntegration/integration.d.ts.map +0 -1
- package/dist/src/dvdtIntegration/integration.js +0 -223
- package/dist/src/dvdtIntegration/integration.js.map +0 -1
- package/dist/src/index.d.ts +0 -6
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -26
- package/dist/src/index.js.map +0 -1
- package/dist/src/models/interfaces.d.ts +0 -84
- package/dist/src/models/interfaces.d.ts.map +0 -1
- package/dist/src/models/interfaces.js +0 -3
- package/dist/src/models/interfaces.js.map +0 -1
- package/dist/src/models/platformApi.d.ts +0 -92
- package/dist/src/models/platformApi.d.ts.map +0 -1
- package/dist/src/models/platformApi.js +0 -213
- package/dist/src/models/platformApi.js.map +0 -1
- package/dist/src/utils/Constants.d.ts +0 -3
- package/dist/src/utils/Constants.d.ts.map +0 -1
- package/dist/src/utils/Constants.js +0 -6
- package/dist/src/utils/Constants.js.map +0 -1
- package/dist/src/utils/DataverseClient.d.ts +0 -53
- package/dist/src/utils/DataverseClient.d.ts.map +0 -1
- package/dist/src/utils/DataverseClient.js +0 -236
- package/dist/src/utils/DataverseClient.js.map +0 -1
- package/dist/webview/index.css +0 -1
- package/dist/webview/index.html +0 -13
- package/dist/webview/index.js +0 -49
- package/tsconfig.webview.json +0 -24
- package/ui/test.html +0 -326
- package/webview/App.tsx +0 -412
- package/webview/index.html +0 -12
- package/webview/main.tsx +0 -10
- package/webview/styles.css +0 -288
- package/webview/tsconfig.json +0 -35
- /package/{webview/tsconfig.node.json → tsconfig.node.json} +0 -0
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { DataverseSolution, ERDConfig } from '../models/interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* ERD Generator for Dataverse solutions
|
|
4
|
-
* Generates Entity Relationship Diagrams in various formats
|
|
5
|
-
*/
|
|
6
|
-
export declare class ERDGenerator {
|
|
7
|
-
private config;
|
|
8
|
-
constructor(config?: Partial<ERDConfig>);
|
|
9
|
-
/**
|
|
10
|
-
* Generate ERD from a Dataverse solution
|
|
11
|
-
* @param solution The Dataverse solution to generate ERD from
|
|
12
|
-
* @returns The generated ERD in the configured format
|
|
13
|
-
*/
|
|
14
|
-
generate(solution: DataverseSolution): string;
|
|
15
|
-
/**
|
|
16
|
-
* Generate ERD in Mermaid format
|
|
17
|
-
*/
|
|
18
|
-
private generateMermaid;
|
|
19
|
-
/**
|
|
20
|
-
* Generate ERD in PlantUML format
|
|
21
|
-
*/
|
|
22
|
-
private generatePlantUML;
|
|
23
|
-
/**
|
|
24
|
-
* Generate ERD in Graphviz DOT format
|
|
25
|
-
*/
|
|
26
|
-
private generateGraphviz;
|
|
27
|
-
/**
|
|
28
|
-
* Sanitize table names for diagram formats
|
|
29
|
-
*/
|
|
30
|
-
private sanitizeTableName;
|
|
31
|
-
/**
|
|
32
|
-
* Map Dataverse types to Mermaid types
|
|
33
|
-
*/
|
|
34
|
-
private mapToMermaidType;
|
|
35
|
-
/**
|
|
36
|
-
* Map relationship to Mermaid cardinality notation
|
|
37
|
-
*/
|
|
38
|
-
private mapMermaidRelationship;
|
|
39
|
-
/**
|
|
40
|
-
* Map relationship to PlantUML notation
|
|
41
|
-
*/
|
|
42
|
-
private mapPlantUMLRelationship;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=ERDGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ERDGenerator.d.ts","sourceRoot":"","sources":["../../../src/components/ERDGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE3F;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAY;gBAEd,MAAM,GAAE,OAAO,CAAC,SAAS,CAAM;IAS3C;;;;OAIG;IACI,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM;IAapD;;OAEG;IACH,OAAO,CAAC,eAAe;IAuDvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmDxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAa9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAYhC"}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERDGenerator = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* ERD Generator for Dataverse solutions
|
|
6
|
-
* Generates Entity Relationship Diagrams in various formats
|
|
7
|
-
*/
|
|
8
|
-
class ERDGenerator {
|
|
9
|
-
constructor(config = {}) {
|
|
10
|
-
this.config = {
|
|
11
|
-
format: config.format || 'mermaid',
|
|
12
|
-
includeAttributes: config.includeAttributes !== undefined ? config.includeAttributes : true,
|
|
13
|
-
includeRelationships: config.includeRelationships !== undefined ? config.includeRelationships : true,
|
|
14
|
-
maxAttributesPerTable: config.maxAttributesPerTable || 10,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generate ERD from a Dataverse solution
|
|
19
|
-
* @param solution The Dataverse solution to generate ERD from
|
|
20
|
-
* @returns The generated ERD in the configured format
|
|
21
|
-
*/
|
|
22
|
-
generate(solution) {
|
|
23
|
-
switch (this.config.format) {
|
|
24
|
-
case 'mermaid':
|
|
25
|
-
return this.generateMermaid(solution);
|
|
26
|
-
case 'plantuml':
|
|
27
|
-
return this.generatePlantUML(solution);
|
|
28
|
-
case 'graphviz':
|
|
29
|
-
return this.generateGraphviz(solution);
|
|
30
|
-
default:
|
|
31
|
-
throw new Error(`Unsupported format: ${this.config.format}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Generate ERD in Mermaid format
|
|
36
|
-
*/
|
|
37
|
-
generateMermaid(solution) {
|
|
38
|
-
const lines = [];
|
|
39
|
-
lines.push('erDiagram');
|
|
40
|
-
// Create a set of table names in the solution for quick lookup
|
|
41
|
-
const tablesInSolution = new Set(solution.tables.map(t => t.logicalName));
|
|
42
|
-
// Add tables
|
|
43
|
-
for (const table of solution.tables) {
|
|
44
|
-
const tableName = this.sanitizeTableName(table.logicalName);
|
|
45
|
-
if (this.config.includeAttributes && table.attributes.length > 0) {
|
|
46
|
-
lines.push(` ${tableName} {`);
|
|
47
|
-
const attributes = this.config.maxAttributesPerTable > 0
|
|
48
|
-
? table.attributes.slice(0, this.config.maxAttributesPerTable)
|
|
49
|
-
: table.attributes;
|
|
50
|
-
for (const attr of attributes) {
|
|
51
|
-
const type = this.mapToMermaidType(attr.type);
|
|
52
|
-
const attrName = this.sanitizeTableName(attr.logicalName);
|
|
53
|
-
const constraints = [];
|
|
54
|
-
if (attr.isPrimaryId && !table.isIntersect)
|
|
55
|
-
constraints.push('PK');
|
|
56
|
-
if (attr.isRequired && !attr.isPrimaryId)
|
|
57
|
-
constraints.push('NOT_NULL');
|
|
58
|
-
const constraintStr = constraints.length > 0 ? ` ${constraints.join('_')}` : '';
|
|
59
|
-
lines.push(` ${type} ${attrName}${constraintStr}`);
|
|
60
|
-
}
|
|
61
|
-
if (this.config.maxAttributesPerTable > 0 && table.attributes.length > this.config.maxAttributesPerTable) {
|
|
62
|
-
const remaining = table.attributes.length - this.config.maxAttributesPerTable;
|
|
63
|
-
lines.push(` string more_attributes "plus ${remaining} more"`);
|
|
64
|
-
}
|
|
65
|
-
lines.push(` }`);
|
|
66
|
-
}
|
|
67
|
-
else if (!this.config.includeAttributes) {
|
|
68
|
-
// Just declare the entity without attributes
|
|
69
|
-
lines.push(` ${tableName} {}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Add relationships - only include relationships where both tables are in the solution
|
|
73
|
-
if (this.config.includeRelationships) {
|
|
74
|
-
for (const table of solution.tables) {
|
|
75
|
-
for (const rel of table.relationships) {
|
|
76
|
-
// Only include relationship if the related table is also in this solution
|
|
77
|
-
if (tablesInSolution.has(rel.relatedTable)) {
|
|
78
|
-
const relationship = this.mapMermaidRelationship(rel);
|
|
79
|
-
lines.push(` ${this.sanitizeTableName(table.logicalName)} ${relationship} ${this.sanitizeTableName(rel.relatedTable)} : "${rel.schemaName}"`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return lines.join('\n');
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Generate ERD in PlantUML format
|
|
88
|
-
*/
|
|
89
|
-
generatePlantUML(solution) {
|
|
90
|
-
const lines = [];
|
|
91
|
-
lines.push('@startuml');
|
|
92
|
-
lines.push(`title ${solution.displayName} - Entity Relationship Diagram`);
|
|
93
|
-
lines.push('');
|
|
94
|
-
// Create a set of table names in the solution for quick lookup
|
|
95
|
-
const tablesInSolution = new Set(solution.tables.map(t => t.logicalName));
|
|
96
|
-
// Add tables
|
|
97
|
-
for (const table of solution.tables) {
|
|
98
|
-
lines.push(`entity "${table.displayName}" as ${this.sanitizeTableName(table.logicalName)} {`);
|
|
99
|
-
if (this.config.includeAttributes) {
|
|
100
|
-
const attributes = this.config.maxAttributesPerTable > 0
|
|
101
|
-
? table.attributes.slice(0, this.config.maxAttributesPerTable)
|
|
102
|
-
: table.attributes;
|
|
103
|
-
for (const attr of attributes) {
|
|
104
|
-
const pk = attr.isPrimaryId ? '* ' : ' ';
|
|
105
|
-
const required = attr.isRequired ? '{required}' : '';
|
|
106
|
-
lines.push(` ${pk}${attr.logicalName}: ${attr.type} ${required}`.trim());
|
|
107
|
-
}
|
|
108
|
-
if (this.config.maxAttributesPerTable > 0 && table.attributes.length > this.config.maxAttributesPerTable) {
|
|
109
|
-
lines.push(` .. ${table.attributes.length - this.config.maxAttributesPerTable} more attributes ..`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
lines.push('}');
|
|
113
|
-
lines.push('');
|
|
114
|
-
}
|
|
115
|
-
// Add relationships - only include relationships where both tables are in the solution
|
|
116
|
-
if (this.config.includeRelationships) {
|
|
117
|
-
for (const table of solution.tables) {
|
|
118
|
-
for (const rel of table.relationships) {
|
|
119
|
-
// Only include relationship if the related table is also in this solution
|
|
120
|
-
if (tablesInSolution.has(rel.relatedTable)) {
|
|
121
|
-
const relationship = this.mapPlantUMLRelationship(rel);
|
|
122
|
-
lines.push(`${this.sanitizeTableName(table.logicalName)} ${relationship} ${this.sanitizeTableName(rel.relatedTable)}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
lines.push('');
|
|
128
|
-
lines.push('@enduml');
|
|
129
|
-
return lines.join('\n');
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Generate ERD in Graphviz DOT format
|
|
133
|
-
*/
|
|
134
|
-
generateGraphviz(solution) {
|
|
135
|
-
const lines = [];
|
|
136
|
-
lines.push('digraph ERD {');
|
|
137
|
-
lines.push(' rankdir=LR;');
|
|
138
|
-
lines.push(' node [shape=record];');
|
|
139
|
-
lines.push('');
|
|
140
|
-
// Create a set of table names in the solution for quick lookup
|
|
141
|
-
const tablesInSolution = new Set(solution.tables.map(t => t.logicalName));
|
|
142
|
-
// Add tables
|
|
143
|
-
for (const table of solution.tables) {
|
|
144
|
-
const attributes = this.config.includeAttributes
|
|
145
|
-
? (this.config.maxAttributesPerTable > 0
|
|
146
|
-
? table.attributes.slice(0, this.config.maxAttributesPerTable)
|
|
147
|
-
: table.attributes)
|
|
148
|
-
: [];
|
|
149
|
-
let label = `${table.displayName}`;
|
|
150
|
-
if (this.config.includeAttributes && attributes.length > 0) {
|
|
151
|
-
const attrStrings = attributes.map(attr => {
|
|
152
|
-
const pk = attr.isPrimaryId ? '🔑 ' : '';
|
|
153
|
-
return `${pk}${attr.logicalName}: ${attr.type}`;
|
|
154
|
-
});
|
|
155
|
-
if (this.config.maxAttributesPerTable > 0 && table.attributes.length > this.config.maxAttributesPerTable) {
|
|
156
|
-
attrStrings.push(`... ${table.attributes.length - this.config.maxAttributesPerTable} more`);
|
|
157
|
-
}
|
|
158
|
-
label = `{${table.displayName}|${attrStrings.join('\\l')}\\l}`;
|
|
159
|
-
}
|
|
160
|
-
lines.push(` ${this.sanitizeTableName(table.logicalName)} [label="${label}"];`);
|
|
161
|
-
}
|
|
162
|
-
lines.push('');
|
|
163
|
-
// Add relationships - only include relationships where both tables are in the solution
|
|
164
|
-
if (this.config.includeRelationships) {
|
|
165
|
-
for (const table of solution.tables) {
|
|
166
|
-
for (const rel of table.relationships) {
|
|
167
|
-
// Only include relationship if the related table is also in this solution
|
|
168
|
-
if (tablesInSolution.has(rel.relatedTable)) {
|
|
169
|
-
const style = rel.type === 'ManyToMany' ? 'dir=both' : 'dir=forward';
|
|
170
|
-
lines.push(` ${this.sanitizeTableName(table.logicalName)} -> ${this.sanitizeTableName(rel.relatedTable)} [label="${rel.schemaName}", ${style}];`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
lines.push('}');
|
|
176
|
-
return lines.join('\n');
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Sanitize table names for diagram formats
|
|
180
|
-
*/
|
|
181
|
-
sanitizeTableName(name) {
|
|
182
|
-
return name.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Map Dataverse types to Mermaid types
|
|
186
|
-
*/
|
|
187
|
-
mapToMermaidType(type) {
|
|
188
|
-
const typeMap = {
|
|
189
|
-
'string': 'string',
|
|
190
|
-
'int': 'int',
|
|
191
|
-
'decimal': 'decimal',
|
|
192
|
-
'datetime': 'datetime',
|
|
193
|
-
'boolean': 'boolean',
|
|
194
|
-
'lookup': 'guid',
|
|
195
|
-
'picklist': 'int',
|
|
196
|
-
'money': 'decimal',
|
|
197
|
-
};
|
|
198
|
-
return typeMap[type.toLowerCase()] || 'string';
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Map relationship to Mermaid cardinality notation
|
|
202
|
-
*/
|
|
203
|
-
mapMermaidRelationship(rel) {
|
|
204
|
-
switch (rel.type) {
|
|
205
|
-
case 'OneToMany':
|
|
206
|
-
return '||--o{';
|
|
207
|
-
case 'ManyToOne':
|
|
208
|
-
return '}o--||';
|
|
209
|
-
case 'ManyToMany':
|
|
210
|
-
return '}o--o{';
|
|
211
|
-
default:
|
|
212
|
-
return '||--||';
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Map relationship to PlantUML notation
|
|
217
|
-
*/
|
|
218
|
-
mapPlantUMLRelationship(rel) {
|
|
219
|
-
switch (rel.type) {
|
|
220
|
-
case 'OneToMany':
|
|
221
|
-
return '||--o{';
|
|
222
|
-
case 'ManyToOne':
|
|
223
|
-
return '}o--||';
|
|
224
|
-
case 'ManyToMany':
|
|
225
|
-
return '}o--o{';
|
|
226
|
-
default:
|
|
227
|
-
return '||--||';
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
exports.ERDGenerator = ERDGenerator;
|
|
232
|
-
//# sourceMappingURL=ER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ode';
|
|
2
|
-
/**
|
|
3
|
-
* ERD Tool WebView Panel for Dataverse DevTools Integration
|
|
4
|
-
*
|
|
5
|
-
* This class provides a minimal integration point for DVDT.
|
|
6
|
-
* The webview handles all Dataverse API calls directly using the bundled JavaScript.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ERDToolPanel {
|
|
9
|
-
private environmentUrl;
|
|
10
|
-
private accessToken;
|
|
11
|
-
static currentPanel: ERDToolPanel | undefined;
|
|
12
|
-
private static readonly viewType;
|
|
13
|
-
private readonly _panel;
|
|
14
|
-
private readonly _extensionUri;
|
|
15
|
-
private _disposables;
|
|
16
|
-
/**
|
|
17
|
-
* Create or show the ERD tool panel
|
|
18
|
-
*
|
|
19
|
-
* @param extensionUri - The extension URI from DVDT's context
|
|
20
|
-
* @param environmentUrl - Dataverse environment URL
|
|
21
|
-
* @param accessToken - Dataverse access token
|
|
22
|
-
*/
|
|
23
|
-
static createOrShow(extensionUri: vscode.Uri, environmentUrl: string, accessToken: string): void;
|
|
24
|
-
private constructor();
|
|
25
|
-
private setCredentials;
|
|
26
|
-
private handleSaveFile;
|
|
27
|
-
private _update;
|
|
28
|
-
private _getHtmlForWebview;
|
|
29
|
-
dispose(): void;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Public function to show the ERD panel
|
|
33
|
-
* DVDT calls this function directly to open the ERD Generator.
|
|
34
|
-
*
|
|
35
|
-
* DVDT Integration Example:
|
|
36
|
-
*
|
|
37
|
-
* import { showERDPanel } from '@dvdt-tools/erd-generator';
|
|
38
|
-
*
|
|
39
|
-
* // In your DVDT code, call this when user wants to generate ERD
|
|
40
|
-
* showERDPanel(context.extensionUri, environmentUrl, accessToken);
|
|
41
|
-
*
|
|
42
|
-
* @param extensionUri - The extension URI from DVDT's context
|
|
43
|
-
* @param environmentUrl - Dataverse environment URL
|
|
44
|
-
* @param accessToken - Dataverse access token
|
|
45
|
-
*/
|
|
46
|
-
export declare function showERDPanel(extensionUri: vscode.Uri, environmentUrl: string, accessToken: string): void;
|
|
47
|
-
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/dvdtIntegration/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAGjC;;;;;GAKG;AACH,qBAAa,YAAY;IAqDjB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,WAAW;IArDvB,OAAc,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAElD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAa;IAC3C,OAAO,CAAC,YAAY,CAA2B;IAE/C;;;;;;OAMG;WACW,YAAY,CACtB,YAAY,EAAE,MAAM,CAAC,GAAG,EACxB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM;IAgCvB,OAAO;IAwCP,OAAO,CAAC,cAAc;YAWR,cAAc;IAiB5B,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,kBAAkB;IAqDnB,OAAO;CAYjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CACxB,YAAY,EAAE,MAAM,CAAC,GAAG,EACxB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,QAYtB"}
|
|
@@ -1,223 +0,0 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.ERDToolPanel = void 0;
|
|
46
|
-
exports.showERDPanel = showERDPanel;
|
|
47
|
-
const vscode = __importStar(require("vscode"));
|
|
48
|
-
const Constants_1 = require("../utils/Constants");
|
|
49
|
-
/**
|
|
50
|
-
* ERD Tool WebView Panel for Dataverse DevTools Integration
|
|
51
|
-
*
|
|
52
|
-
* This class provides a minimal integration point for DVDT.
|
|
53
|
-
* The webview handles all Dataverse API calls directly using the bundled JavaScript.
|
|
54
|
-
*/
|
|
55
|
-
class ERDToolPanel {
|
|
56
|
-
/**
|
|
57
|
-
* Create or show the ERD tool panel
|
|
58
|
-
*
|
|
59
|
-
* @param extensionUri - The extension URI from DVDT's context
|
|
60
|
-
* @param environmentUrl - Dataverse environment URL
|
|
61
|
-
* @param accessToken - Dataverse access token
|
|
62
|
-
*/
|
|
63
|
-
static createOrShow(extensionUri, environmentUrl, accessToken) {
|
|
64
|
-
const column = vscode.window.activeTextEditor
|
|
65
|
-
? vscode.window.activeTextEditor.viewColumn
|
|
66
|
-
: undefined;
|
|
67
|
-
// If we already have a panel, show it
|
|
68
|
-
if (ERDToolPanel.currentPanel) {
|
|
69
|
-
ERDToolPanel.currentPanel._panel.reveal(column);
|
|
70
|
-
// Update credentials
|
|
71
|
-
ERDToolPanel.currentPanel.setCredentials(environmentUrl, accessToken);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
// Create new panel
|
|
75
|
-
const panel = vscode.window.createWebviewPanel(ERDToolPanel.viewType, 'ERD Generator', column || vscode.ViewColumn.One, {
|
|
76
|
-
enableScripts: true,
|
|
77
|
-
retainContextWhenHidden: true,
|
|
78
|
-
localResourceRoots: [
|
|
79
|
-
vscode.Uri.joinPath(extensionUri, ...Constants_1.pathWebview),
|
|
80
|
-
vscode.Uri.joinPath(extensionUri, ...Constants_1.pathUi)
|
|
81
|
-
]
|
|
82
|
-
});
|
|
83
|
-
ERDToolPanel.currentPanel = new ERDToolPanel(panel, extensionUri, environmentUrl, accessToken);
|
|
84
|
-
}
|
|
85
|
-
constructor(panel, extensionUri, environmentUrl, accessToken) {
|
|
86
|
-
this.environmentUrl = environmentUrl;
|
|
87
|
-
this.accessToken = accessToken;
|
|
88
|
-
this._disposables = [];
|
|
89
|
-
this._panel = panel;
|
|
90
|
-
this._extensionUri = extensionUri;
|
|
91
|
-
// Set the webview's initial html content
|
|
92
|
-
this._update();
|
|
93
|
-
// Listen for when the panel is disposed
|
|
94
|
-
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
|
|
95
|
-
// Handle messages from the webview (only for file operations and clipboard)
|
|
96
|
-
this._panel.webview.onDidReceiveMessage((message) => __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
switch (message.command) {
|
|
98
|
-
case 'saveFile':
|
|
99
|
-
yield this.handleSaveFile(message.content, message.fileName);
|
|
100
|
-
break;
|
|
101
|
-
case 'copyToClipboard':
|
|
102
|
-
yield vscode.env.clipboard.writeText(message.content);
|
|
103
|
-
vscode.window.showInformationMessage('ERD copied to clipboard');
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}), null, this._disposables);
|
|
107
|
-
// Send credentials to webview after it loads
|
|
108
|
-
// Small delay to ensure webview is ready
|
|
109
|
-
setTimeout(() => {
|
|
110
|
-
this.setCredentials(this.environmentUrl, this.accessToken);
|
|
111
|
-
}, 100);
|
|
112
|
-
}
|
|
113
|
-
setCredentials(environmentUrl, accessToken) {
|
|
114
|
-
this.environmentUrl = environmentUrl;
|
|
115
|
-
this.accessToken = accessToken;
|
|
116
|
-
this._panel.webview.postMessage({
|
|
117
|
-
command: 'setCredentials',
|
|
118
|
-
environmentUrl: environmentUrl,
|
|
119
|
-
accessToken: accessToken
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
handleSaveFile(content, fileName) {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const uri = yield vscode.window.showSaveDialog({
|
|
125
|
-
defaultUri: vscode.Uri.file(fileName),
|
|
126
|
-
filters: {
|
|
127
|
-
'Mermaid': ['mmd'],
|
|
128
|
-
'PlantUML': ['puml'],
|
|
129
|
-
'Graphviz': ['dot'],
|
|
130
|
-
'All Files': ['*']
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
if (uri) {
|
|
134
|
-
yield vscode.workspace.fs.writeFile(uri, Buffer.from(content));
|
|
135
|
-
vscode.window.showInformationMessage(`ERD saved to ${uri.fsPath}`);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
_update() {
|
|
140
|
-
const webview = this._panel.webview;
|
|
141
|
-
this._panel.webview.html = this._getHtmlForWebview(webview);
|
|
142
|
-
}
|
|
143
|
-
_getHtmlForWebview(webview) {
|
|
144
|
-
// Get URIs for the bundled React files
|
|
145
|
-
const indexJsUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, ...Constants_1.pathWebview, 'index.js'));
|
|
146
|
-
const indexCssUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, ...Constants_1.pathWebview, 'index.css'));
|
|
147
|
-
// Load Mermaid from CDN for visualization
|
|
148
|
-
const mermaidScript = 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js';
|
|
149
|
-
// Create HTML content
|
|
150
|
-
const html = `<!DOCTYPE html>
|
|
151
|
-
<html lang="en">
|
|
152
|
-
<head>
|
|
153
|
-
<meta charset="UTF-8">
|
|
154
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
155
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; connect-src https:; style-src ${webview.cspSource} 'unsafe-inline'; script-src ${webview.cspSource} https://cdn.jsdelivr.net 'unsafe-eval'; img-src https: data:;">
|
|
156
|
-
<title>Dataverse ERD Generator</title>
|
|
157
|
-
<link rel="stylesheet" href="${indexCssUri}">
|
|
158
|
-
<script src="${mermaidScript}"></script>
|
|
159
|
-
<script>
|
|
160
|
-
if (typeof mermaid !== 'undefined') {
|
|
161
|
-
mermaid.initialize({
|
|
162
|
-
startOnLoad: false,
|
|
163
|
-
theme: 'dark',
|
|
164
|
-
themeVariables: {
|
|
165
|
-
primaryColor: '#0e639c',
|
|
166
|
-
primaryTextColor: '#fff',
|
|
167
|
-
primaryBorderColor: '#007acc',
|
|
168
|
-
lineColor: '#007acc',
|
|
169
|
-
secondaryColor: '#3a3d41',
|
|
170
|
-
tertiaryColor: '#1e1e1e'
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
</script>
|
|
175
|
-
</head>
|
|
176
|
-
<body>
|
|
177
|
-
<div id="root"></div>
|
|
178
|
-
<script src="${indexJsUri}"></script>
|
|
179
|
-
</body>
|
|
180
|
-
</html>`;
|
|
181
|
-
return html;
|
|
182
|
-
}
|
|
183
|
-
dispose() {
|
|
184
|
-
ERDToolPanel.currentPanel = undefined;
|
|
185
|
-
this._panel.dispose();
|
|
186
|
-
while (this._disposables.length) {
|
|
187
|
-
const x = this._disposables.pop();
|
|
188
|
-
if (x) {
|
|
189
|
-
x.dispose();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
exports.ERDToolPanel = ERDToolPanel;
|
|
195
|
-
ERDToolPanel.viewType = 'erdGenerator';
|
|
196
|
-
/**
|
|
197
|
-
* Public function to show the ERD panel
|
|
198
|
-
* DVDT calls this function directly to open the ERD Generator.
|
|
199
|
-
*
|
|
200
|
-
* DVDT Integration Example:
|
|
201
|
-
*
|
|
202
|
-
* import { showERDPanel } from '@dvdt-tools/erd-generator';
|
|
203
|
-
*
|
|
204
|
-
* // In your DVDT code, call this when user wants to generate ERD
|
|
205
|
-
* showERDPanel(context.extensionUri, environmentUrl, accessToken);
|
|
206
|
-
*
|
|
207
|
-
* @param extensionUri - The extension URI from DVDT's context
|
|
208
|
-
* @param environmentUrl - Dataverse environment URL
|
|
209
|
-
* @param accessToken - Dataverse access token
|
|
210
|
-
*/
|
|
211
|
-
function showERDPanel(extensionUri, environmentUrl, accessToken) {
|
|
212
|
-
if (!environmentUrl || !accessToken) {
|
|
213
|
-
vscode.window.showErrorMessage('Please connect to a Dataverse environment first');
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
try {
|
|
217
|
-
ERDToolPanel.createOrShow(extensionUri, environmentUrl, accessToken);
|
|
218
|
-
}
|
|
219
|
-
catch (error) {
|
|
220
|
-
vscode.window.showErrorMessage(`Failed to open ERD Generator: ${error.message}`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
//# sourceMappingURL=integration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/dvdtIntegration/integration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsNA,oCAeC;AArOD,+CAAiC;AACjC,kDAAyD;AAEzD;;;;;GAKG;AACH,MAAa,YAAY;IAQrB;;;;;;OAMG;IACI,MAAM,CAAC,YAAY,CACtB,YAAwB,EACxB,cAAsB,EACtB,WAAmB;QAEnB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB;YACzC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU;YAC3C,CAAC,CAAC,SAAS,CAAC;QAEhB,sCAAsC;QACtC,IAAI,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAChD,qBAAqB;YACrB,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;YACtE,OAAO;QACX,CAAC;QAED,mBAAmB;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAC1C,YAAY,CAAC,QAAQ,EACrB,eAAe,EACf,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,EAC/B;Y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xB,cAAsB,EACtB,WAAmB;IAEnB,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,iDAAiD,CAAC,CAAC;QAClF,OAAO;IACX,CAAC;IAED,IAAI,CAAC;QACD,YAAY,CAAC,YAAY,CAAC,YAAY,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,iCAAiC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;AACL,CAAC"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ERDGenerator } from './components/ERDGenerator';
|
|
2
|
-
export * from './models/interfaces';
|
|
3
|
-
export { DataverseClient } from './utils/DataverseClient';
|
|
4
|
-
export type { DataverseConfig } from './utils/DataverseClient';
|
|
5
|
-
export { showERDPanel } from './dvdtIntegration/integration';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/src/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.showERDPanel = exports.DataverseClient = exports.ERDGenerator = void 0;
|
|
18
|
-
var ERDGenerator_1 = require("./components/ERDGenerator");
|
|
19
|
-
Object.defineProperty(exports, "ERDGenerator", { enumerable: true, get: function () { return ERDGenerator_1.ERDGenerator; } });
|
|
20
|
-
__exportStar(require("./models/interfaces"), exports);
|
|
21
|
-
var DataverseClient_1 = require("./utils/DataverseClient");
|
|
22
|
-
Object.defineProperty(exports, "DataverseClient", { enumerable: true, get: function () { return DataverseClient_1.DataverseClient; } });
|
|
23
|
-
// VS Code integration (optional import)
|
|
24
|
-
var integration_1 = require("./dvdtIntegration/integration");
|
|
25
|
-
Object.defineProperty(exports, "showERDPanel", { enumerable: true, get: function () { return integration_1.showERDPanel; } });
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0DAAyD;AAAhD,4GAAA,YAAY,OAAA;AACrB,sDAAoC;AACpC,2DAA0D;AAAjD,kHAAA,eAAe,OAAA;AAGxB,wCAAwC;AACxC,6DAA6D;AAApD,2GAAA,YAAY,OAAA"}
|