@beekeeperstudio/plugin 1.4.0 → 1.5.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/dist/eventForwarder.js +5 -5
- package/dist/eventForwarder.js.map +1 -1
- package/dist/index.d.ts +300 -311
- package/dist/index.js +156 -111
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +326 -0
- package/dist/internal.js +1 -0
- package/package.json +15 -1
package/dist/index.js
CHANGED
|
@@ -1,106 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
hex.substring(0, 8),
|
|
9
|
-
hex.substring(8, 12),
|
|
10
|
-
hex.substring(12, 16),
|
|
11
|
-
hex.substring(16, 20),
|
|
12
|
-
hex.substring(20),
|
|
13
|
-
].join("-");
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const pendingRequests = new Map();
|
|
17
|
-
let debugComms = false;
|
|
18
|
-
function setDebugComms(enabled) {
|
|
19
|
-
debugComms = enabled;
|
|
20
|
-
}
|
|
21
|
-
window.addEventListener("message", (event) => {
|
|
22
|
-
const { id, name, args, result, error } = event.data || {};
|
|
23
|
-
if (name) {
|
|
24
|
-
if (debugComms) {
|
|
25
|
-
const time = new Date().toLocaleTimeString("en-GB");
|
|
26
|
-
console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);
|
|
27
|
-
console.log("Args:", args);
|
|
28
|
-
console.groupEnd();
|
|
29
|
-
}
|
|
30
|
-
const handlers = notificationListeners.get(name);
|
|
31
|
-
if (handlers) {
|
|
32
|
-
handlers.forEach((handler) => handler(args));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (id && pendingRequests.has(id)) {
|
|
36
|
-
const { resolve, reject, payload } = pendingRequests.get(id);
|
|
37
|
-
pendingRequests.delete(id);
|
|
38
|
-
if (debugComms) {
|
|
39
|
-
const time = new Date().toLocaleTimeString("en-GB");
|
|
40
|
-
console.groupCollapsed(`${time} [RESPONSE] ${payload.name}`);
|
|
41
|
-
console.log("Result:", result);
|
|
42
|
-
if (error)
|
|
43
|
-
console.error("Error:", error);
|
|
44
|
-
console.groupEnd();
|
|
45
|
-
}
|
|
46
|
-
if (error) {
|
|
47
|
-
reject(error);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
resolve(result);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
async function request(raw) {
|
|
55
|
-
const payload = { id: generateUUID(), ...raw };
|
|
56
|
-
if (debugComms) {
|
|
57
|
-
const time = new Date().toLocaleTimeString("en-GB");
|
|
58
|
-
console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);
|
|
59
|
-
console.log("id:", payload.id);
|
|
60
|
-
console.log("args:", payload.args);
|
|
61
|
-
console.log("payload:", payload);
|
|
62
|
-
console.groupEnd();
|
|
63
|
-
}
|
|
64
|
-
return new Promise((resolve, reject) => {
|
|
65
|
-
try {
|
|
66
|
-
pendingRequests.set(payload.id, { payload: payload, resolve, reject });
|
|
67
|
-
window.parent.postMessage(payload, "*");
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
reject(e);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function notify(name, args) {
|
|
75
|
-
const payload = { name, args };
|
|
76
|
-
if (debugComms) {
|
|
77
|
-
const time = new Date().toLocaleTimeString("en-GB");
|
|
78
|
-
console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);
|
|
79
|
-
console.log("args:", args);
|
|
80
|
-
console.log("payload:", payload);
|
|
81
|
-
console.groupEnd();
|
|
82
|
-
}
|
|
83
|
-
window.parent.postMessage(payload, "*");
|
|
84
|
-
}
|
|
85
|
-
const notificationListeners = new Map();
|
|
86
|
-
function addNotificationListener(name, handler) {
|
|
87
|
-
if (!notificationListeners.get(name)) {
|
|
88
|
-
notificationListeners.set(name, []);
|
|
89
|
-
}
|
|
90
|
-
notificationListeners.get(name).push(handler);
|
|
91
|
-
}
|
|
92
|
-
function removeNotificationListener(name, handler) {
|
|
93
|
-
const handlers = notificationListeners.get(name);
|
|
94
|
-
if (handlers) {
|
|
95
|
-
const index = handlers.indexOf(handler);
|
|
96
|
-
if (index > -1) {
|
|
97
|
-
handlers.splice(index, 1);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Get a list of schemas from the current database.
|
|
3
|
+
*
|
|
4
|
+
* @since Beekeeper Studio 5.5.0
|
|
5
|
+
**/
|
|
6
|
+
async function getSchemas() {
|
|
7
|
+
return await request({ name: "getSchemas", args: void 0 });
|
|
100
8
|
}
|
|
101
|
-
|
|
102
9
|
/**
|
|
103
10
|
* Get a list of tables from the current database.
|
|
11
|
+
*
|
|
104
12
|
* @since Beekeeper Studio 5.3.0
|
|
105
13
|
**/
|
|
106
14
|
async function getTables(schema) {
|
|
@@ -118,6 +26,19 @@ async function getColumns(table, schema) {
|
|
|
118
26
|
async function getTableKeys(table, schema) {
|
|
119
27
|
return await request({ name: "getTableKeys", args: { table, schema } });
|
|
120
28
|
}
|
|
29
|
+
/** @since Beekeeper Studio 5.5.0 */
|
|
30
|
+
async function getTableIndexes(table, schema) {
|
|
31
|
+
return await request({ name: "getTableIndexes", args: { table, schema } });
|
|
32
|
+
}
|
|
33
|
+
async function getPrimaryKeys(table, schema) {
|
|
34
|
+
return await request({ name: "getPrimaryKeys", args: { table, schema } });
|
|
35
|
+
}
|
|
36
|
+
async function getIncomingKeys(table, schema) {
|
|
37
|
+
return await request({ name: "getIncomingKeys", args: { table, schema } });
|
|
38
|
+
}
|
|
39
|
+
async function getOutgoingKeys(table, schema) {
|
|
40
|
+
return await request({ name: "getOutgoingKeys", args: { table, schema } });
|
|
41
|
+
}
|
|
121
42
|
/**
|
|
122
43
|
* Get information about the current database connection.
|
|
123
44
|
*
|
|
@@ -241,8 +162,20 @@ async function setEncryptedData(keyOrValue, value) {
|
|
|
241
162
|
return await request({ name: "setEncryptedData", args: { key: "default", value: keyOrValue } });
|
|
242
163
|
}
|
|
243
164
|
}
|
|
244
|
-
async function openTab(type,
|
|
245
|
-
return await request({ name: "openTab", args: { type, ...
|
|
165
|
+
async function openTab(type, options) {
|
|
166
|
+
return await request({ name: "openTab", args: { type, ...options } });
|
|
167
|
+
}
|
|
168
|
+
async function requestFileSave(options) {
|
|
169
|
+
return await request({ name: "requestFileSave", args: options });
|
|
170
|
+
}
|
|
171
|
+
async function showStatusBarUI() {
|
|
172
|
+
return await request({ name: "toggleStatusBarUI", args: { force: true } });
|
|
173
|
+
}
|
|
174
|
+
async function hideStatusBarUI() {
|
|
175
|
+
return await request({ name: "toggleStatusBarUI", args: { force: false } });
|
|
176
|
+
}
|
|
177
|
+
async function toggleStatusBarUI() {
|
|
178
|
+
return await request({ name: "toggleStatusBarUI", args: void 0 });
|
|
246
179
|
}
|
|
247
180
|
/** @since Beekeeper Studio 5.4.0 */
|
|
248
181
|
const broadcast = {
|
|
@@ -258,36 +191,148 @@ const broadcast = {
|
|
|
258
191
|
/** @since Beekeeper Studio 5.3.0 */
|
|
259
192
|
const log = {
|
|
260
193
|
error(err) {
|
|
194
|
+
if (typeof err === "string") {
|
|
195
|
+
return notify("pluginError", {
|
|
196
|
+
name: "Error",
|
|
197
|
+
message: err,
|
|
198
|
+
stack: undefined,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
261
201
|
return notify("pluginError", {
|
|
262
202
|
name: err.name || "Error",
|
|
263
|
-
message: err.message
|
|
203
|
+
message: err.message,
|
|
264
204
|
stack: err.stack,
|
|
265
205
|
});
|
|
266
206
|
},
|
|
267
207
|
};
|
|
268
|
-
/**
|
|
269
|
-
* Clipboard interface.
|
|
270
|
-
*
|
|
271
|
-
* @since Beekeeper Studio 5.3.0
|
|
272
|
-
**/
|
|
208
|
+
/** Clipboard interface. */
|
|
273
209
|
const clipboard = {
|
|
274
|
-
/** Write text to the Electron clipboard.
|
|
210
|
+
/** Write text to the Electron clipboard.
|
|
211
|
+
* @since Beekeeper Studio 5.3.0 */
|
|
275
212
|
async writeText(text) {
|
|
276
213
|
await request({
|
|
277
214
|
name: "clipboard.writeText",
|
|
278
215
|
args: { text },
|
|
279
216
|
});
|
|
280
217
|
},
|
|
281
|
-
/** Read text from the Electron clipboard.
|
|
218
|
+
/** Read text from the Electron clipboard.
|
|
219
|
+
* @since Beekeeper Studio 5.3.0 */
|
|
282
220
|
async readText() {
|
|
283
221
|
return await request({
|
|
284
222
|
name: "clipboard.readText",
|
|
285
223
|
args: void 0,
|
|
286
224
|
});
|
|
287
225
|
},
|
|
226
|
+
/** @param data - Base64 encoded image data.
|
|
227
|
+
* @since Beekeeper Studio 5.5.0 */
|
|
228
|
+
async writeImage(data) {
|
|
229
|
+
await request({
|
|
230
|
+
name: "clipboard.writeImage",
|
|
231
|
+
args: { data },
|
|
232
|
+
});
|
|
233
|
+
},
|
|
288
234
|
// async write() {},
|
|
289
235
|
// async read() {},
|
|
290
236
|
};
|
|
237
|
+
let debugComms = false;
|
|
238
|
+
function setDebugComms(enabled) {
|
|
239
|
+
debugComms = enabled;
|
|
240
|
+
}
|
|
241
|
+
function notify(name, args) {
|
|
242
|
+
const payload = { name, args };
|
|
243
|
+
if (debugComms) {
|
|
244
|
+
const time = new Date().toLocaleTimeString("en-GB");
|
|
245
|
+
console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);
|
|
246
|
+
console.log("args:", args);
|
|
247
|
+
console.log("payload:", payload);
|
|
248
|
+
console.groupEnd();
|
|
249
|
+
}
|
|
250
|
+
window.parent.postMessage(payload, "*");
|
|
251
|
+
}
|
|
252
|
+
function addNotificationListener(name, handler) {
|
|
253
|
+
if (!notificationListeners.get(name)) {
|
|
254
|
+
notificationListeners.set(name, []);
|
|
255
|
+
}
|
|
256
|
+
notificationListeners.get(name).push(handler);
|
|
257
|
+
}
|
|
258
|
+
function removeNotificationListener(name, handler) {
|
|
259
|
+
const handlers = notificationListeners.get(name);
|
|
260
|
+
if (handlers) {
|
|
261
|
+
const index = handlers.indexOf(handler);
|
|
262
|
+
if (index > -1) {
|
|
263
|
+
handlers.splice(index, 1);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const pendingRequests = new Map();
|
|
268
|
+
async function request(raw) {
|
|
269
|
+
const payload = { id: generateUUID(), ...raw };
|
|
270
|
+
if (debugComms) {
|
|
271
|
+
const time = new Date().toLocaleTimeString("en-GB");
|
|
272
|
+
console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);
|
|
273
|
+
console.log("id:", payload.id);
|
|
274
|
+
console.log("args:", payload.args);
|
|
275
|
+
console.log("payload:", payload);
|
|
276
|
+
console.groupEnd();
|
|
277
|
+
}
|
|
278
|
+
return new Promise((resolve, reject) => {
|
|
279
|
+
try {
|
|
280
|
+
pendingRequests.set(payload.id, { payload: payload, resolve, reject });
|
|
281
|
+
window.parent.postMessage(payload, "*");
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
reject(e);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
const notificationListeners = new Map();
|
|
289
|
+
window.addEventListener("message", (event) => {
|
|
290
|
+
const { id, name, args, result, error } = event.data || {};
|
|
291
|
+
if (name) {
|
|
292
|
+
if (debugComms) {
|
|
293
|
+
const time = new Date().toLocaleTimeString("en-GB");
|
|
294
|
+
console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);
|
|
295
|
+
console.log("Args:", args);
|
|
296
|
+
console.groupEnd();
|
|
297
|
+
}
|
|
298
|
+
const handlers = notificationListeners.get(name);
|
|
299
|
+
if (handlers) {
|
|
300
|
+
handlers.forEach((handler) => handler(args));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (id && pendingRequests.has(id)) {
|
|
304
|
+
const { resolve, reject, payload } = pendingRequests.get(id);
|
|
305
|
+
pendingRequests.delete(id);
|
|
306
|
+
if (debugComms) {
|
|
307
|
+
const time = new Date().toLocaleTimeString("en-GB");
|
|
308
|
+
console.groupCollapsed(`${time} [RESPONSE] ${payload.name}`);
|
|
309
|
+
console.log("Result:", result);
|
|
310
|
+
if (error)
|
|
311
|
+
console.error("Error:", error);
|
|
312
|
+
console.groupEnd();
|
|
313
|
+
}
|
|
314
|
+
if (error) {
|
|
315
|
+
reject(error);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
resolve(result);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
function generateUUID() {
|
|
323
|
+
const buf = new Uint8Array(16);
|
|
324
|
+
crypto.getRandomValues(buf);
|
|
325
|
+
buf[6] = (buf[6] & 0x0f) | 0x40; // version 4
|
|
326
|
+
buf[8] = (buf[8] & 0x3f) | 0x80; // variant
|
|
327
|
+
const hex = Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
328
|
+
return [
|
|
329
|
+
hex.substring(0, 8),
|
|
330
|
+
hex.substring(8, 12),
|
|
331
|
+
hex.substring(12, 16),
|
|
332
|
+
hex.substring(16, 20),
|
|
333
|
+
hex.substring(20),
|
|
334
|
+
].join("-");
|
|
335
|
+
}
|
|
291
336
|
|
|
292
|
-
export { addNotificationListener, broadcast, checkForUpdate, clipboard, expandTableResult, getAppInfo, getAppVersion, getColumns, getConnectionInfo, getData, getEncryptedData, getTableKeys, getTables, getViewContext, getViewState, log, notify, openExternal, openTab, removeNotificationListener, request, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState };
|
|
337
|
+
export { addNotificationListener, broadcast, checkForUpdate, clipboard, expandTableResult, getAppInfo, getAppVersion, getColumns, getConnectionInfo, getData, getEncryptedData, getIncomingKeys, getOutgoingKeys, getPrimaryKeys, getSchemas, getTableIndexes, getTableKeys, getTables, getViewContext, getViewState, hideStatusBarUI, log, notify, openExternal, openTab, removeNotificationListener, request, requestFileSave, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState, showStatusBarUI, toggleStatusBarUI };
|
|
293
338
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/comms.ts","../src/index.ts"],"sourcesContent":["export function generateUUID() {\n const buf = new Uint8Array(16);\n crypto.getRandomValues(buf);\n\n buf[6] = (buf[6] & 0x0f) | 0x40; // version 4\n buf[8] = (buf[8] & 0x3f) | 0x80; // variant\n\n const hex = Array.from(buf, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n\n return [\n hex.substring(0, 8),\n hex.substring(8, 12),\n hex.substring(12, 16),\n hex.substring(16, 20),\n hex.substring(20),\n ].join(\"-\");\n}\n","import { JsonValue } from \"./commonTypes\";\nimport {\n BroadcastNotification,\n PluginErrorNotification,\n ThemeChangedNotification,\n WindowEventNotification,\n} from \"./notificationTypes\";\nimport type { PluginRequestPayload } from \"./requestTypes\";\nimport { generateUUID } from \"./utils\";\n\n// Define a custom import.meta interface for TypeScript\ndeclare global {\n interface ImportMeta {\n env: {\n MODE: string;\n };\n }\n}\n\nconst pendingRequests = new Map<\n string,\n {\n // The whole payload is kept just in case for debugging\n payload: PluginRequestPayload;\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }\n>();\n\nlet debugComms = false;\n\nexport function setDebugComms(enabled: boolean) {\n debugComms = enabled;\n}\n\nwindow.addEventListener(\"message\", (event) => {\n const { id, name, args, result, error } = event.data || {};\n\n if (name) {\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);\n console.log(\"Args:\", args);\n console.groupEnd();\n }\n\n const handlers = notificationListeners.get(name);\n if (handlers) {\n handlers.forEach((handler) => handler(args));\n }\n }\n\n if (id && pendingRequests.has(id)) {\n const { resolve, reject, payload } = pendingRequests.get(id)!;\n pendingRequests.delete(id);\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [RESPONSE] ${payload.name}`);\n console.log(\"Result:\", result);\n if (error) console.error(\"Error:\", error);\n console.groupEnd();\n }\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n }\n});\n\nexport async function request(raw: any): Promise<any> {\n const payload = { id: generateUUID(), ...raw } as PluginRequestPayload;\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);\n console.log(\"id:\", payload.id);\n console.log(\"args:\", payload.args);\n console.log(\"payload:\", payload);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n pendingRequests.set(payload.id, { payload: payload, resolve, reject });\n window.parent.postMessage(payload, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nexport function notify<Message extends JsonValue = JsonValue>(\n name: BroadcastNotification[\"name\"],\n args: BroadcastNotification<Message>[\"args\"],\n): void;\nexport function notify(\n name: PluginErrorNotification[\"name\"],\n args: PluginErrorNotification[\"args\"],\n): void;\nexport function notify(\n name: WindowEventNotification[\"name\"],\n args: WindowEventNotification[\"args\"],\n): void;\nexport function notify(name: string, args: any) {\n const payload = { name, args };\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);\n console.log(\"args:\", args);\n console.log(\"payload:\", payload);\n console.groupEnd();\n }\n window.parent.postMessage(payload, \"*\");\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nexport function addNotificationListener<Message extends JsonValue = JsonValue>(\n name: BroadcastNotification[\"name\"],\n handler: (args: BroadcastNotification<Message>[\"args\"]) => void,\n): void;\nexport function addNotificationListener(\n name: ThemeChangedNotification[\"name\"],\n handler: (args: ThemeChangedNotification[\"args\"]) => void,\n): void;\nexport function addNotificationListener(\n name: string,\n handler: (args: any) => void,\n) {\n if (!notificationListeners.get(name)) {\n notificationListeners.set(name, []);\n }\n notificationListeners.get(name)!.push(handler);\n}\n\nexport function removeNotificationListener(\n name: string,\n handler: (args: any) => void,\n) {\n const handlers = notificationListeners.get(name);\n if (handlers) {\n const index = handlers.indexOf(handler);\n if (index > -1) {\n handlers.splice(index, 1);\n }\n }\n}\n","import { JsonValue } from \"./commonTypes\";\nimport { addNotificationListener, notify, request } from \"./comms\";\nimport type {\n GetTablesRequest,\n GetColumnsRequest,\n RunQueryRequest,\n ExpandTableResultRequest,\n SetTabTitleRequest,\n SetViewStateRequest,\n OpenExternalRequest,\n SetDataRequest,\n SetEncryptedDataRequest,\n OpenTabRequest,\n OpenQueryTabRequest,\n OpenTableTableTabRequest,\n OpenTableStructureTabRequest,\n GetTableKeysRequest,\n} from \"./requestTypes\";\nimport type {\n GetTablesResponse,\n GetColumnsResponse,\n GetConnectionInfoResponse,\n RunQueryResponse,\n ExpandTableResultResponse,\n SetTabTitleResponse,\n GetViewStateResponse,\n SetViewStateResponse,\n OpenExternalResponse,\n GetDataResponse,\n SetDataResponse,\n GetEncryptedDataResponse,\n SetEncryptedDataResponse,\n OpenTabResponse,\n GetTableKeysResponse,\n GetAppInfoResponse,\n CheckForUpdateResponse,\n GetViewContextResponse,\n} from \"./responseTypes\";\n\n/**\n * Get a list of tables from the current database.\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getTables(schema?: string): Promise<GetTablesResponse['result']> {\n return await request({ name: \"getTables\", args: { schema } as GetTablesRequest['args'] });\n}\n\n/**\n * Get a list of columns from a table.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getColumns(table: string, schema?: string): Promise<GetColumnsResponse['result']> {\n return await request({ name: \"getColumns\", args: { table, schema } as GetColumnsRequest['args'] });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function getTableKeys(table: string, schema?: string): Promise<GetTableKeysResponse['result']> {\n return await request({ name: \"getTableKeys\", args: { table, schema } as GetTableKeysRequest['args'] });\n}\n\n/**\n * Get information about the current database connection.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getConnectionInfo(): Promise<GetConnectionInfoResponse['result']> {\n return await request({ name: \"getConnectionInfo\", args: void 0 });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function getAppInfo(): Promise<GetAppInfoResponse['result']> {\n return await request({ name: \"getAppInfo\", args: void 0 });\n}\n\n/**\n * Get the version of Beekeeper Studio\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getAppVersion(): Promise<\"5.3\" | (string & { __brand?: never })> {\n try {\n const appInfo = await getAppInfo();\n return appInfo.version;\n } catch (e){\n if (e instanceof Error && e.message.includes(\"Unknown request\")) {\n return \"5.3\";\n }\n throw e;\n }\n}\n\n/**\n * Check if plugin's update is available.\n *\n * @since Beekeeper Studio 5.4.0\n **/\nexport async function checkForUpdate(): Promise<CheckForUpdateResponse['result']> {\n return await request({ name: \"checkForUpdate\", args: void 0 });\n}\n\n/**\n * Execute a SQL query against the current database.\n *\n * WARNING: The query will be executed exactly as provided with no modification\n * or sanitization. Always validate and sanitize user input before including it\n * in queries to prevent unwanted actions.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function runQuery(query: string): Promise<RunQueryResponse['result']> {\n return await request({ name: \"runQuery\", args: { query } as RunQueryRequest['args'] });\n}\n\n/**\n * Display query results in the bottom table panel (shell-type tabs only).\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function expandTableResult(results: any[]): Promise<ExpandTableResultResponse['result']> {\n return await request({ name: \"expandTableResult\", args: { results } as ExpandTableResultRequest['args'] });\n}\n\n/**\n * Set the title of the current plugin tab.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function setTabTitle(title: string): Promise<SetTabTitleResponse['result']> {\n return await request({ name: \"setTabTitle\", args: { title } as SetTabTitleRequest['args'] });\n}\n\n/**\n * Get the current view context.\n *\n * A view context describes how this plugin view was opened and what data is\n * available for it. It always includes the static `command` from your\n * `manifest.json`, and may also include dynamic `params` depending on where\n * the menu was invoked.\n *\n * @since Beekeeper Studio 5.4.0\n **/\nexport async function getViewContext(): Promise<GetViewContextResponse['result']> {\n return await request({ name: \"getViewContext\", args: void 0 });\n}\n\n/**\n * Get the current state of your view instance.\n *\n * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getViewState<T>(): Promise<GetViewStateResponse<T>['result']> {\n return await request({ name: \"getViewState\", args: void 0 });\n}\n\n/**\n * Set the state of your view instance.\n *\n * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function setViewState<T>(state: T): Promise<SetViewStateResponse['result']> {\n return await request({ name: \"setViewState\", args: { state } as SetViewStateRequest<T>['args'] });\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function openExternal(link: string): Promise<OpenExternalResponse['result']> {\n return await request({ name: \"openExternal\", args: { link } as OpenExternalRequest['args'] });\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function getData<T>(key: string = \"default\"): Promise<GetDataResponse<T>['result']> {\n return await request({ name: \"getData\", args: { key } });\n}\n\n/**\n * Store data that can be retrieved later.\n *\n * @example\n * // Store with custom key\n * await setData(\"myKey\", { name: \"John\" });\n *\n * // Store with default key (equivalent to setData(\"default\", value))\n * await setData({ name: \"John\" });\n *\n * @since Beekeeper Studio 5.3.0\n */\nexport async function setData<T>(key: string, value: T): Promise<SetDataResponse['result']>;\nexport async function setData<T>(value: T): Promise<SetDataResponse['result']>;\nexport async function setData<T>(keyOrValue: string | T, value?: T): Promise<SetDataResponse['result']> {\n if (value !== undefined) {\n return await request({ name: \"setData\", args: { key: keyOrValue as string, value } as SetDataRequest<T>['args'] });\n } else {\n return await request({ name: \"setData\", args: { key: \"default\", value: keyOrValue as T } as SetDataRequest<T>['args'] });\n }\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function getEncryptedData<T>(key: string): Promise<GetEncryptedDataResponse<T>['result']> {\n return await request({ name: \"getEncryptedData\", args: { key } });\n}\n\n/**\n * Store encrypted data that can be retrieved later.\n *\n * @example\n * // Store with custom key\n * await setEncryptedData(\"secretKey\", { token: \"abc123\" });\n *\n * // Store with default key (equivalent to setEncryptedData(\"default\", value))\n * await setEncryptedData({ token: \"abc123\" });\n *\n * @since Beekeeper Studio 5.3.0\n */\nexport async function setEncryptedData<T>(key: string, value: T): Promise<SetEncryptedDataResponse['result']>;\nexport async function setEncryptedData<T>(value: T): Promise<SetEncryptedDataResponse['result']>;\nexport async function setEncryptedData<T>(keyOrValue: string | T, value?: T): Promise<SetEncryptedDataResponse['result']> {\n if (value !== undefined) {\n return await request({ name: \"setEncryptedData\", args: { key: keyOrValue as string, value } as SetEncryptedDataRequest<T>['args'] });\n } else {\n return await request({ name: \"setEncryptedData\", args: { key: \"default\", value: keyOrValue as T } as SetEncryptedDataRequest<T>['args'] });\n }\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function openTab(type: \"query\", args?: Omit<OpenQueryTabRequest['args'], 'type'>): Promise<OpenTabResponse>;\nexport async function openTab(type: \"tableTable\", args: Omit<OpenTableTableTabRequest['args'], 'type'>): Promise<OpenTabResponse>;\nexport async function openTab(type: \"tableStructure\", args: Omit<OpenTableStructureTabRequest['args'], 'type'>): Promise<OpenTabResponse>;\nexport async function openTab(type: OpenTabRequest['args']['type'], args?: Omit<OpenTabRequest['args'], 'type'>): Promise<OpenTabResponse> {\n return await request({ name: \"openTab\", args: { type, ...args } });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport const broadcast = {\n post<T extends JsonValue = JsonValue>(message: T) {\n return notify(\"broadcast\", { message });\n },\n on<T extends JsonValue = JsonValue>(handler: (message: T) => void) {\n addNotificationListener<T>(\"broadcast\", (params) => {\n handler(params.message);\n });\n },\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport const log = {\n error(err: string | Error) {\n return notify(\"pluginError\", {\n name: err.name || \"Error\",\n message: err.message || err,\n stack: err.stack,\n });\n },\n}\n\n/**\n * Clipboard interface.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport const clipboard = {\n /** Write text to the Electron clipboard. */\n async writeText(text: string): Promise<void> {\n await request({\n name: \"clipboard.writeText\",\n args: { text },\n });\n },\n /** Read text from the Electron clipboard. */\n async readText(): Promise<string> {\n return await request({\n name: \"clipboard.readText\",\n args: void 0,\n });\n },\n // async write() {},\n // async read() {},\n};\n\nexport * from \"./commonTypes\";\nexport * from \"./requestTypes\";\nexport * from \"./responseTypes\";\nexport * from \"./notificationTypes\";\nexport * from \"./comms\";\n\n"],"names":[],"mappings":"SAAgB,YAAY,GAAA;AAC1B,IAAA,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;AAC9B,IAAA,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC;AAE3B,IAAA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;AAChC,IAAA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;AAEhC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAE5E,OAAO;AACL,QAAA,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AACnB,QAAA,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;AACpB,QAAA,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AACrB,QAAA,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AACrB,QAAA,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;AAClB,KAAA,CAAC,IAAI,CAAC,GAAG,CAA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ACxC;AACD,IAAA,EAAE,CAAkC,OAA6B,EAAA;AAC/D,QAAA,uBAAuB,CAAI,WAAW,EAAE,CAAC,MAAM,KAAI;AACjD,YAAA,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;AACzB,SAAC,CAAC;KACH;;AAGH;AACa,MAAA,GAAG,GAAG;AACjB,IAAA,KAAK,CAAC,GAAmB,EAAA;QACvB,OAAO,MAAM,CAAC,aAAa,EAAE;AAC3B,YAAA,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,OAAO;AACzB,YAAA,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,GAAG;YAC3B,KAAK,EAAE,GAAG,CAAC,KAAK;AACjB,SAAA,CAAC;KACH;;AAGH;;;;AAII;AACS,MAAA,SAAS,GAAG;;IAEvB,MAAM,SAAS,CAAC,IAAY,EAAA;AAC1B,QAAA,MAAM,OAAO,CAAC;AACZ,YAAA,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,EAAE,IAAI,EAAE;AACf,SAAA,CAAC;KACH;;AAED,IAAA,MAAM,QAAQ,GAAA;QACZ,OAAO,MAAM,OAAO,CAAC;AACnB,YAAA,IAAI,EAAE,oBAAoB;YAC1B,IAAI,EAAE,MAAM;AACb,SAAA,CAAC;KACH;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { AppInfo, AppTheme, Column, ConnectionInfo, JsonValue, OpenQueryTabOptions, OpenTableStructureTabOptions, OpenTableTableTabOptions, PluginErrorObject, PluginViewContext, PrimaryKey, QueryResult, RequestFileSaveOptions, RunQueryResult, Table, TableIndex, TableKey, WindowEventObject } from \"./types\";\nimport type { RequestMap } from \"./internal\";\n\nexport * from \"./types\";\n\n/**\n * Get a list of schemas from the current database.\n *\n * @since Beekeeper Studio 5.5.0\n **/\nexport async function getSchemas(): Promise<string[]> {\n return await request({ name: \"getSchemas\", args: void 0 });\n}\n\n/**\n * Get a list of tables from the current database.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getTables(schema?: string): Promise<Table[]> {\n return await request({ name: \"getTables\", args: { schema } });\n}\n\n/**\n * Get a list of columns from a table.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getColumns(table: string, schema?: string): Promise<Column[]> {\n return await request({ name: \"getColumns\", args: { table, schema } });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function getTableKeys(table: string, schema?: string): Promise<TableKey[]> {\n return await request({ name: \"getTableKeys\", args: { table, schema } });\n}\n\n/** @since Beekeeper Studio 5.5.0 */\nexport async function getTableIndexes(table: string, schema?: string): Promise<TableIndex[]> {\n return await request({ name: \"getTableIndexes\", args: { table, schema } });\n}\n\nexport async function getPrimaryKeys(table: string, schema?: string): Promise<PrimaryKey[]> {\n return await request({ name: \"getPrimaryKeys\", args: { table, schema } });\n}\n\nexport async function getIncomingKeys(table: string, schema?: string): Promise<TableKey[]> {\n return await request({ name: \"getIncomingKeys\", args: { table, schema } });\n}\n\nexport async function getOutgoingKeys(table: string, schema?: string): Promise<TableKey[]> {\n return await request({ name: \"getOutgoingKeys\", args: { table, schema } });\n}\n\n/**\n * Get information about the current database connection.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getConnectionInfo(): Promise<ConnectionInfo> {\n return await request({ name: \"getConnectionInfo\", args: void 0 });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function getAppInfo(): Promise<AppInfo> {\n return await request({ name: \"getAppInfo\", args: void 0 });\n}\n\n/**\n * Get the version of Beekeeper Studio\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getAppVersion(): Promise<\"5.3\" | (string & { __brand?: never })> {\n try {\n const appInfo = await getAppInfo();\n return appInfo.version;\n } catch (e) {\n if (e instanceof Error && e.message.includes(\"Unknown request\")) {\n return \"5.3\";\n }\n throw e;\n }\n}\n\n/**\n * Check if plugin's update is available.\n *\n * @since Beekeeper Studio 5.4.0\n **/\nexport async function checkForUpdate(): Promise<boolean> {\n return await request({ name: \"checkForUpdate\", args: void 0 });\n}\n\n/**\n * Execute a SQL query against the current database.\n *\n * WARNING: The query will be executed exactly as provided with no modification\n * or sanitization. Always validate and sanitize user input before including it\n * in queries to prevent unwanted actions.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function runQuery(query: string): Promise<RunQueryResult> {\n return await request({ name: \"runQuery\", args: { query } });\n}\n\n/**\n * Display query results in the bottom table panel (shell-type tabs only).\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function expandTableResult(results: QueryResult[]): Promise<void> {\n return await request({ name: \"expandTableResult\", args: { results } });\n}\n\n/**\n * Set the title of the current plugin tab.\n *\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function setTabTitle(title: string): Promise<void> {\n return await request({ name: \"setTabTitle\", args: { title } });\n}\n\n/**\n * Get the current view context.\n *\n * A view context describes how this plugin view was opened and what data is\n * available for it. It always includes the static `command` from your\n * `manifest.json`, and may also include dynamic `params` depending on where\n * the menu was invoked.\n *\n * @since Beekeeper Studio 5.4.0\n **/\nexport async function getViewContext(): Promise<PluginViewContext> {\n return await request({ name: \"getViewContext\", args: void 0 });\n}\n\n/**\n * Get the current state of your view instance.\n *\n * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function getViewState<T = unknown>(): Promise<T> {\n return await request({ name: \"getViewState\", args: void 0 });\n}\n\n/**\n * Set the state of your view instance.\n *\n * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}\n * @since Beekeeper Studio 5.3.0\n **/\nexport async function setViewState<T = unknown>(state: T): Promise<void> {\n return await request({ name: \"setViewState\", args: { state } });\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function openExternal(link: string): Promise<void> {\n return await request({ name: \"openExternal\", args: { link } });\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function getData<T = unknown>(key: string = \"default\"): Promise<T> {\n return await request({ name: \"getData\", args: { key } });\n}\n\n/**\n * Store data that can be retrieved later.\n *\n * @example\n * // Store with custom key\n * await setData(\"myKey\", { name: \"John\" });\n *\n * // Store with default key (equivalent to setData(\"default\", value))\n * await setData({ name: \"John\" });\n *\n * @since Beekeeper Studio 5.3.0\n */\nexport async function setData<T = unknown>(key: string, value: T): Promise<void>;\nexport async function setData<T = unknown>(value: T): Promise<void>;\nexport async function setData<T = unknown>(keyOrValue: string | T, value?: T): Promise<void> {\n if (value !== undefined) {\n return await request({ name: \"setData\", args: { key: keyOrValue as string, value } });\n } else {\n return await request({ name: \"setData\", args: { key: \"default\", value: keyOrValue as T } });\n }\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport async function getEncryptedData<T>(key: string): Promise<T> {\n return await request({ name: \"getEncryptedData\", args: { key } });\n}\n\n/**\n * Store encrypted data that can be retrieved later.\n *\n * @example\n * // Store with custom key\n * await setEncryptedData(\"secretKey\", { token: \"abc123\" });\n *\n * // Store with default key (equivalent to setEncryptedData(\"default\", value))\n * await setEncryptedData({ token: \"abc123\" });\n *\n * @since Beekeeper Studio 5.3.0\n */\nexport async function setEncryptedData<T = unknown>(key: string, value: T): Promise<void>;\nexport async function setEncryptedData<T = unknown>(value: T): Promise<void>;\nexport async function setEncryptedData<T = unknown>(keyOrValue: string | T, value?: T): Promise<void> {\n if (value !== undefined) {\n return await request({ name: \"setEncryptedData\", args: { key: keyOrValue as string, value } });\n } else {\n return await request({ name: \"setEncryptedData\", args: { key: \"default\", value: keyOrValue as T } });\n }\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport async function openTab(type: \"query\", options?: OpenQueryTabOptions): Promise<void>;\nexport async function openTab(type: \"tableTable\", options: OpenTableTableTabOptions): Promise<void>;\nexport async function openTab(type: \"tableStructure\", options: OpenTableStructureTabOptions): Promise<void>;\nexport async function openTab(\n type: \"query\" | \"tableTable\" | \"tableStructure\",\n options?:\n OpenQueryTabOptions\n | OpenTableTableTabOptions\n | OpenTableStructureTabOptions\n): Promise<void> {\n return await request({ name: \"openTab\", args: { type, ...options } });\n}\n\nexport async function requestFileSave(options: RequestFileSaveOptions): Promise<void> {\n return await request({ name: \"requestFileSave\", args: options });\n}\n\nexport async function showStatusBarUI(): Promise<void> {\n return await request({ name: \"toggleStatusBarUI\", args: { force: true } });\n}\n\nexport async function hideStatusBarUI(): Promise<void> {\n return await request({ name: \"toggleStatusBarUI\", args: { force: false } });\n}\n\nexport async function toggleStatusBarUI(): Promise<void> {\n return await request({ name: \"toggleStatusBarUI\", args: void 0 });\n}\n\n/** @since Beekeeper Studio 5.4.0 */\nexport const broadcast = {\n post<T extends JsonValue = JsonValue>(message: T): void {\n return notify(\"broadcast\", { message });\n },\n on<T extends JsonValue = JsonValue>(handler: (message: T) => void): void {\n addNotificationListener<T>(\"broadcast\", (params) => {\n handler(params.message);\n });\n },\n}\n\n/** @since Beekeeper Studio 5.3.0 */\nexport const log = {\n error(err: string | Error): void {\n if (typeof err === \"string\") {\n return notify(\"pluginError\", {\n name: \"Error\",\n message: err,\n stack: undefined,\n });\n }\n return notify(\"pluginError\", {\n name: err.name || \"Error\",\n message: err.message,\n stack: err.stack,\n });\n },\n}\n\n/** Clipboard interface. */\nexport const clipboard = {\n /** Write text to the Electron clipboard.\n * @since Beekeeper Studio 5.3.0 */\n async writeText(text: string): Promise<void> {\n await request({\n name: \"clipboard.writeText\",\n args: { text },\n });\n },\n /** Read text from the Electron clipboard.\n * @since Beekeeper Studio 5.3.0 */\n async readText(): Promise<string> {\n return await request({\n name: \"clipboard.readText\",\n args: void 0,\n });\n },\n /** @param data - Base64 encoded image data.\n * @since Beekeeper Studio 5.5.0 */\n async writeImage(data: string) {\n await request({\n name: \"clipboard.writeImage\",\n args: { data },\n });\n },\n // async write() {},\n // async read() {},\n};\n\nlet debugComms = false;\n\nexport function setDebugComms(enabled: boolean) {\n debugComms = enabled;\n}\n\nexport function notify<Message extends JsonValue = JsonValue>(\n name: \"broadcast\",\n args: { message: Message; }\n): void;\nexport function notify(name: \"pluginError\", args: PluginErrorObject): void;\nexport function notify(name: \"windowEvent\", args: WindowEventObject): void;\nexport function notify(name: string, args: any) {\n const payload = { name, args };\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);\n console.log(\"args:\", args);\n console.log(\"payload:\", payload);\n console.groupEnd();\n }\n window.parent.postMessage(payload, \"*\");\n}\n\nexport function addNotificationListener(\n name: \"tablesChanged\",\n handler: () => void,\n): void;\nexport function addNotificationListener<Message extends JsonValue = JsonValue>(\n name: \"broadcast\",\n handler: (args: { message: Message; }) => void,\n): void;\nexport function addNotificationListener(\n name: \"themeChanged\",\n handler: (args: AppTheme) => void,\n): void;\nexport function addNotificationListener(\n name: string,\n handler: (args: any) => void,\n) {\n if (!notificationListeners.get(name)) {\n notificationListeners.set(name, []);\n }\n notificationListeners.get(name)!.push(handler);\n}\n\nexport function removeNotificationListener(\n name: \"tablesChanged\",\n handler: (args: any) => void\n): void;\nexport function removeNotificationListener<Message extends JsonValue = JsonValue>(\n name: \"broadcast\",\n handler: (args: any) => void\n): void;\nexport function removeNotificationListener(\n name: \"themeChanged\",\n handler: (args: any) => void\n): void;\nexport function removeNotificationListener(\n name: string,\n handler: (args: any) => void\n) {\n const handlers = notificationListeners.get(name);\n if (handlers) {\n const index = handlers.indexOf(handler);\n if (index > -1) {\n handlers.splice(index, 1);\n }\n }\n}\n\nconst pendingRequests = new Map<\n string,\n {\n // The whole payload is kept just in case for debugging\n payload: any;\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }\n>();\n\nexport async function request<T extends keyof RequestMap>(\n raw: { name: T; args: RequestMap[T][\"args\"] }\n): Promise<RequestMap[T][\"return\"]> {\n const payload = { id: generateUUID(), ...raw };\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);\n console.log(\"id:\", payload.id);\n console.log(\"args:\", payload.args);\n console.log(\"payload:\", payload);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n pendingRequests.set(payload.id, { payload: payload, resolve, reject });\n window.parent.postMessage(payload, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nwindow.addEventListener(\"message\", (event) => {\n const { id, name, args, result, error } = event.data || {};\n\n if (name) {\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [NOTIFICATION] ${name}`);\n console.log(\"Args:\", args);\n console.groupEnd();\n }\n\n const handlers = notificationListeners.get(name);\n if (handlers) {\n handlers.forEach((handler) => handler(args));\n }\n }\n\n if (id && pendingRequests.has(id)) {\n const { resolve, reject, payload } = pendingRequests.get(id)!;\n pendingRequests.delete(id);\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [RESPONSE] ${payload.name}`);\n console.log(\"Result:\", result);\n if (error) console.error(\"Error:\", error);\n console.groupEnd();\n }\n\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n }\n});\n\nfunction generateUUID() {\n const buf = new Uint8Array(16);\n crypto.getRandomValues(buf);\n\n buf[6] = (buf[6] & 0x0f) | 0x40; // version 4\n buf[8] = (buf[8] & 0x3f) | 0x80; // variant\n\n const hex = Array.from(buf, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n\n return [\n hex.substring(0, 8),\n hex.substring(8, 12),\n hex.substring(12, 16),\n hex.substring(16, 20),\n hex.substring(20),\n ].join(\"-\");\n}\n\n"],"names":[],"mappings":"AAKA;;;;AAII;AACG,eAAe,UAAU,GAAA;AAC9B,IAAA,OAAO,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5D;AAEA;;;;AAII;AACG,eAAe,SAAS,CAAC,MAAe,EAAA;AAC7C,IAAA,OAAO,MAAM,OAAO,CAAC,EAA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