@beekeeperstudio/plugin 1.4.0-beta.6 → 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 +307 -311
- package/dist/index.js +172 -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.d.ts
CHANGED
|
@@ -19,9 +19,38 @@ interface TableKey {
|
|
|
19
19
|
onUpdate?: string;
|
|
20
20
|
onDelete?: string;
|
|
21
21
|
}
|
|
22
|
+
type IndexColumn = {
|
|
23
|
+
name: string;
|
|
24
|
+
order?: 'ASC' | 'DESC' | '2d' | '2dsphere' | 'text' | 'geoHaystack' | 'hashed' | number;
|
|
25
|
+
/** MySQL Only */
|
|
26
|
+
prefix?: number | null;
|
|
27
|
+
};
|
|
28
|
+
type PrimaryKey = {
|
|
29
|
+
columnName: string;
|
|
30
|
+
position: number;
|
|
31
|
+
};
|
|
32
|
+
type TableIndex = {
|
|
33
|
+
id: string;
|
|
34
|
+
table: string;
|
|
35
|
+
schema: string;
|
|
36
|
+
name: string;
|
|
37
|
+
columns: IndexColumn[];
|
|
38
|
+
unique: boolean;
|
|
39
|
+
primary: boolean;
|
|
40
|
+
/** for postgres 15 and above https://www.postgresql.org/about/featurematrix/detail/392/ */
|
|
41
|
+
nullsNotDistinct?: boolean;
|
|
42
|
+
};
|
|
43
|
+
type Table = {
|
|
44
|
+
name: string;
|
|
45
|
+
schema?: string;
|
|
46
|
+
};
|
|
47
|
+
type Column = {
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
22
51
|
type WindowEventClass = "MouseEvent" | "KeyboardEvent" | "PointerEvent" | "Event";
|
|
23
52
|
type WindowEventInits = MouseEventInit | KeyboardEventInit | PointerEventInit;
|
|
24
|
-
type TableFilter
|
|
53
|
+
type TableFilter = {
|
|
25
54
|
field: string;
|
|
26
55
|
type: "=" | "!=" | "like" | "not like" | "<" | "<=" | ">" | ">=" | "in" | "is" | "is not";
|
|
27
56
|
value?: string | string[];
|
|
@@ -80,339 +109,283 @@ type PluginViewContext = {
|
|
|
80
109
|
command: string;
|
|
81
110
|
params?: CellMenuParams | ColumnMenuParams | RowMenuParams | CornerMenuParams;
|
|
82
111
|
};
|
|
112
|
+
type DatabaseType = 'postgresql' | 'mysql' | 'mariadb' | 'sqlite' | 'sqlserver' | 'oracle' | 'mongodb' | 'cassandra' | 'clickhouse' | 'firebird' | 'bigquery' | 'redshift' | 'duckdb' | 'libsql' | 'redis' | 'surrealdb' | 'trino';
|
|
113
|
+
type ConnectionInfo = {
|
|
114
|
+
/** @alias databaseType */
|
|
115
|
+
connectionType: string;
|
|
116
|
+
/** The ID of the connection */
|
|
117
|
+
id: number;
|
|
118
|
+
/** The name of the connection specified in the connection form */
|
|
119
|
+
workspaceId: number;
|
|
120
|
+
/** The name of the connection specified in the connection form */
|
|
121
|
+
connectionName: string;
|
|
122
|
+
databaseType: DatabaseType;
|
|
123
|
+
/** The name of the database connected to */
|
|
124
|
+
databaseName: string;
|
|
125
|
+
defaultSchema?: string;
|
|
126
|
+
readOnlyMode: boolean;
|
|
127
|
+
};
|
|
128
|
+
type AppInfo = {
|
|
129
|
+
version: string;
|
|
130
|
+
theme: AppTheme;
|
|
131
|
+
};
|
|
132
|
+
type AppTheme = {
|
|
133
|
+
palette: Record<string, string>;
|
|
134
|
+
cssString: string;
|
|
135
|
+
type: ThemeType;
|
|
136
|
+
};
|
|
137
|
+
type RunQueryResult = {
|
|
138
|
+
results: QueryResult[];
|
|
139
|
+
error?: unknown;
|
|
140
|
+
};
|
|
141
|
+
type OpenQueryTabOptions = {
|
|
142
|
+
query?: string;
|
|
143
|
+
};
|
|
144
|
+
type OpenTableTableTabOptions = {
|
|
145
|
+
table: string;
|
|
146
|
+
schema?: string;
|
|
147
|
+
filters?: TableFilter[];
|
|
148
|
+
database?: string;
|
|
149
|
+
};
|
|
150
|
+
type OpenTableStructureTabOptions = {
|
|
151
|
+
table: string;
|
|
152
|
+
schema?: string;
|
|
153
|
+
database?: string;
|
|
154
|
+
};
|
|
155
|
+
type RequestFileSaveOptions = {
|
|
156
|
+
data: string;
|
|
157
|
+
fileName: string;
|
|
158
|
+
/** @default "utf8" */
|
|
159
|
+
encoding?: "utf8" | "base64";
|
|
160
|
+
filters?: {
|
|
161
|
+
name: string;
|
|
162
|
+
extensions: string[];
|
|
163
|
+
}[];
|
|
164
|
+
};
|
|
165
|
+
type PluginErrorObject = {
|
|
166
|
+
name?: string;
|
|
167
|
+
message: string;
|
|
168
|
+
stack?: string;
|
|
169
|
+
};
|
|
170
|
+
type WindowEventObject = {
|
|
171
|
+
eventType: string;
|
|
172
|
+
eventClass: WindowEventClass;
|
|
173
|
+
eventInitOptions: WindowEventInits;
|
|
174
|
+
};
|
|
83
175
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
name: "getTables";
|
|
89
|
-
args: {
|
|
90
|
-
schema?: string;
|
|
176
|
+
type RequestMap = {
|
|
177
|
+
getSchemas: {
|
|
178
|
+
args: void;
|
|
179
|
+
return: string[];
|
|
91
180
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
schema?: string;
|
|
181
|
+
getTables: {
|
|
182
|
+
args: {
|
|
183
|
+
schema?: string;
|
|
184
|
+
};
|
|
185
|
+
return: Table[];
|
|
98
186
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
187
|
+
getColumns: {
|
|
188
|
+
args: {
|
|
189
|
+
table: string;
|
|
190
|
+
schema?: string;
|
|
191
|
+
};
|
|
192
|
+
return: Column[];
|
|
105
193
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
name: "getConnectionInfo";
|
|
113
|
-
args: void;
|
|
114
|
-
}
|
|
115
|
-
interface RunQueryRequest extends BaseRequest {
|
|
116
|
-
name: "runQuery";
|
|
117
|
-
args: {
|
|
118
|
-
query: string;
|
|
194
|
+
getTableKeys: {
|
|
195
|
+
args: {
|
|
196
|
+
table: string;
|
|
197
|
+
schema?: string;
|
|
198
|
+
};
|
|
199
|
+
return: TableKey[];
|
|
119
200
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
201
|
+
getPrimaryKeys: {
|
|
202
|
+
args: {
|
|
203
|
+
table: string;
|
|
204
|
+
schema?: string;
|
|
205
|
+
};
|
|
206
|
+
return: PrimaryKey[];
|
|
125
207
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
208
|
+
getTableIndexes: {
|
|
209
|
+
args: {
|
|
210
|
+
table: string;
|
|
211
|
+
schema?: string;
|
|
212
|
+
};
|
|
213
|
+
return: TableIndex[];
|
|
131
214
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
name: "getViewState";
|
|
139
|
-
args: void;
|
|
140
|
-
}
|
|
141
|
-
interface SetViewStateRequest<T extends unknown> extends BaseRequest {
|
|
142
|
-
name: "setViewState";
|
|
143
|
-
args: {
|
|
144
|
-
state: T;
|
|
215
|
+
getIncomingKeys: {
|
|
216
|
+
args: {
|
|
217
|
+
table: string;
|
|
218
|
+
schema?: string;
|
|
219
|
+
};
|
|
220
|
+
return: TableKey[];
|
|
145
221
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
222
|
+
getOutgoingKeys: {
|
|
223
|
+
args: {
|
|
224
|
+
table: string;
|
|
225
|
+
schema?: string;
|
|
226
|
+
};
|
|
227
|
+
return: TableKey[];
|
|
151
228
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
args: {
|
|
156
|
-
key: string;
|
|
157
|
-
value: T;
|
|
229
|
+
getConnectionInfo: {
|
|
230
|
+
args: void;
|
|
231
|
+
return: ConnectionInfo;
|
|
158
232
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
args: {
|
|
163
|
-
key: string;
|
|
233
|
+
getAppInfo: {
|
|
234
|
+
args: void;
|
|
235
|
+
return: AppInfo;
|
|
164
236
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
args: {
|
|
169
|
-
key: string;
|
|
237
|
+
checkForUpdate: {
|
|
238
|
+
args: void;
|
|
239
|
+
return: boolean;
|
|
170
240
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
value: T;
|
|
241
|
+
runQuery: {
|
|
242
|
+
args: {
|
|
243
|
+
query: string;
|
|
244
|
+
};
|
|
245
|
+
return: RunQueryResult;
|
|
177
246
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
247
|
+
expandTableResult: {
|
|
248
|
+
args: {
|
|
249
|
+
results: QueryResult[];
|
|
250
|
+
};
|
|
251
|
+
return: void;
|
|
183
252
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
type OpenQueryTabRequest = BaseRequest & {
|
|
190
|
-
name: "openTab";
|
|
191
|
-
args: {
|
|
192
|
-
type: "query";
|
|
193
|
-
query?: string;
|
|
253
|
+
setTabTitle: {
|
|
254
|
+
args: {
|
|
255
|
+
title: string;
|
|
256
|
+
};
|
|
257
|
+
return: void;
|
|
194
258
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
args: {
|
|
199
|
-
type: "tableTable";
|
|
200
|
-
table: string;
|
|
201
|
-
schema?: string;
|
|
202
|
-
filters?: TableFilter$1[];
|
|
203
|
-
database?: string;
|
|
259
|
+
getViewContext: {
|
|
260
|
+
args: void;
|
|
261
|
+
return: any;
|
|
204
262
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
args: {
|
|
209
|
-
type: "tableStructure";
|
|
210
|
-
table: string;
|
|
211
|
-
schema?: string;
|
|
212
|
-
database?: string;
|
|
263
|
+
getViewState: {
|
|
264
|
+
args: void;
|
|
265
|
+
return: any;
|
|
213
266
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
type OpenTabRequest = OpenQueryTabRequest | OpenTableTableTabRequest | OpenTableStructureTabRequest;
|
|
220
|
-
type PluginRequestData = GetTablesRequest | GetColumnsRequest | GetTableKeysRequest | GetAppInfoRequest | GetConnectionInfoRequest | RunQueryRequest | ExpandTableResultRequest | SetTabTitleRequest | GetViewContextRequest | GetViewStateRequest | SetViewStateRequest<unknown> | OpenExternalRequest | GetDataRequest | SetDataRequest<unknown> | GetEncryptedDataRequest | SetEncryptedDataRequest<unknown> | ClipboardWriteTextRequest | ClipboardReadTextRequest | OpenTabRequest | CheckForUpdateRequest;
|
|
221
|
-
type PluginRequestPayload = PluginRequestData;
|
|
222
|
-
|
|
223
|
-
type AppTheme = {
|
|
224
|
-
palette: Record<string, string>;
|
|
225
|
-
cssString: string;
|
|
226
|
-
type: ThemeType;
|
|
227
|
-
};
|
|
228
|
-
type ThemeChangedNotification = {
|
|
229
|
-
name: "themeChanged";
|
|
230
|
-
args: AppTheme;
|
|
231
|
-
};
|
|
232
|
-
type WindowEventNotification = {
|
|
233
|
-
name: "windowEvent";
|
|
234
|
-
args: {
|
|
235
|
-
eventType: string;
|
|
236
|
-
eventClass: WindowEventClass;
|
|
237
|
-
eventInitOptions: WindowEventInits;
|
|
267
|
+
setViewState: {
|
|
268
|
+
args: {
|
|
269
|
+
state: any;
|
|
270
|
+
};
|
|
271
|
+
return: void;
|
|
238
272
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
message?: string;
|
|
245
|
-
stack?: string;
|
|
273
|
+
openExternal: {
|
|
274
|
+
args: {
|
|
275
|
+
link: string;
|
|
276
|
+
};
|
|
277
|
+
return: void;
|
|
246
278
|
};
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
279
|
+
getData: {
|
|
280
|
+
args: {
|
|
281
|
+
key: string;
|
|
282
|
+
};
|
|
283
|
+
return: any;
|
|
252
284
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
interface BaseResponse {
|
|
260
|
-
id: string;
|
|
261
|
-
error?: Error;
|
|
262
|
-
}
|
|
263
|
-
interface GetTablesResponse extends BaseResponse {
|
|
264
|
-
result: {
|
|
265
|
-
name: string;
|
|
266
|
-
schema?: string;
|
|
267
|
-
}[];
|
|
268
|
-
}
|
|
269
|
-
interface GetColumnsResponse extends BaseResponse {
|
|
270
|
-
result: {
|
|
271
|
-
name: string;
|
|
272
|
-
type: string;
|
|
273
|
-
}[];
|
|
274
|
-
}
|
|
275
|
-
type GetTableKeysResponse = BaseResponse & {
|
|
276
|
-
result: TableKey[];
|
|
277
|
-
};
|
|
278
|
-
interface GetConnectionInfoResponse extends BaseResponse {
|
|
279
|
-
result: {
|
|
280
|
-
/** @deprecated Use `databaseType` instead */
|
|
281
|
-
connectionType: string;
|
|
282
|
-
/** The ID of the connection */
|
|
283
|
-
id: number;
|
|
284
|
-
/** The name of the connection specified in the connection form */
|
|
285
|
-
workspaceId: number;
|
|
286
|
-
/** The name of the connection specified in the connection form */
|
|
287
|
-
connectionName: string;
|
|
288
|
-
databaseType: 'postgresql' | 'mysql' | 'mariadb' | 'sqlite' | 'sqlserver' | 'oracle' | 'mongodb' | 'cassandra' | 'clickhouse' | 'firebird' | 'bigquery' | 'redshift' | 'duckdb' | 'libsql' | 'redis' | 'surrealdb' | 'trino';
|
|
289
|
-
/** The name of the database connected to */
|
|
290
|
-
databaseName: string;
|
|
291
|
-
defaultSchema?: string;
|
|
292
|
-
readOnlyMode: boolean;
|
|
285
|
+
setData: {
|
|
286
|
+
args: {
|
|
287
|
+
key: string;
|
|
288
|
+
value: any;
|
|
289
|
+
};
|
|
290
|
+
return: void;
|
|
293
291
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
292
|
+
getEncryptedData: {
|
|
293
|
+
args: {
|
|
294
|
+
key: string;
|
|
295
|
+
};
|
|
296
|
+
return: any;
|
|
299
297
|
};
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
setEncryptedData: {
|
|
299
|
+
args: {
|
|
300
|
+
key: string;
|
|
301
|
+
value: any;
|
|
302
|
+
};
|
|
303
|
+
return: void;
|
|
305
304
|
};
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
};
|
|
316
|
-
interface GetViewStateResponse<T extends unknown> extends BaseResponse {
|
|
317
|
-
result: T;
|
|
318
|
-
}
|
|
319
|
-
interface SetViewStateResponse extends BaseResponse {
|
|
320
|
-
result: void;
|
|
321
|
-
}
|
|
322
|
-
interface OpenExternalResponse extends BaseResponse {
|
|
323
|
-
result: void;
|
|
324
|
-
}
|
|
325
|
-
interface GetDataResponse<T extends unknown> extends BaseResponse {
|
|
326
|
-
result: T;
|
|
327
|
-
}
|
|
328
|
-
interface SetDataResponse extends BaseResponse {
|
|
329
|
-
result: void;
|
|
330
|
-
}
|
|
331
|
-
interface GetEncryptedDataResponse<T extends unknown> extends BaseResponse {
|
|
332
|
-
result: T;
|
|
333
|
-
}
|
|
334
|
-
interface SetEncryptedDataResponse extends BaseResponse {
|
|
335
|
-
result: void;
|
|
336
|
-
}
|
|
337
|
-
interface ClipboardWriteTextResponse extends BaseResponse {
|
|
338
|
-
result: void;
|
|
339
|
-
}
|
|
340
|
-
interface ClipboardReadTextResponse extends BaseResponse {
|
|
341
|
-
result: string;
|
|
342
|
-
}
|
|
343
|
-
interface OpenTabResponse extends BaseResponse {
|
|
344
|
-
result: void;
|
|
345
|
-
}
|
|
346
|
-
interface CheckForUpdateResponse extends BaseResponse {
|
|
347
|
-
result: boolean;
|
|
348
|
-
}
|
|
349
|
-
type PluginResponseData = GetTablesResponse | GetColumnsResponse | GetTableKeysResponse | GetConnectionInfoResponse | RunQueryResponse | ExpandTableResultResponse | SetTabTitleResponse | GetViewContextResponse | GetViewStateResponse<unknown> | SetViewStateResponse | OpenExternalResponse | GetDataResponse<unknown> | SetDataResponse | GetEncryptedDataResponse<unknown> | SetEncryptedDataResponse | ClipboardWriteTextResponse | ClipboardReadTextResponse | OpenTabResponse | CheckForUpdateResponse;
|
|
350
|
-
type PluginResponsePayload = PluginResponseData;
|
|
351
|
-
type TabResponse = BaseTabResponse | QueryTabResponse | TableTabResponse;
|
|
352
|
-
interface BaseTabResponse {
|
|
353
|
-
type: TabType;
|
|
354
|
-
id: number;
|
|
355
|
-
title: string;
|
|
356
|
-
}
|
|
357
|
-
interface QueryTabResponse extends BaseTabResponse {
|
|
358
|
-
type: "query";
|
|
359
|
-
data: {
|
|
360
|
-
query: string;
|
|
361
|
-
result: unknown;
|
|
305
|
+
openTab: {
|
|
306
|
+
args: ({
|
|
307
|
+
type: "query";
|
|
308
|
+
} & OpenQueryTabOptions) | ({
|
|
309
|
+
type: "tableTable";
|
|
310
|
+
} & OpenTableTableTabOptions) | ({
|
|
311
|
+
type: "tableStructure";
|
|
312
|
+
} & OpenTableStructureTabOptions);
|
|
313
|
+
return: void;
|
|
362
314
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
data: {
|
|
367
|
-
table: TableOrView;
|
|
368
|
-
filters: TableFilter[] | string;
|
|
369
|
-
result: unknown;
|
|
315
|
+
requestFileSave: {
|
|
316
|
+
args: RequestFileSaveOptions;
|
|
317
|
+
return: void;
|
|
370
318
|
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
interface ImportMeta {
|
|
375
|
-
env: {
|
|
376
|
-
MODE: string;
|
|
319
|
+
toggleStatusBarUI: {
|
|
320
|
+
args: {
|
|
321
|
+
force?: boolean;
|
|
377
322
|
};
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
323
|
+
return: void;
|
|
324
|
+
};
|
|
325
|
+
"clipboard.writeText": {
|
|
326
|
+
args: {
|
|
327
|
+
text: string;
|
|
328
|
+
};
|
|
329
|
+
return: void;
|
|
330
|
+
};
|
|
331
|
+
"clipboard.writeImage": {
|
|
332
|
+
args: {
|
|
333
|
+
data: string;
|
|
334
|
+
};
|
|
335
|
+
return: void;
|
|
336
|
+
};
|
|
337
|
+
"clipboard.readText": {
|
|
338
|
+
args: void;
|
|
339
|
+
return: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
388
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Get a list of schemas from the current database.
|
|
345
|
+
*
|
|
346
|
+
* @since Beekeeper Studio 5.5.0
|
|
347
|
+
**/
|
|
348
|
+
declare function getSchemas(): Promise<string[]>;
|
|
389
349
|
/**
|
|
390
350
|
* Get a list of tables from the current database.
|
|
351
|
+
*
|
|
391
352
|
* @since Beekeeper Studio 5.3.0
|
|
392
353
|
**/
|
|
393
|
-
declare function getTables(schema?: string): Promise<
|
|
354
|
+
declare function getTables(schema?: string): Promise<Table[]>;
|
|
394
355
|
/**
|
|
395
356
|
* Get a list of columns from a table.
|
|
396
357
|
*
|
|
397
358
|
* @since Beekeeper Studio 5.3.0
|
|
398
359
|
**/
|
|
399
|
-
declare function getColumns(table: string, schema?: string): Promise<
|
|
360
|
+
declare function getColumns(table: string, schema?: string): Promise<Column[]>;
|
|
400
361
|
/** @since Beekeeper Studio 5.4.0 */
|
|
401
|
-
declare function getTableKeys(table: string, schema?: string): Promise<
|
|
362
|
+
declare function getTableKeys(table: string, schema?: string): Promise<TableKey[]>;
|
|
363
|
+
/** @since Beekeeper Studio 5.5.0 */
|
|
364
|
+
declare function getTableIndexes(table: string, schema?: string): Promise<TableIndex[]>;
|
|
365
|
+
declare function getPrimaryKeys(table: string, schema?: string): Promise<PrimaryKey[]>;
|
|
366
|
+
declare function getIncomingKeys(table: string, schema?: string): Promise<TableKey[]>;
|
|
367
|
+
declare function getOutgoingKeys(table: string, schema?: string): Promise<TableKey[]>;
|
|
402
368
|
/**
|
|
403
369
|
* Get information about the current database connection.
|
|
404
370
|
*
|
|
405
371
|
* @since Beekeeper Studio 5.3.0
|
|
406
372
|
**/
|
|
407
|
-
declare function getConnectionInfo(): Promise<
|
|
373
|
+
declare function getConnectionInfo(): Promise<ConnectionInfo>;
|
|
408
374
|
/** @since Beekeeper Studio 5.4.0 */
|
|
409
|
-
declare function getAppInfo(): Promise<
|
|
375
|
+
declare function getAppInfo(): Promise<AppInfo>;
|
|
376
|
+
/**
|
|
377
|
+
* Get the version of Beekeeper Studio
|
|
378
|
+
* @since Beekeeper Studio 5.3.0
|
|
379
|
+
**/
|
|
380
|
+
declare function getAppVersion(): Promise<"5.3" | (string & {
|
|
381
|
+
__brand?: never;
|
|
382
|
+
})>;
|
|
410
383
|
/**
|
|
411
384
|
* Check if plugin's update is available.
|
|
412
385
|
*
|
|
413
386
|
* @since Beekeeper Studio 5.4.0
|
|
414
387
|
**/
|
|
415
|
-
declare function checkForUpdate(): Promise<
|
|
388
|
+
declare function checkForUpdate(): Promise<boolean>;
|
|
416
389
|
/**
|
|
417
390
|
* Execute a SQL query against the current database.
|
|
418
391
|
*
|
|
@@ -422,19 +395,19 @@ declare function checkForUpdate(): Promise<CheckForUpdateResponse['result']>;
|
|
|
422
395
|
*
|
|
423
396
|
* @since Beekeeper Studio 5.3.0
|
|
424
397
|
**/
|
|
425
|
-
declare function runQuery(query: string): Promise<
|
|
398
|
+
declare function runQuery(query: string): Promise<RunQueryResult>;
|
|
426
399
|
/**
|
|
427
400
|
* Display query results in the bottom table panel (shell-type tabs only).
|
|
428
401
|
*
|
|
429
402
|
* @since Beekeeper Studio 5.3.0
|
|
430
403
|
**/
|
|
431
|
-
declare function expandTableResult(results:
|
|
404
|
+
declare function expandTableResult(results: QueryResult[]): Promise<void>;
|
|
432
405
|
/**
|
|
433
406
|
* Set the title of the current plugin tab.
|
|
434
407
|
*
|
|
435
408
|
* @since Beekeeper Studio 5.3.0
|
|
436
409
|
**/
|
|
437
|
-
declare function setTabTitle(title: string): Promise<
|
|
410
|
+
declare function setTabTitle(title: string): Promise<void>;
|
|
438
411
|
/**
|
|
439
412
|
* Get the current view context.
|
|
440
413
|
*
|
|
@@ -445,25 +418,25 @@ declare function setTabTitle(title: string): Promise<SetTabTitleResponse['result
|
|
|
445
418
|
*
|
|
446
419
|
* @since Beekeeper Studio 5.4.0
|
|
447
420
|
**/
|
|
448
|
-
declare function getViewContext(): Promise<
|
|
421
|
+
declare function getViewContext(): Promise<PluginViewContext>;
|
|
449
422
|
/**
|
|
450
423
|
* Get the current state of your view instance.
|
|
451
424
|
*
|
|
452
425
|
* @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}
|
|
453
426
|
* @since Beekeeper Studio 5.3.0
|
|
454
427
|
**/
|
|
455
|
-
declare function getViewState<T>(): Promise<
|
|
428
|
+
declare function getViewState<T = unknown>(): Promise<T>;
|
|
456
429
|
/**
|
|
457
430
|
* Set the state of your view instance.
|
|
458
431
|
*
|
|
459
432
|
* @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}
|
|
460
433
|
* @since Beekeeper Studio 5.3.0
|
|
461
434
|
**/
|
|
462
|
-
declare function setViewState<T>(state: T): Promise<
|
|
435
|
+
declare function setViewState<T = unknown>(state: T): Promise<void>;
|
|
463
436
|
/** @since Beekeeper Studio 5.3.0 */
|
|
464
|
-
declare function openExternal(link: string): Promise<
|
|
437
|
+
declare function openExternal(link: string): Promise<void>;
|
|
465
438
|
/** @since Beekeeper Studio 5.3.0 */
|
|
466
|
-
declare function getData<T>(key?: string): Promise<
|
|
439
|
+
declare function getData<T = unknown>(key?: string): Promise<T>;
|
|
467
440
|
/**
|
|
468
441
|
* Store data that can be retrieved later.
|
|
469
442
|
*
|
|
@@ -476,10 +449,10 @@ declare function getData<T>(key?: string): Promise<GetDataResponse<T>['result']>
|
|
|
476
449
|
*
|
|
477
450
|
* @since Beekeeper Studio 5.3.0
|
|
478
451
|
*/
|
|
479
|
-
declare function setData<T>(key: string, value: T): Promise<
|
|
480
|
-
declare function setData<T>(value: T): Promise<
|
|
452
|
+
declare function setData<T = unknown>(key: string, value: T): Promise<void>;
|
|
453
|
+
declare function setData<T = unknown>(value: T): Promise<void>;
|
|
481
454
|
/** @since Beekeeper Studio 5.3.0 */
|
|
482
|
-
declare function getEncryptedData<T>(key: string): Promise<
|
|
455
|
+
declare function getEncryptedData<T>(key: string): Promise<T>;
|
|
483
456
|
/**
|
|
484
457
|
* Store encrypted data that can be retrieved later.
|
|
485
458
|
*
|
|
@@ -492,12 +465,16 @@ declare function getEncryptedData<T>(key: string): Promise<GetEncryptedDataRespo
|
|
|
492
465
|
*
|
|
493
466
|
* @since Beekeeper Studio 5.3.0
|
|
494
467
|
*/
|
|
495
|
-
declare function setEncryptedData<T>(key: string, value: T): Promise<
|
|
496
|
-
declare function setEncryptedData<T>(value: T): Promise<
|
|
468
|
+
declare function setEncryptedData<T = unknown>(key: string, value: T): Promise<void>;
|
|
469
|
+
declare function setEncryptedData<T = unknown>(value: T): Promise<void>;
|
|
497
470
|
/** @since Beekeeper Studio 5.4.0 */
|
|
498
|
-
declare function openTab(type: "query",
|
|
499
|
-
declare function openTab(type: "tableTable",
|
|
500
|
-
declare function openTab(type: "tableStructure",
|
|
471
|
+
declare function openTab(type: "query", options?: OpenQueryTabOptions): Promise<void>;
|
|
472
|
+
declare function openTab(type: "tableTable", options: OpenTableTableTabOptions): Promise<void>;
|
|
473
|
+
declare function openTab(type: "tableStructure", options: OpenTableStructureTabOptions): Promise<void>;
|
|
474
|
+
declare function requestFileSave(options: RequestFileSaveOptions): Promise<void>;
|
|
475
|
+
declare function showStatusBarUI(): Promise<void>;
|
|
476
|
+
declare function hideStatusBarUI(): Promise<void>;
|
|
477
|
+
declare function toggleStatusBarUI(): Promise<void>;
|
|
501
478
|
/** @since Beekeeper Studio 5.4.0 */
|
|
502
479
|
declare const broadcast: {
|
|
503
480
|
post<T extends JsonValue = JsonValue>(message: T): void;
|
|
@@ -507,17 +484,36 @@ declare const broadcast: {
|
|
|
507
484
|
declare const log: {
|
|
508
485
|
error(err: string | Error): void;
|
|
509
486
|
};
|
|
510
|
-
/**
|
|
511
|
-
* Clipboard interface.
|
|
512
|
-
*
|
|
513
|
-
* @since Beekeeper Studio 5.3.0
|
|
514
|
-
**/
|
|
487
|
+
/** Clipboard interface. */
|
|
515
488
|
declare const clipboard: {
|
|
516
|
-
/** Write text to the Electron clipboard.
|
|
489
|
+
/** Write text to the Electron clipboard.
|
|
490
|
+
* @since Beekeeper Studio 5.3.0 */
|
|
517
491
|
writeText(text: string): Promise<void>;
|
|
518
|
-
/** Read text from the Electron clipboard.
|
|
492
|
+
/** Read text from the Electron clipboard.
|
|
493
|
+
* @since Beekeeper Studio 5.3.0 */
|
|
519
494
|
readText(): Promise<string>;
|
|
495
|
+
/** @param data - Base64 encoded image data.
|
|
496
|
+
* @since Beekeeper Studio 5.5.0 */
|
|
497
|
+
writeImage(data: string): Promise<void>;
|
|
520
498
|
};
|
|
499
|
+
declare function setDebugComms(enabled: boolean): void;
|
|
500
|
+
declare function notify<Message extends JsonValue = JsonValue>(name: "broadcast", args: {
|
|
501
|
+
message: Message;
|
|
502
|
+
}): void;
|
|
503
|
+
declare function notify(name: "pluginError", args: PluginErrorObject): void;
|
|
504
|
+
declare function notify(name: "windowEvent", args: WindowEventObject): void;
|
|
505
|
+
declare function addNotificationListener(name: "tablesChanged", handler: () => void): void;
|
|
506
|
+
declare function addNotificationListener<Message extends JsonValue = JsonValue>(name: "broadcast", handler: (args: {
|
|
507
|
+
message: Message;
|
|
508
|
+
}) => void): void;
|
|
509
|
+
declare function addNotificationListener(name: "themeChanged", handler: (args: AppTheme) => void): void;
|
|
510
|
+
declare function removeNotificationListener(name: "tablesChanged", handler: (args: any) => void): void;
|
|
511
|
+
declare function removeNotificationListener<Message extends JsonValue = JsonValue>(name: "broadcast", handler: (args: any) => void): void;
|
|
512
|
+
declare function removeNotificationListener(name: "themeChanged", handler: (args: any) => void): void;
|
|
513
|
+
declare function request<T extends keyof RequestMap>(raw: {
|
|
514
|
+
name: T;
|
|
515
|
+
args: RequestMap[T]["args"];
|
|
516
|
+
}): Promise<RequestMap[T]["return"]>;
|
|
521
517
|
|
|
522
|
-
export { addNotificationListener, broadcast, checkForUpdate, clipboard, expandTableResult, getAppInfo, getColumns, getConnectionInfo, getData, getEncryptedData, getTableKeys, getTables, getViewContext, getViewState, log, notify, openExternal, openTab, removeNotificationListener, request, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState };
|
|
523
|
-
export type { ActiveRange,
|
|
518
|
+
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 };
|
|
519
|
+
export type { ActiveRange, AppInfo, AppTheme, CellMenuParams, CellMenuTarget, Column, ColumnMenuParams, ColumnMenuTarget, ConnectionInfo, CornerMenuParams, CornerMenuTarget, DatabaseType, IndexColumn, JsonValue, LoadViewParams, OpenQueryTabOptions, OpenTableStructureTabOptions, OpenTableTableTabOptions, PluginErrorObject, PluginViewContext, PrimaryKey, QueryResult, RequestFileSaveOptions, RowMenuParams, RowMenuTarget, RunQueryResult, Table, TableFilter, TableIndex, TableKey, ThemeType, WindowEventClass, WindowEventInits, WindowEventObject };
|