@beekeeperstudio/plugin 1.0.10 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/eventForwarder.js +1 -1
- package/dist/eventForwarder.js.map +1 -1
- package/dist/index.d.ts +102 -48
- package/dist/index.js +55 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# @beekeeperstudio/plugin
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A tiny wrapper of `window.postMessage` for building Beekeeper Studio plugins with TypeScript support.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install @beekeeperstudio/plugin
|
|
9
9
|
# or
|
|
10
|
-
yarn add
|
|
10
|
+
yarn add @beekeeperstudio/plugin
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import {
|
|
16
|
+
import { getTables, runQuery } from '@beekeeperstudio/plugin';
|
|
17
17
|
|
|
18
18
|
// Get all tables in the current database
|
|
19
|
-
const tables = await
|
|
19
|
+
const tables = await getTables();
|
|
20
20
|
|
|
21
21
|
// Run a SQL query
|
|
22
|
-
const result = await
|
|
22
|
+
const result = await runQuery({ query: 'SELECT * FROM users LIMIT 10' });
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Development
|
package/dist/eventForwarder.js
CHANGED
|
@@ -8,7 +8,7 @@ window.addEventListener("message", (event) => {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
if (id && pendingRequests.has(id)) {
|
|
11
|
-
const { resolve, reject,
|
|
11
|
+
const { resolve, reject, payload } = pendingRequests.get(id);
|
|
12
12
|
pendingRequests.delete(id);
|
|
13
13
|
if (error) {
|
|
14
14
|
reject(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventForwarder.js","sources":["../src/comms.ts","../src/eventForwarder.ts"],"sourcesContent":["import type {\n GetTablesRequest,\n GetColumnsRequest,\n RunQueryRequest,\n ExpandTableResultRequest,\n SetTabTitleRequest,\n GetViewStateRequest,\n SetViewStateRequest,\n OpenExternalRequest,\n} from \"./requestTypes\";\nimport type {\n GetTablesResponse,\n GetColumnsResponse,\n GetConnectionInfoResponse,\n GetAllTabsResponse,\n RunQueryResponse,\n ExpandTableResultResponse,\n SetTabTitleResponse,\n GetViewStateResponse,\n SetViewStateResponse,\n OpenExternalResponse,\n} from \"./responseTypes\";\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 name: string;\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }\n>();\n\nlet debugComms = false;\n\nexport function setDebugComms(value: boolean) {\n debugComms = value;\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, name } = pendingRequests.get(id)!;\n pendingRequests.delete(id);\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [RESPONSE] ${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(name: \"getTables\", args?: GetTablesRequest[\"args\"]): Promise<GetTablesResponse>;\nexport async function request(name: \"getColumns\", args: GetColumnsRequest[\"args\"]): Promise<GetColumnsResponse>;\nexport async function request(name: \"getConnectionInfo\"): Promise<GetConnectionInfoResponse>;\nexport async function request(name: \"getAllTabs\"): Promise<GetAllTabsResponse>;\nexport async function request(name: \"runQuery\", args: RunQueryRequest[\"args\"]): Promise<RunQueryResponse>;\nexport async function request(name: \"expandTableResult\", args: ExpandTableResultRequest[\"args\"]): Promise<ExpandTableResultResponse>;\nexport async function request(name: \"setTabTitle\", args: SetTabTitleRequest[\"args\"]): Promise<SetTabTitleResponse>;\nexport async function request<T extends unknown>(name: \"getViewState\", args: GetViewStateRequest[\"args\"]): Promise<GetViewStateResponse<T>>;\nexport async function request<T extends unknown>(name: \"setViewState\", args: SetViewStateRequest<T>[\"args\"]): Promise<SetViewStateResponse>;\nexport async function request<T extends unknown>(name: \"openExternal\", args: OpenExternalRequest[\"args\"]): Promise<OpenExternalResponse>;\nexport async function request(name: unknown, args?: unknown): Promise<unknown> {\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${name}`);\n console.log(\"Args:\", args);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n const id = generateUUID();\n const data = { id, name, args };\n pendingRequests.set(id, { name: name as string, resolve, reject });\n window.parent.postMessage(data, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nexport function notify(name: string, args: any) {\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 window.parent.postMessage({ name, args }, \"*\");\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nexport async 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","/** Any events that need to be forwarded to parent/plugin system\n * must go here */\n\n/** FIXME this file must be injected from the plugin system automatically */\n\nimport { notify } from \"./comms\";\nimport { WindowEventInits, WindowEventClass } from \"./commonTypes\";\n\nfunction createEventInit<T>(event: T): {\n eventClass: WindowEventClass;\n eventInitOptions: WindowEventInits;\n} {\n if (event instanceof MouseEvent) {\n const eventInitOptions: MouseEventInit = {\n clientX: event.clientX,\n clientY: event.clientY,\n screenX: event.screenX,\n screenY: event.screenY,\n button: event.button,\n buttons: event.buttons,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n detail: event.detail,\n };\n return {\n eventClass: \"MouseEvent\",\n eventInitOptions,\n };\n }\n\n if (event instanceof PointerEvent) {\n const eventInitOptions: PointerEventInit = {\n clientX: event.clientX,\n clientY: event.clientY,\n screenX: event.screenX,\n screenY: event.screenY,\n button: event.button,\n buttons: event.buttons,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n detail: event.detail,\n pointerId: event.pointerId,\n pointerType: event.pointerType,\n isPrimary: event.isPrimary,\n };\n return {\n eventClass: \"PointerEvent\",\n eventInitOptions,\n };\n }\n\n if (event instanceof KeyboardEvent) {\n const isPasswordField =\n (event.target as HTMLInputElement)?.type === \"password\";\n\n if (isPasswordField) {\n // Avoid logging keystrokes from password fields\n return {\n eventClass: \"KeyboardEvent\",\n eventInitOptions: {},\n };\n }\n\n const eventInitOptions: KeyboardEventInit = {\n key: event.key,\n code: event.code,\n keyCode: event.keyCode,\n location: event.location,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n repeat: event.repeat,\n isComposing: event.isComposing,\n };\n\n return {\n eventClass: \"KeyboardEvent\",\n eventInitOptions,\n };\n }\n\n return {\n eventClass: \"Event\",\n eventInitOptions: {},\n };\n}\n\nconst forwardedEvents = [\n \"contextmenu\",\n \"click\",\n \"dblclick\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"keydown\",\n \"keypress\",\n \"keyup\",\n] as const;\n\nforwardedEvents.forEach((eventType) => {\n document.addEventListener(eventType, (event) => {\n const eventInit = createEventInit(event);\n notify(\"windowEvent\", {\n eventType,\n eventClass: eventInit.eventClass,\n eventInitOptions: eventInit.eventInitOptions,\n });\n });\n});\n"],"names":[],"mappings":"AAiCA,MAAM,eAAe,GAAG,IAAI,GAAG,EAO5B;AAQH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,KAAI;AAC3C,IAAA,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE;IAE1D,IAAI,IAAI,EAAE;QAQR,MAAM,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC;QAChD,IAAI,QAAQ,EAAE;AACZ,YAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;;;IAIhD,IAAI,EAAE,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;AACjC,QAAA,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,EAAE,CAAE;AAC1D,QAAA,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAU1B,IAAI,KAAK,EAAE;YACT,MAAM,CAAC,KAAK,CAAC;;aACR;YACL,OAAO,CAAC,MAAM,CAAC;;;AAGrB,CAAC,CAAC;AAgCc,SAAA,MAAM,CAAC,IAAY,EAAE,IAAS,EAAA;AAO5C,IA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AAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,UAAU;IACV,WAAW;IACX,SAAS;IACT,SAAS;IACT,UAAU;IACV,OAAO;CACC;AAEV,eAAe,CAAC,OAAO,CAAC,CAAC,SAAS,KAAI;IACpC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,KAAI;AAC7C,QAAA,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;QACxC,MAAM,CAAC,aAAa,EAAE;YACpB,SAAS;YACT,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;AAC7C,SAAA,CAAC;AACJ,KAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"eventForwarder.js","sources":["../src/comms.ts","../src/eventForwarder.ts"],"sourcesContent":["import 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(value: boolean) {\n debugComms = value;\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(payload: any): Promise<any> {\n const fullPayload = {\n id: generateUUID(),\n ...payload,\n } as PluginRequestPayload;\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);\n console.log(\"Args:\", payload.args);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n pendingRequests.set(fullPayload.id, { payload: fullPayload, resolve, reject });\n window.parent.postMessage(payload, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nexport function notify(name: string, args: any) {\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 window.parent.postMessage({ name, args }, \"*\");\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nexport async 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","/** Any events that need to be forwarded to parent/plugin system\n * must go here */\n\n/** FIXME this file must be injected from the plugin system automatically */\n\nimport { notify } from \"./comms\";\nimport { WindowEventInits, WindowEventClass } from \"./commonTypes\";\n\nfunction createEventInit<T>(event: T): {\n eventClass: WindowEventClass;\n eventInitOptions: WindowEventInits;\n} {\n if (event instanceof MouseEvent) {\n const eventInitOptions: MouseEventInit = {\n clientX: event.clientX,\n clientY: event.clientY,\n screenX: event.screenX,\n screenY: event.screenY,\n button: event.button,\n buttons: event.buttons,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n detail: event.detail,\n };\n return {\n eventClass: \"MouseEvent\",\n eventInitOptions,\n };\n }\n\n if (event instanceof PointerEvent) {\n const eventInitOptions: PointerEventInit = {\n clientX: event.clientX,\n clientY: event.clientY,\n screenX: event.screenX,\n screenY: event.screenY,\n button: event.button,\n buttons: event.buttons,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n movementX: event.movementX,\n movementY: event.movementY,\n detail: event.detail,\n pointerId: event.pointerId,\n pointerType: event.pointerType,\n isPrimary: event.isPrimary,\n };\n return {\n eventClass: \"PointerEvent\",\n eventInitOptions,\n };\n }\n\n if (event instanceof KeyboardEvent) {\n const isPasswordField =\n (event.target as HTMLInputElement)?.type === \"password\";\n\n if (isPasswordField) {\n // Avoid logging keystrokes from password fields\n return {\n eventClass: \"KeyboardEvent\",\n eventInitOptions: {},\n };\n }\n\n const eventInitOptions: KeyboardEventInit = {\n key: event.key,\n code: event.code,\n keyCode: event.keyCode,\n location: event.location,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n repeat: event.repeat,\n isComposing: event.isComposing,\n };\n\n return {\n eventClass: \"KeyboardEvent\",\n eventInitOptions,\n };\n }\n\n return {\n eventClass: \"Event\",\n eventInitOptions: {},\n };\n}\n\nconst forwardedEvents = [\n \"contextmenu\",\n \"click\",\n \"dblclick\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"keydown\",\n \"keypress\",\n \"keyup\",\n] as const;\n\nforwardedEvents.forEach((eventType) => {\n document.addEventListener(eventType, (event) => {\n const eventInit = createEventInit(event);\n notify(\"windowEvent\", {\n eventType,\n eventClass: eventInit.eventClass,\n eventInitOptions: eventInit.eventInitOptions,\n });\n });\n});\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gBAAgB;AAC7C,SAAA,CAAC;AACJ,KAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -68,44 +68,97 @@ interface OpenExternalRequest extends BaseRequest {
|
|
|
68
68
|
link: boolean;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
interface SetDataRequest<T extends unknown> extends BaseRequest {
|
|
72
|
+
name: "setData";
|
|
73
|
+
args: T;
|
|
74
|
+
}
|
|
75
|
+
interface GetDataRequest extends BaseRequest {
|
|
76
|
+
name: "getData";
|
|
77
|
+
args: void;
|
|
78
|
+
}
|
|
79
|
+
interface GetEncryptedDataRequest extends BaseRequest {
|
|
80
|
+
name: "getEncryptedData";
|
|
81
|
+
args: void;
|
|
82
|
+
}
|
|
83
|
+
interface SetEncryptedDataRequest<T extends unknown> extends BaseRequest {
|
|
84
|
+
name: "setEncryptedData";
|
|
85
|
+
args: T;
|
|
86
|
+
}
|
|
87
|
+
type PluginRequestData = GetTablesRequest | GetColumnsRequest | GetConnectionInfoRequest | GetAllTabsRequest | RunQueryRequest | ExpandTableResultRequest | SetTabTitleRequest | GetViewStateRequest | SetViewStateRequest<unknown> | OpenExternalRequest | GetDataRequest | SetDataRequest<unknown> | GetEncryptedDataRequest | SetEncryptedDataRequest<unknown>;
|
|
88
|
+
type PluginRequestPayload = PluginRequestData;
|
|
72
89
|
|
|
73
90
|
type TabType = string;
|
|
74
91
|
type TableFilter = any;
|
|
75
92
|
type TableOrView = any;
|
|
76
|
-
|
|
77
|
-
/** The list of tables */
|
|
78
|
-
type GetTablesResponse = {
|
|
79
|
-
name: string;
|
|
80
|
-
schema?: string;
|
|
81
|
-
}[];
|
|
82
|
-
/** The list of columns */
|
|
83
|
-
type GetColumnsResponse = {
|
|
84
|
-
name: string;
|
|
85
|
-
type: string;
|
|
86
|
-
}[];
|
|
87
|
-
type GetConnectionInfoResponse = {
|
|
88
|
-
connectionType: string;
|
|
89
|
-
databaseName: string;
|
|
90
|
-
defaultSchema?: string;
|
|
91
|
-
readOnlyMode: boolean;
|
|
92
|
-
};
|
|
93
|
-
type TabResponse = BaseTabResponse | QueryTabResponse | TableTabResponse;
|
|
94
|
-
type GetAllTabsResponse = TabResponse[];
|
|
95
|
-
type RunQueryResponse = {
|
|
96
|
-
results: QueryResult[];
|
|
97
|
-
error?: unknown;
|
|
98
|
-
};
|
|
99
|
-
type ExpandTableResultResponse = void;
|
|
100
|
-
type SetTabTitleResponse = void;
|
|
101
|
-
type GetViewStateResponse<T extends unknown> = T;
|
|
102
|
-
type SetViewStateResponse = void;
|
|
103
|
-
type OpenExternalResponse = void;
|
|
104
|
-
interface PluginResponseData {
|
|
93
|
+
interface BaseResponse {
|
|
105
94
|
id: string;
|
|
106
|
-
result: GetTablesResponse | GetColumnsResponse | GetConnectionInfoResponse | GetAllTabsResponse | RunQueryResponse | ExpandTableResultResponse | SetTabTitleResponse | GetViewStateResponse<unknown> | SetViewStateResponse | OpenExternalResponse;
|
|
107
95
|
error?: Error;
|
|
108
96
|
}
|
|
97
|
+
interface GetTablesResponse extends BaseResponse {
|
|
98
|
+
result: {
|
|
99
|
+
name: string;
|
|
100
|
+
schema?: string;
|
|
101
|
+
}[];
|
|
102
|
+
}
|
|
103
|
+
interface GetColumnsResponse extends BaseResponse {
|
|
104
|
+
result: {
|
|
105
|
+
name: string;
|
|
106
|
+
type: string;
|
|
107
|
+
}[];
|
|
108
|
+
}
|
|
109
|
+
interface GetConnectionInfoResponse extends BaseResponse {
|
|
110
|
+
result: {
|
|
111
|
+
connectionType: string;
|
|
112
|
+
databaseName: string;
|
|
113
|
+
defaultSchema?: string;
|
|
114
|
+
readOnlyMode: boolean;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface GetAllTabsResponse extends BaseResponse {
|
|
118
|
+
result: Tab[];
|
|
119
|
+
}
|
|
120
|
+
interface RunQueryResponse extends BaseResponse {
|
|
121
|
+
result: {
|
|
122
|
+
results: QueryResult[];
|
|
123
|
+
error?: unknown;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface ExpandTableResultResponse extends BaseResponse {
|
|
127
|
+
result: void;
|
|
128
|
+
}
|
|
129
|
+
interface SetTabTitleResponse extends BaseResponse {
|
|
130
|
+
result: void;
|
|
131
|
+
}
|
|
132
|
+
interface GetViewStateResponse<T extends unknown> extends BaseResponse {
|
|
133
|
+
result: T;
|
|
134
|
+
}
|
|
135
|
+
interface SetViewStateResponse extends BaseResponse {
|
|
136
|
+
result: void;
|
|
137
|
+
}
|
|
138
|
+
interface OpenExternalResponse extends BaseResponse {
|
|
139
|
+
result: void;
|
|
140
|
+
}
|
|
141
|
+
interface GetDataResponse<T extends unknown> extends BaseResponse {
|
|
142
|
+
result: T;
|
|
143
|
+
}
|
|
144
|
+
interface SetDataResponse extends BaseResponse {
|
|
145
|
+
result: void;
|
|
146
|
+
}
|
|
147
|
+
interface GetEncryptedDataResponse<T extends unknown> extends BaseResponse {
|
|
148
|
+
result: T;
|
|
149
|
+
}
|
|
150
|
+
interface SetEncryptedDataResponse extends BaseResponse {
|
|
151
|
+
result: void;
|
|
152
|
+
}
|
|
153
|
+
type PluginResponseData = GetTablesResponse | GetColumnsResponse | GetConnectionInfoResponse | GetAllTabsResponse | RunQueryResponse | ExpandTableResultResponse | SetTabTitleResponse | GetViewStateResponse<unknown> | SetViewStateResponse | OpenExternalResponse | GetDataResponse<unknown> | SetDataResponse | GetEncryptedDataResponse<unknown> | SetEncryptedDataResponse;
|
|
154
|
+
type PluginResponsePayload = PluginResponseData;
|
|
155
|
+
type TabResponse = Tab;
|
|
156
|
+
type Tab = BaseTabResponse | QueryTabResponse | TableTabResponse;
|
|
157
|
+
interface BaseTabResponse {
|
|
158
|
+
type: TabType;
|
|
159
|
+
id: number;
|
|
160
|
+
title: string;
|
|
161
|
+
}
|
|
109
162
|
interface QueryTabResponse extends BaseTabResponse {
|
|
110
163
|
type: "query";
|
|
111
164
|
data: {
|
|
@@ -121,11 +174,6 @@ interface TableTabResponse extends BaseTabResponse {
|
|
|
121
174
|
result: unknown;
|
|
122
175
|
};
|
|
123
176
|
}
|
|
124
|
-
interface BaseTabResponse {
|
|
125
|
-
type: TabType;
|
|
126
|
-
id: number;
|
|
127
|
-
title: string;
|
|
128
|
-
}
|
|
129
177
|
|
|
130
178
|
interface ThemeChangedNotification {
|
|
131
179
|
name: "themeChanged";
|
|
@@ -153,18 +201,24 @@ declare global {
|
|
|
153
201
|
}
|
|
154
202
|
}
|
|
155
203
|
declare function setDebugComms(value: boolean): void;
|
|
156
|
-
declare function request(
|
|
157
|
-
declare function request(name: "getColumns", args: GetColumnsRequest["args"]): Promise<GetColumnsResponse>;
|
|
158
|
-
declare function request(name: "getConnectionInfo"): Promise<GetConnectionInfoResponse>;
|
|
159
|
-
declare function request(name: "getAllTabs"): Promise<GetAllTabsResponse>;
|
|
160
|
-
declare function request(name: "runQuery", args: RunQueryRequest["args"]): Promise<RunQueryResponse>;
|
|
161
|
-
declare function request(name: "expandTableResult", args: ExpandTableResultRequest["args"]): Promise<ExpandTableResultResponse>;
|
|
162
|
-
declare function request(name: "setTabTitle", args: SetTabTitleRequest["args"]): Promise<SetTabTitleResponse>;
|
|
163
|
-
declare function request<T extends unknown>(name: "getViewState", args: GetViewStateRequest["args"]): Promise<GetViewStateResponse<T>>;
|
|
164
|
-
declare function request<T extends unknown>(name: "setViewState", args: SetViewStateRequest<T>["args"]): Promise<SetViewStateResponse>;
|
|
165
|
-
declare function request<T extends unknown>(name: "openExternal", args: OpenExternalRequest["args"]): Promise<OpenExternalResponse>;
|
|
204
|
+
declare function request(payload: any): Promise<any>;
|
|
166
205
|
declare function notify(name: string, args: any): void;
|
|
167
206
|
declare function addNotificationListener(name: string, handler: (args: any) => void): Promise<void>;
|
|
168
207
|
|
|
169
|
-
|
|
170
|
-
|
|
208
|
+
declare function getTables(args?: GetTablesRequest['args']): Promise<GetTablesResponse['result']>;
|
|
209
|
+
declare function getColumns(args: GetColumnsRequest['args']): Promise<GetColumnsResponse['result']>;
|
|
210
|
+
declare function getConnectionInfo(): Promise<GetConnectionInfoResponse['result']>;
|
|
211
|
+
declare function getAllTabs(): Promise<GetAllTabsResponse['result']>;
|
|
212
|
+
declare function runQuery(args: RunQueryRequest['args']): Promise<RunQueryResponse['result']>;
|
|
213
|
+
declare function expandTableResult(args: ExpandTableResultRequest['args']): Promise<ExpandTableResultResponse['result']>;
|
|
214
|
+
declare function setTabTitle(args: SetTabTitleRequest['args']): Promise<SetTabTitleResponse['result']>;
|
|
215
|
+
declare function getViewState<T>(): Promise<GetViewStateResponse<T>['result']>;
|
|
216
|
+
declare function setViewState<T>(args: SetViewStateRequest<T>['args']): Promise<SetViewStateResponse['result']>;
|
|
217
|
+
declare function openExternal(args: OpenExternalRequest['args']): Promise<OpenExternalResponse['result']>;
|
|
218
|
+
declare function getData<T>(): Promise<GetDataResponse<T>['result']>;
|
|
219
|
+
declare function setData<T>(args: SetDataRequest<T>['args']): Promise<SetDataResponse['result']>;
|
|
220
|
+
declare function getEncryptedData<T>(): Promise<GetEncryptedDataResponse<T>['result']>;
|
|
221
|
+
declare function setEncryptedData<T>(args: SetEncryptedDataRequest<T>['args']): Promise<SetEncryptedDataResponse['result']>;
|
|
222
|
+
|
|
223
|
+
export { addNotificationListener, expandTableResult, getAllTabs, getColumns, getConnectionInfo, getData, getEncryptedData, getTables, getViewState, notify, openExternal, request, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState };
|
|
224
|
+
export type { ExpandTableResultRequest, ExpandTableResultResponse, GetAllTabsRequest, GetAllTabsResponse, GetColumnsRequest, GetColumnsResponse, GetConnectionInfoRequest, GetConnectionInfoResponse, GetDataRequest, GetDataResponse, GetEncryptedDataRequest, GetEncryptedDataResponse, GetTablesRequest, GetTablesResponse, GetViewStateRequest, GetViewStateResponse, OpenExternalRequest, OpenExternalResponse, PluginNotificationData, PluginRequestData, PluginRequestPayload, PluginResponseData, PluginResponsePayload, QueryResult, RunQueryRequest, RunQueryResponse, SetDataRequest, SetDataResponse, SetEncryptedDataRequest, SetEncryptedDataResponse, SetTabTitleRequest, SetTabTitleResponse, SetViewStateRequest, SetViewStateResponse, TabResponse, ThemeChangedNotification, ThemeType, WindowEventClass, WindowEventInits, WindowEventNotification };
|
package/dist/index.js
CHANGED
|
@@ -33,11 +33,11 @@ window.addEventListener("message", (event) => {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
if (id && pendingRequests.has(id)) {
|
|
36
|
-
const { resolve, reject,
|
|
36
|
+
const { resolve, reject, payload } = pendingRequests.get(id);
|
|
37
37
|
pendingRequests.delete(id);
|
|
38
38
|
if (debugComms) {
|
|
39
39
|
const time = new Date().toLocaleTimeString("en-GB");
|
|
40
|
-
console.groupCollapsed(`${time} [RESPONSE] ${name}`);
|
|
40
|
+
console.groupCollapsed(`${time} [RESPONSE] ${payload.name}`);
|
|
41
41
|
console.log("Result:", result);
|
|
42
42
|
if (error)
|
|
43
43
|
console.error("Error:", error);
|
|
@@ -51,19 +51,21 @@ window.addEventListener("message", (event) => {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
async function request(
|
|
54
|
+
async function request(payload) {
|
|
55
|
+
const fullPayload = {
|
|
56
|
+
id: generateUUID(),
|
|
57
|
+
...payload,
|
|
58
|
+
};
|
|
55
59
|
if (debugComms) {
|
|
56
60
|
const time = new Date().toLocaleTimeString("en-GB");
|
|
57
|
-
console.groupCollapsed(`${time} [REQUEST] ${name}`);
|
|
58
|
-
console.log("Args:", args);
|
|
61
|
+
console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);
|
|
62
|
+
console.log("Args:", payload.args);
|
|
59
63
|
console.groupEnd();
|
|
60
64
|
}
|
|
61
65
|
return new Promise((resolve, reject) => {
|
|
62
66
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
pendingRequests.set(id, { name: name, resolve, reject });
|
|
66
|
-
window.parent.postMessage(data, "*");
|
|
67
|
+
pendingRequests.set(fullPayload.id, { payload: fullPayload, resolve, reject });
|
|
68
|
+
window.parent.postMessage(payload, "*");
|
|
67
69
|
}
|
|
68
70
|
catch (e) {
|
|
69
71
|
reject(e);
|
|
@@ -87,5 +89,48 @@ async function addNotificationListener(name, handler) {
|
|
|
87
89
|
notificationListeners.get(name).push(handler);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
async function getTables(args) {
|
|
93
|
+
return await request({ name: "getTables", args: args || {} });
|
|
94
|
+
}
|
|
95
|
+
async function getColumns(args) {
|
|
96
|
+
return await request({ name: "getColumns", args });
|
|
97
|
+
}
|
|
98
|
+
async function getConnectionInfo() {
|
|
99
|
+
return await request({ name: "getConnectionInfo", args: void 0 });
|
|
100
|
+
}
|
|
101
|
+
async function getAllTabs() {
|
|
102
|
+
return await request({ name: "getAllTabs", args: void 0 });
|
|
103
|
+
}
|
|
104
|
+
async function runQuery(args) {
|
|
105
|
+
return await request({ name: "runQuery", args });
|
|
106
|
+
}
|
|
107
|
+
async function expandTableResult(args) {
|
|
108
|
+
return await request({ name: "expandTableResult", args });
|
|
109
|
+
}
|
|
110
|
+
async function setTabTitle(args) {
|
|
111
|
+
return await request({ name: "setTabTitle", args });
|
|
112
|
+
}
|
|
113
|
+
async function getViewState() {
|
|
114
|
+
return await request({ name: "getViewState", args: void 0 });
|
|
115
|
+
}
|
|
116
|
+
async function setViewState(args) {
|
|
117
|
+
return await request({ name: "setViewState", args });
|
|
118
|
+
}
|
|
119
|
+
async function openExternal(args) {
|
|
120
|
+
return await request({ name: "openExternal", args });
|
|
121
|
+
}
|
|
122
|
+
async function getData() {
|
|
123
|
+
return await request({ name: "getData", args: void 0 });
|
|
124
|
+
}
|
|
125
|
+
async function setData(args) {
|
|
126
|
+
return await request({ name: "setData", args });
|
|
127
|
+
}
|
|
128
|
+
async function getEncryptedData() {
|
|
129
|
+
return await request({ name: "getEncryptedData", args: void 0 });
|
|
130
|
+
}
|
|
131
|
+
async function setEncryptedData(args) {
|
|
132
|
+
return await request({ name: "setEncryptedData", args });
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { addNotificationListener, expandTableResult, getAllTabs, getColumns, getConnectionInfo, getData, getEncryptedData, getTables, getViewState, notify, openExternal, request, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState };
|
|
91
136
|
//# 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"],"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 type {\n GetTablesRequest,\n GetColumnsRequest,\n RunQueryRequest,\n ExpandTableResultRequest,\n SetTabTitleRequest,\n GetViewStateRequest,\n SetViewStateRequest,\n OpenExternalRequest,\n} from \"./requestTypes\";\nimport type {\n GetTablesResponse,\n GetColumnsResponse,\n GetConnectionInfoResponse,\n GetAllTabsResponse,\n RunQueryResponse,\n ExpandTableResultResponse,\n SetTabTitleResponse,\n GetViewStateResponse,\n SetViewStateResponse,\n OpenExternalResponse,\n} from \"./responseTypes\";\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 name: string;\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }\n>();\n\nlet debugComms = false;\n\nexport function setDebugComms(value: boolean) {\n debugComms = value;\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, name } = pendingRequests.get(id)!;\n pendingRequests.delete(id);\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [RESPONSE] ${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(name: \"getTables\", args?: GetTablesRequest[\"args\"]): Promise<GetTablesResponse>;\nexport async function request(name: \"getColumns\", args: GetColumnsRequest[\"args\"]): Promise<GetColumnsResponse>;\nexport async function request(name: \"getConnectionInfo\"): Promise<GetConnectionInfoResponse>;\nexport async function request(name: \"getAllTabs\"): Promise<GetAllTabsResponse>;\nexport async function request(name: \"runQuery\", args: RunQueryRequest[\"args\"]): Promise<RunQueryResponse>;\nexport async function request(name: \"expandTableResult\", args: ExpandTableResultRequest[\"args\"]): Promise<ExpandTableResultResponse>;\nexport async function request(name: \"setTabTitle\", args: SetTabTitleRequest[\"args\"]): Promise<SetTabTitleResponse>;\nexport async function request<T extends unknown>(name: \"getViewState\", args: GetViewStateRequest[\"args\"]): Promise<GetViewStateResponse<T>>;\nexport async function request<T extends unknown>(name: \"setViewState\", args: SetViewStateRequest<T>[\"args\"]): Promise<SetViewStateResponse>;\nexport async function request<T extends unknown>(name: \"openExternal\", args: OpenExternalRequest[\"args\"]): Promise<OpenExternalResponse>;\nexport async function request(name: unknown, args?: unknown): Promise<unknown> {\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${name}`);\n console.log(\"Args:\", args);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n const id = generateUUID();\n const data = { id, name, args };\n pendingRequests.set(id, { name: name as string, resolve, reject });\n window.parent.postMessage(data, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nexport function notify(name: string, args: any) {\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 window.parent.postMessage({ name, args }, \"*\");\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nexport async 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"],"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,QA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EAAE,IAAS,EAAA;IAC5C,IAAI,UAAU,EAAE;QACd,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;QACnD,OAAO,CAAC,cAAc,CAAC,CAAA,EAAG,IAAI,CAAmB,gBAAA,EAAA,IAAI,CAAE,CAAA,CAAC;AACxD,QAAA,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;QAC1B,OAAO,CAAC,QAAQ,EAAE;;AAEpB,IAAA,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC;AAChD;AAEA,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAmC;AAEjE,eAAe,uBAAuB,CAC3C,IAAY,EACZ,OAA4B,EAAA;IAE5B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACpC,QAAA,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;;IAErC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,OAAO,CAAC;AAChD;;;;"}
|
|
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 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(value: boolean) {\n debugComms = value;\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(payload: any): Promise<any> {\n const fullPayload = {\n id: generateUUID(),\n ...payload,\n } as PluginRequestPayload;\n\n if (debugComms) {\n const time = new Date().toLocaleTimeString(\"en-GB\");\n console.groupCollapsed(`${time} [REQUEST] ${payload.name}`);\n console.log(\"Args:\", payload.args);\n console.groupEnd();\n }\n\n return new Promise<any>((resolve, reject) => {\n try {\n pendingRequests.set(fullPayload.id, { payload: fullPayload, resolve, reject });\n window.parent.postMessage(payload, \"*\");\n } catch (e) {\n reject(e);\n }\n });\n}\n\nexport function notify(name: string, args: any) {\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 window.parent.postMessage({ name, args }, \"*\");\n}\n\nconst notificationListeners = new Map<string, ((args: any) => void)[]>();\n\nexport async 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","import { request } from \"./comms\";\nimport type {\n GetTablesRequest,\n GetColumnsRequest,\n RunQueryRequest,\n ExpandTableResultRequest,\n SetTabTitleRequest,\n SetViewStateRequest,\n OpenExternalRequest,\n SetDataRequest,\n SetEncryptedDataRequest,\n} from \"./requestTypes\";\nimport type {\n GetTablesResponse,\n GetColumnsResponse,\n GetConnectionInfoResponse,\n GetAllTabsResponse,\n RunQueryResponse,\n ExpandTableResultResponse,\n SetTabTitleResponse,\n GetViewStateResponse,\n SetViewStateResponse,\n OpenExternalResponse,\n GetDataResponse,\n SetDataResponse,\n GetEncryptedDataResponse,\n SetEncryptedDataResponse,\n} from \"./responseTypes\";\n\nexport async function getTables(args?: GetTablesRequest['args']): Promise<GetTablesResponse['result']> {\n return await request({ name: \"getTables\", args: args || {} });\n}\n\nexport async function getColumns(args: GetColumnsRequest['args']): Promise<GetColumnsResponse['result']> {\n return await request({ name: \"getColumns\", args });\n}\n\nexport async function getConnectionInfo(): Promise<GetConnectionInfoResponse['result']> {\n return await request({ name: \"getConnectionInfo\", args: void 0 });\n}\n\nexport async function getAllTabs(): Promise<GetAllTabsResponse['result']> {\n return await request({ name: \"getAllTabs\", args: void 0 });\n}\n\nexport async function runQuery(args: RunQueryRequest['args']): Promise<RunQueryResponse['result']> {\n return await request({ name: \"runQuery\", args });\n}\n\nexport async function expandTableResult(args: ExpandTableResultRequest['args']): Promise<ExpandTableResultResponse['result']> {\n return await request({ name: \"expandTableResult\", args });\n}\n\nexport async function setTabTitle(args: SetTabTitleRequest['args']): Promise<SetTabTitleResponse['result']> {\n return await request({ name: \"setTabTitle\", args });\n}\n\nexport async function getViewState<T>(): Promise<GetViewStateResponse<T>['result']> {\n return await request({ name: \"getViewState\", args: void 0 });\n}\n\nexport async function setViewState<T>(args: SetViewStateRequest<T>['args']): Promise<SetViewStateResponse['result']> {\n return await request({ name: \"setViewState\", args });\n}\n\nexport async function openExternal(args: OpenExternalRequest['args']): Promise<OpenExternalResponse['result']> {\n return await request({ name: \"openExternal\", args });\n}\n\nexport async function getData<T>(): Promise<GetDataResponse<T>['result']> {\n return await request({ name: \"getData\", args: void 0 });\n}\n\nexport async function setData<T>(args: SetDataRequest<T>['args']): Promise<SetDataResponse['result']> {\n return await request({ name: \"setData\", args });\n}\n\nexport async function getEncryptedData<T>(): Promise<GetEncryptedDataResponse<T>['result']> {\n return await request({ name: \"getEncryptedData\", args: void 0 });\n}\n\nexport async function setEncryptedData<T>(args: SetEncryptedDataRequest<T>['args']): Promise<SetEncryptedDataResponse['result']> {\n return await request({ name: \"setEncryptedData\", args });\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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