@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,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a Dataverse table (entity) in the solution
|
|
3
|
-
*/
|
|
4
|
-
export interface DataverseTable {
|
|
5
|
-
/** Logical name of the table */
|
|
6
|
-
logicalName: string;
|
|
7
|
-
/** Display name of the table */
|
|
8
|
-
displayName: string;
|
|
9
|
-
/** Schema name of the table */
|
|
10
|
-
schemaName: string;
|
|
11
|
-
/** Primary ID attribute name */
|
|
12
|
-
primaryIdAttribute: string;
|
|
13
|
-
/** Primary name attribute */
|
|
14
|
-
primaryNameAttribute: string;
|
|
15
|
-
/** Table type (Standard, Activity, Virtual, etc.) */
|
|
16
|
-
tableType: string;
|
|
17
|
-
/** Whether the table is an intersect table */
|
|
18
|
-
isIntersect: boolean;
|
|
19
|
-
/** Attributes (columns) in the table */
|
|
20
|
-
attributes: DataverseAttribute[];
|
|
21
|
-
/** Relationships from this table */
|
|
22
|
-
relationships: DataverseRelationship[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Represents an attribute (column) in a Dataverse table
|
|
26
|
-
*/
|
|
27
|
-
export interface DataverseAttribute {
|
|
28
|
-
/** Logical name of the attribute */
|
|
29
|
-
logicalName: string;
|
|
30
|
-
/** Display name of the attribute */
|
|
31
|
-
displayName: string;
|
|
32
|
-
/** Data type of the attribute */
|
|
33
|
-
type: string;
|
|
34
|
-
/** Whether this is a primary key */
|
|
35
|
-
isPrimaryId: boolean;
|
|
36
|
-
/** Whether this is the primary name field */
|
|
37
|
-
isPrimaryName: boolean;
|
|
38
|
-
/** Whether this field is required */
|
|
39
|
-
isRequired: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Represents a relationship between Dataverse tables
|
|
43
|
-
*/
|
|
44
|
-
export interface DataverseRelationship {
|
|
45
|
-
/** Schema name of the relationship */
|
|
46
|
-
schemaName: string;
|
|
47
|
-
/** Type of relationship (OneToMany, ManyToOne, ManyToMany) */
|
|
48
|
-
type: 'OneToMany' | 'ManyToOne' | 'ManyToMany';
|
|
49
|
-
/** Related table logical name */
|
|
50
|
-
relatedTable: string;
|
|
51
|
-
/** Lookup attribute name (for OneToMany/ManyToOne) */
|
|
52
|
-
lookupAttribute?: string;
|
|
53
|
-
/** Intersect table name (for ManyToMany) */
|
|
54
|
-
intersectTable?: string;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Represents a Dataverse solution
|
|
58
|
-
*/
|
|
59
|
-
export interface DataverseSolution {
|
|
60
|
-
/** Unique name of the solution */
|
|
61
|
-
uniqueName: string;
|
|
62
|
-
/** Display name of the solution */
|
|
63
|
-
displayName: string;
|
|
64
|
-
/** Version of the solution */
|
|
65
|
-
version: string;
|
|
66
|
-
/** Publisher prefix */
|
|
67
|
-
publisherPrefix: string;
|
|
68
|
-
/** Tables included in the solution */
|
|
69
|
-
tables: DataverseTable[];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Configuration for ERD generation
|
|
73
|
-
*/
|
|
74
|
-
export interface ERDConfig {
|
|
75
|
-
/** Format of the output (mermaid, plantuml, graphviz) */
|
|
76
|
-
format: 'mermaid' | 'plantuml' | 'graphviz';
|
|
77
|
-
/** Whether to include attributes in the diagram */
|
|
78
|
-
includeAttributes: boolean;
|
|
79
|
-
/** Whether to include relationships */
|
|
80
|
-
includeRelationships: boolean;
|
|
81
|
-
/** Maximum number of attributes to show per table (0 = all) */
|
|
82
|
-
maxAttributesPerTable: number;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","source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C,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC5C,mDAAmD;IACnD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uCAAuC;IACvC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+DAA+D;IAC/D,qBAAqB,EAAE,MAAM,CAAC;CAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/models/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform-agnostic API interface
|
|
3
|
-
* Works with both PPTB (PowerPlatform ToolBox) and DVDT (Dataverse DevTools)
|
|
4
|
-
*/
|
|
5
|
-
export interface ToolContext {
|
|
6
|
-
toolId?: string | null;
|
|
7
|
-
connectionUrl?: string | null;
|
|
8
|
-
accessToken?: string | null;
|
|
9
|
-
}
|
|
10
|
-
export interface NotificationOptions {
|
|
11
|
-
title: string;
|
|
12
|
-
body: string;
|
|
13
|
-
type: 'info' | 'success' | 'warning' | 'error';
|
|
14
|
-
duration?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Unified platform API interface
|
|
18
|
-
* Abstracts PPTB and DVDT differences
|
|
19
|
-
*/
|
|
20
|
-
export interface IPlatformAPI {
|
|
21
|
-
/**
|
|
22
|
-
* Get current tool context (connection URL and access token)
|
|
23
|
-
*/
|
|
24
|
-
getToolContext(): Promise<ToolContext>;
|
|
25
|
-
/**
|
|
26
|
-
* Show notification to user
|
|
27
|
-
*/
|
|
28
|
-
showNotification(options: NotificationOptions): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Copy text to clipboard
|
|
31
|
-
*/
|
|
32
|
-
copyToClipboard(text: string): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Save content to file
|
|
35
|
-
*/
|
|
36
|
-
saveFile(defaultPath: string, content: string): Promise<string | null>;
|
|
37
|
-
/**
|
|
38
|
-
* Subscribe to platform events
|
|
39
|
-
*/
|
|
40
|
-
onPlatformEvent?(callback: (event: string, data: any) => void): void;
|
|
41
|
-
/**
|
|
42
|
-
* Get platform name for debugging
|
|
43
|
-
*/
|
|
44
|
-
getPlatformName(): string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* PPTB Platform Implementation
|
|
48
|
-
* Uses window.toolboxAPI provided by PowerPlatform ToolBox
|
|
49
|
-
*/
|
|
50
|
-
export declare class PPTBPlatformAPI implements IPlatformAPI {
|
|
51
|
-
private api;
|
|
52
|
-
constructor();
|
|
53
|
-
getToolContext(): Promise<ToolContext>;
|
|
54
|
-
showNotification(options: NotificationOptions): Promise<void>;
|
|
55
|
-
copyToClipboard(text: string): Promise<void>;
|
|
56
|
-
saveFile(defaultPath: string, content: string): Promise<string | null>;
|
|
57
|
-
onPlatformEvent(callback: (event: string, data: any) => void): void;
|
|
58
|
-
getPlatformName(): string;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* DVDT Platform Implementation
|
|
62
|
-
* Uses VS Code WebView message passing and direct context injection
|
|
63
|
-
*/
|
|
64
|
-
export declare class DVDTPlatformAPI implements IPlatformAPI {
|
|
65
|
-
private context;
|
|
66
|
-
private vscode;
|
|
67
|
-
constructor(context: ToolContext);
|
|
68
|
-
getToolContext(): Promise<ToolContext>;
|
|
69
|
-
showNotification(options: NotificationOptions): Promise<void>;
|
|
70
|
-
copyToClipboard(text: string): Promise<void>;
|
|
71
|
-
saveFile(defaultPath: string, content: string): Promise<string | null>;
|
|
72
|
-
onPlatformEvent(callback: (event: string, data: any) => void): void;
|
|
73
|
-
getPlatformName(): string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Platform Detection and Factory
|
|
77
|
-
*/
|
|
78
|
-
export declare class PlatformAPIFactory {
|
|
79
|
-
/**
|
|
80
|
-
* Detect which platform we're running on and return appropriate API
|
|
81
|
-
*/
|
|
82
|
-
static create(dvdtContext?: ToolContext): IPlatformAPI;
|
|
83
|
-
/**
|
|
84
|
-
* Check if running in PPTB
|
|
85
|
-
*/
|
|
86
|
-
static isPPTB(): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check if running in DVDT
|
|
89
|
-
*/
|
|
90
|
-
static isDVDT(): boolean;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=platformApi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformApi.d.ts","sourceRoot":"","sources":["../../../src/models/platformApi.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvC;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C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C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IASnE,eAAe,IAAI,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC3B;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,YAAY;IAsBtD;;OAEG;IACH,MAAM,CAAC,MAAM,IAAI,OAAO;IAIxB;;OAEG;IACH,MAAM,CAAC,MAAM,IAAI,OAAO;CAG3B"}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="@pptb/types" />
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.PlatformAPIFactory = exports.DVDTPlatformAPI = exports.PPTBPlatformAPI = void 0;
|
|
14
|
-
/**
|
|
15
|
-
* PPTB Platform Implementation
|
|
16
|
-
* Uses window.toolboxAPI provided by PowerPlatform ToolBox
|
|
17
|
-
*/
|
|
18
|
-
class PPTBPlatformAPI {
|
|
19
|
-
constructor() {
|
|
20
|
-
if (!window.toolboxAPI) {
|
|
21
|
-
throw new Error('PPTB toolboxAPI not available. Tool must run inside PowerPlatform ToolBox.');
|
|
22
|
-
}
|
|
23
|
-
this.api = window.toolboxAPI;
|
|
24
|
-
}
|
|
25
|
-
getToolContext() {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
// Try window.TOOLBOX_CONTEXT first (injected via postMessage)
|
|
28
|
-
if (window.TOOLBOX_CONTEXT) {
|
|
29
|
-
return {
|
|
30
|
-
toolId: window.TOOLBOX_CONTEXT.toolId || null,
|
|
31
|
-
connectionUrl: window.TOOLBOX_CONTEXT.connectionUrl || null,
|
|
32
|
-
accessToken: window.TOOLBOX_CONTEXT.accessToken || null,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
// Fallback to API call
|
|
36
|
-
const context = yield this.api.getToolContext();
|
|
37
|
-
return {
|
|
38
|
-
toolId: context.toolId || null,
|
|
39
|
-
connectionUrl: context.connectionUrl || null,
|
|
40
|
-
accessToken: context.accessToken || null,
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
showNotification(options) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
yield this.api.showNotification({
|
|
47
|
-
title: options.title,
|
|
48
|
-
body: options.body,
|
|
49
|
-
type: options.type,
|
|
50
|
-
duration: options.duration,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
copyToClipboard(text) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
yield this.api.copyToClipboard(text);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
saveFile(defaultPath, content) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return yield this.api.saveFile(defaultPath, content);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
onPlatformEvent(callback) {
|
|
65
|
-
this.api.onToolboxEvent((_event, payload) => {
|
|
66
|
-
callback(payload.event, payload.data);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
getPlatformName() {
|
|
70
|
-
return 'PPTB';
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.PPTBPlatformAPI = PPTBPlatformAPI;
|
|
74
|
-
/**
|
|
75
|
-
* DVDT Platform Implementation
|
|
76
|
-
* Uses VS Code WebView message passing and direct context injection
|
|
77
|
-
*/
|
|
78
|
-
class DVDTPlatformAPI {
|
|
79
|
-
constructor(context) {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
this.context = context;
|
|
82
|
-
// VS Code WebView API (if available)
|
|
83
|
-
this.vscode = (_b = (_a = window).acquireVsCodeApi) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
84
|
-
}
|
|
85
|
-
getToolContext() {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
return this.context;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
showNotification(options) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
if (this.vscode) {
|
|
93
|
-
// Send message to VS Code extension
|
|
94
|
-
this.vscode.postMessage(Object.assign({ command: 'showNotification' }, options));
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
// Fallback to browser notification/alert
|
|
98
|
-
console.log(`[${options.type.toUpperCase()}] ${options.title}: ${options.body}`);
|
|
99
|
-
if (options.type === 'error') {
|
|
100
|
-
alert(`${options.title}\n${options.body}`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
copyToClipboard(text) {
|
|
106
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
if (this.vscode) {
|
|
108
|
-
// Send message to VS Code extension
|
|
109
|
-
this.vscode.postMessage({
|
|
110
|
-
command: 'copyToClipboard',
|
|
111
|
-
text,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
else if (navigator.clipboard) {
|
|
115
|
-
// Fallback to browser Clipboard API
|
|
116
|
-
yield navigator.clipboard.writeText(text);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
throw new Error('Clipboard API not available');
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
saveFile(defaultPath, content) {
|
|
124
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
if (this.vscode) {
|
|
126
|
-
// Send message to VS Code extension and wait for response
|
|
127
|
-
return new Promise((resolve) => {
|
|
128
|
-
const messageHandler = (event) => {
|
|
129
|
-
if (event.data.command === 'saveFileResponse') {
|
|
130
|
-
window.removeEventListener('message', messageHandler);
|
|
131
|
-
resolve(event.data.path);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
window.addEventListener('message', messageHandler);
|
|
135
|
-
this.vscode.postMessage({
|
|
136
|
-
command: 'saveFile',
|
|
137
|
-
defaultPath,
|
|
138
|
-
content,
|
|
139
|
-
});
|
|
140
|
-
// Timeout after 30 seconds
|
|
141
|
-
setTimeout(() => {
|
|
142
|
-
window.removeEventListener('message', messageHandler);
|
|
143
|
-
resolve(null);
|
|
144
|
-
}, 30000);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
// Fallback to download
|
|
149
|
-
const blob = new Blob([content], { type: 'text/plain' });
|
|
150
|
-
const url = URL.createObjectURL(blob);
|
|
151
|
-
const a = document.createElement('a');
|
|
152
|
-
a.href = url;
|
|
153
|
-
a.download = defaultPath;
|
|
154
|
-
a.click();
|
|
155
|
-
URL.revokeObjectURL(url);
|
|
156
|
-
return defaultPath;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
onPlatformEvent(callback) {
|
|
161
|
-
// Listen for messages from VS Code extension
|
|
162
|
-
window.addEventListener('message', (event) => {
|
|
163
|
-
if (event.data.command === 'platformEvent') {
|
|
164
|
-
callback(event.data.event, event.data.data);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
getPlatformName() {
|
|
169
|
-
return 'DVDT';
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.DVDTPlatformAPI = DVDTPlatformAPI;
|
|
173
|
-
/**
|
|
174
|
-
* Platform Detection and Factory
|
|
175
|
-
*/
|
|
176
|
-
class PlatformAPIFactory {
|
|
177
|
-
/**
|
|
178
|
-
* Detect which platform we're running on and return appropriate API
|
|
179
|
-
*/
|
|
180
|
-
static create(dvdtContext) {
|
|
181
|
-
// Check for PPTB first
|
|
182
|
-
if (typeof window !== 'undefined' && window.toolboxAPI) {
|
|
183
|
-
console.log('[PlatformAPI] Detected PPTB environment');
|
|
184
|
-
return new PPTBPlatformAPI();
|
|
185
|
-
}
|
|
186
|
-
// Fall back to DVDT
|
|
187
|
-
if (dvdtContext) {
|
|
188
|
-
console.log('[PlatformAPI] Using DVDT environment with provided context');
|
|
189
|
-
return new DVDTPlatformAPI(dvdtContext);
|
|
190
|
-
}
|
|
191
|
-
// Last resort: create DVDT with empty context
|
|
192
|
-
console.warn('[PlatformAPI] No platform detected, creating DVDT API with empty context');
|
|
193
|
-
return new DVDTPlatformAPI({
|
|
194
|
-
toolId: null,
|
|
195
|
-
connectionUrl: null,
|
|
196
|
-
accessToken: null,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Check if running in PPTB
|
|
201
|
-
*/
|
|
202
|
-
static isPPTB() {
|
|
203
|
-
return typeof window !== 'undefined' && !!window.toolboxAPI;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Check if running in DVDT
|
|
207
|
-
*/
|
|
208
|
-
static isDVDT() {
|
|
209
|
-
return !PlatformAPIFactory.isPPTB();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.PlatformAPIFactory = PlatformAPIFactory;
|
|
213
|
-
//# sourceMappingURL=platformApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platformApi.js","sourceRoot":"","sources":["../../../src/models/platformApi.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;;;;;;;;;;AAwDrC;;;GAGG;AACH,MAAa,eAAe;IAGxB;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AED,8CAA8C;QAC9C,OAAO,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;QACzF,OAAO,IAAI,eAAe,CAAC;YACvB,MAAM,EAAE,IAAI;YACZ,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,IAAI;SACpB,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM;QACT,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM;QACT,OAAO,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;IACxC,CAAC;CACJ;AAvCD,gDAuCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,EAAE,MAAM,EAA8D,CAAC;AAC/F,eAAO,MAAM,MAAM,EAAE,MAAM,EAAiD,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pathUi = exports.pathWebview = void 0;
|
|
4
|
-
exports.pathWebview = ['node_modules', 'dvdt-erd-generator', 'dist', 'webview'];
|
|
5
|
-
exports.pathUi = ['node_modules', 'dvdt-erd-generator', 'ui'];
|
|
6
|
-
//# sourceMappingURL=Constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAa,CAAC,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAClF,QAAA,MAAM,GAAa,CAAC,cAAc,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DataverseSolution } from '../models/interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for connecting to Dataverse
|
|
4
|
-
*/
|
|
5
|
-
export interface DataverseConfig {
|
|
6
|
-
/** Dataverse environment URL (e.g., https://org.crm.dynamics.com) */
|
|
7
|
-
environmentUrl: string;
|
|
8
|
-
/** Access token for authentication */
|
|
9
|
-
accessToken: string;
|
|
10
|
-
/** API version to use (default: 9.2) */
|
|
11
|
-
apiVersion?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Client for interacting with Dataverse Web API
|
|
15
|
-
*/
|
|
16
|
-
export declare class DataverseClient {
|
|
17
|
-
private axiosInstance;
|
|
18
|
-
private environmentUrl;
|
|
19
|
-
private apiVersion;
|
|
20
|
-
constructor(config: DataverseConfig);
|
|
21
|
-
/**
|
|
22
|
-
* Fetch solution metadata from Dataverse
|
|
23
|
-
* @param solutionUniqueName Unique name of the solution
|
|
24
|
-
* @returns Solution with all tables and metadata
|
|
25
|
-
*/
|
|
26
|
-
fetchSolution(solutionUniqueName: string): Promise<DataverseSolution>;
|
|
27
|
-
/**
|
|
28
|
-
* Fetch multiple tables by their IDs
|
|
29
|
-
*/
|
|
30
|
-
private fetchTables;
|
|
31
|
-
/**
|
|
32
|
-
* Fetch a single table by ID
|
|
33
|
-
*/
|
|
34
|
-
private fetchTable;
|
|
35
|
-
/**
|
|
36
|
-
* Fetch relationships for a table
|
|
37
|
-
*/
|
|
38
|
-
private fetchRelationships;
|
|
39
|
-
/**
|
|
40
|
-
* Map Dataverse attribute types to simplified types
|
|
41
|
-
*/
|
|
42
|
-
private mapAttributeType;
|
|
43
|
-
/**
|
|
44
|
-
* List all solutions in the environment
|
|
45
|
-
* @returns Array of solution names
|
|
46
|
-
*/
|
|
47
|
-
listSolutions(): Promise<Array<{
|
|
48
|
-
uniqueName: string;
|
|
49
|
-
displayName: string;
|
|
50
|
-
version: string;
|
|
51
|
-
}>>;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=DataverseClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataverseClient.d.ts","sourceRoot":"","sources":["../../../src/utils/DataverseClient.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAEpH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,eAAe;IAgBnC;;;;OAIG;IACG,aAAa,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwC3E;;OAEG;YACW,WAAW;IAiBzB;;OAEG;YACW,UAAU;IA2CxB;;OAEG;YACW,kBAAkB;IAyDhC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAkBpG"}
|