pptb-standard-sample-tool 0.0.5 → 0.0.7
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/package.json +1 -1
- package/types/index.d.ts +168 -140
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,154 +1,182 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Power Platform Tool Box API Type Definitions
|
|
3
|
+
*
|
|
4
4
|
* Tools running in ToolBox webviews can access the ToolBox API via window.toolboxAPI
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
declare namespace ToolBox {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Tool context containing connection information
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolContext {
|
|
12
|
+
toolId: string | null;
|
|
13
|
+
connectionUrl: string | null;
|
|
14
|
+
accessToken: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Notification options
|
|
19
|
+
*/
|
|
20
|
+
export interface NotificationOptions {
|
|
21
|
+
title: string;
|
|
22
|
+
body: string;
|
|
23
|
+
type?: "info" | "success" | "warning" | "error";
|
|
24
|
+
duration?: number; // Duration in milliseconds, 0 for persistent
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Event types that can be emitted by the ToolBox
|
|
29
|
+
*/
|
|
30
|
+
export type ToolBoxEvent = "tool:loaded" | "tool:unloaded" | "connection:created" | "connection:updated" | "connection:deleted" | "settings:updated" | "notification:shown" | "terminal:created" | "terminal:closed" | "terminal:output" | "terminal:command:completed" | "terminal:error";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Event payload for ToolBox events
|
|
34
|
+
*/
|
|
35
|
+
export interface ToolBoxEventPayload {
|
|
36
|
+
event: ToolBoxEvent;
|
|
37
|
+
data: unknown;
|
|
38
|
+
timestamp: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Dataverse connection configuration
|
|
43
|
+
*/
|
|
44
|
+
export interface DataverseConnection {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
url: string;
|
|
48
|
+
environment: "Dev" | "Test" | "UAT" | "Production";
|
|
49
|
+
clientId?: string;
|
|
50
|
+
tenantId?: string;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
lastUsedAt?: string;
|
|
53
|
+
isActive?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tool information
|
|
58
|
+
*/
|
|
59
|
+
export interface Tool {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
version: string;
|
|
63
|
+
description: string;
|
|
64
|
+
author: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Terminal configuration options
|
|
70
|
+
*/
|
|
71
|
+
export interface TerminalOptions {
|
|
72
|
+
name: string;
|
|
73
|
+
shell?: string;
|
|
74
|
+
cwd?: string;
|
|
75
|
+
env?: Record<string, string>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Terminal instance
|
|
80
|
+
*/
|
|
81
|
+
export interface Terminal {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
toolId: string;
|
|
85
|
+
shell: string;
|
|
86
|
+
cwd: string;
|
|
87
|
+
isVisible: boolean;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Terminal command execution result
|
|
93
|
+
*/
|
|
94
|
+
export interface TerminalCommandResult {
|
|
95
|
+
terminalId: string;
|
|
96
|
+
commandId: string;
|
|
97
|
+
output?: string;
|
|
98
|
+
exitCode?: number;
|
|
99
|
+
error?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* ToolBox API exposed to tools via window.toolboxAPI
|
|
104
|
+
*/
|
|
105
|
+
export interface ToolBoxAPI {
|
|
106
|
+
// Settings
|
|
107
|
+
getUserSettings: () => Promise<any>;
|
|
108
|
+
updateUserSettings: (settings: any) => Promise<void>;
|
|
109
|
+
getSetting: (key: string) => Promise<any>;
|
|
110
|
+
setSetting: (key: string, value: any) => Promise<void>;
|
|
111
|
+
|
|
112
|
+
// Connections
|
|
113
|
+
addConnection: (connection: any) => Promise<void>;
|
|
114
|
+
updateConnection: (id: string, updates: any) => Promise<void>;
|
|
115
|
+
deleteConnection: (id: string) => Promise<void>;
|
|
116
|
+
getConnections: () => Promise<DataverseConnection[]>;
|
|
117
|
+
setActiveConnection: (id: string) => Promise<void>;
|
|
118
|
+
getActiveConnection: () => Promise<DataverseConnection | null>;
|
|
119
|
+
disconnectConnection: () => Promise<void>;
|
|
120
|
+
|
|
121
|
+
// Tools
|
|
122
|
+
getAllTools: () => Promise<Tool[]>;
|
|
123
|
+
getTool: (toolId: string) => Promise<Tool>;
|
|
124
|
+
loadTool: (packageName: string) => Promise<Tool>;
|
|
125
|
+
unloadTool: (toolId: string) => Promise<void>;
|
|
126
|
+
installTool: (packageName: string) => Promise<Tool>;
|
|
127
|
+
uninstallTool: (packageName: string, toolId: string) => Promise<void>;
|
|
128
|
+
getToolWebviewHtml: (packageName: string, connectionUrl?: string, accessToken?: string) => Promise<string | null>;
|
|
129
|
+
getToolContext: () => Promise<ToolContext>;
|
|
130
|
+
|
|
131
|
+
// Tool Settings
|
|
132
|
+
getToolSettings: (toolId: string) => Promise<any>;
|
|
133
|
+
updateToolSettings: (toolId: string, settings: any) => Promise<void>;
|
|
134
|
+
|
|
135
|
+
// Notifications
|
|
136
|
+
showNotification: (options: NotificationOptions) => Promise<void>;
|
|
137
|
+
|
|
138
|
+
// Clipboard
|
|
139
|
+
copyToClipboard: (text: string) => Promise<void>;
|
|
140
|
+
|
|
141
|
+
// File operations
|
|
142
|
+
saveFile: (defaultPath: string, content: any) => Promise<string | null>;
|
|
143
|
+
|
|
144
|
+
// Terminal operations
|
|
145
|
+
createTerminal: (toolId: string, options: TerminalOptions) => Promise<Terminal>;
|
|
146
|
+
executeTerminalCommand: (terminalId: string, command: string) => Promise<TerminalCommandResult>;
|
|
147
|
+
closeTerminal: (terminalId: string) => Promise<void>;
|
|
148
|
+
getTerminal: (terminalId: string) => Promise<Terminal | undefined>;
|
|
149
|
+
getToolTerminals: (toolId: string) => Promise<Terminal[]>;
|
|
150
|
+
getAllTerminals: () => Promise<Terminal[]>;
|
|
151
|
+
setTerminalVisibility: (terminalId: string, visible: boolean) => Promise<void>;
|
|
152
|
+
|
|
153
|
+
// Events
|
|
154
|
+
getEventHistory: (limit?: number) => Promise<ToolBoxEventPayload[]>;
|
|
155
|
+
onToolboxEvent: (callback: (event: any, payload: ToolBoxEventPayload) => void) => void;
|
|
156
|
+
removeToolboxEventListener: (callback: (event: any, payload: ToolBoxEventPayload) => void) => void;
|
|
157
|
+
|
|
158
|
+
// Auto-update
|
|
159
|
+
checkForUpdates: () => Promise<void>;
|
|
160
|
+
downloadUpdate: () => Promise<void>;
|
|
161
|
+
quitAndInstall: () => Promise<void>;
|
|
162
|
+
getAppVersion: () => Promise<string>;
|
|
163
|
+
onUpdateChecking: (callback: () => void) => void;
|
|
164
|
+
onUpdateAvailable: (callback: (info: any) => void) => void;
|
|
165
|
+
onUpdateNotAvailable: (callback: () => void) => void;
|
|
166
|
+
onUpdateDownloadProgress: (callback: (progress: any) => void) => void;
|
|
167
|
+
onUpdateDownloaded: (callback: (info: any) => void) => void;
|
|
168
|
+
onUpdateError: (callback: (error: string) => void) => void;
|
|
169
|
+
}
|
|
142
170
|
}
|
|
143
171
|
|
|
144
172
|
/**
|
|
145
173
|
* Global window interface extension for ToolBox tools
|
|
146
174
|
*/
|
|
147
175
|
declare global {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
176
|
+
interface Window {
|
|
177
|
+
toolboxAPI: ToolBox.ToolBoxAPI;
|
|
178
|
+
TOOLBOX_CONTEXT?: ToolBox.ToolContext;
|
|
179
|
+
}
|
|
152
180
|
}
|
|
153
181
|
|
|
154
182
|
export = ToolBox;
|