@querypanel/node-sdk 1.0.55 → 1.0.57
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 +9 -1
- package/dist/index.cjs +690 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +459 -10
- package/dist/index.d.ts +459 -10
- package/dist/index.js +688 -35
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -156,8 +156,11 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
156
156
|
execute(sql: string, params?: Record<string, string | number | boolean | string[] | number[]>): Promise<DatabaseExecutionResult>;
|
|
157
157
|
private validateQueryTables;
|
|
158
158
|
/**
|
|
159
|
-
* Convert
|
|
160
|
-
* PostgreSQL expects $1, $2, $3 in SQL and an array of values [val1, val2, val3]
|
|
159
|
+
* Convert params to positional array for PostgreSQL.
|
|
160
|
+
* PostgreSQL expects $1, $2, $3 in SQL and an array of values [val1, val2, val3].
|
|
161
|
+
* When the record has numeric keys ("1", "2", "3") — e.g. from mapGeneratedParams —
|
|
162
|
+
* use only those in order so placeholder order matches SQL. Otherwise fall back to
|
|
163
|
+
* named keys in alphabetical order for backward compatibility.
|
|
161
164
|
*/
|
|
162
165
|
private convertNamedToPositionalParams;
|
|
163
166
|
validate(sql: string, params?: Record<string, string | number | boolean | string[] | number[]>): Promise<void>;
|
|
@@ -169,6 +172,46 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
169
172
|
introspect(options?: IntrospectOptions): Promise<SchemaIntrospection>;
|
|
170
173
|
}
|
|
171
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Interface for the API layer used by route modules.
|
|
177
|
+
* Implemented by ApiClient (HTTP to querypanel-sdk) and CallbackApiClient (in-process callbacks).
|
|
178
|
+
* Allows the SDK to be used inside your own API without HTTP recursion by providing a callback-based implementation.
|
|
179
|
+
*/
|
|
180
|
+
interface IQueryPanelApi {
|
|
181
|
+
getDefaultTenantId(): string | undefined;
|
|
182
|
+
get<T>(path: string, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
183
|
+
post<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
184
|
+
postWithHeaders<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<{
|
|
185
|
+
data: T;
|
|
186
|
+
headers: Headers;
|
|
187
|
+
}>;
|
|
188
|
+
put<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
189
|
+
patch<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
190
|
+
delete<T = void>(path: string, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Options passed to the request handler when using the callback-based API.
|
|
194
|
+
* Use this when you run the SDK inside your own API and want to handle "API" calls in-process (e.g. call querypanel-sdk services directly) to avoid recursion.
|
|
195
|
+
*/
|
|
196
|
+
interface RequestHandlerOptions {
|
|
197
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
198
|
+
path: string;
|
|
199
|
+
body?: unknown;
|
|
200
|
+
tenantId: string;
|
|
201
|
+
userId?: string;
|
|
202
|
+
scopes?: string[];
|
|
203
|
+
signal?: AbortSignal;
|
|
204
|
+
sessionId?: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Result from the request handler. Return `headers` for POST requests to paths like `/query` or `/v2/query` when the SDK needs to read response headers (e.g. x-querypanel-session-id).
|
|
208
|
+
*/
|
|
209
|
+
interface RequestHandlerResult {
|
|
210
|
+
data: unknown;
|
|
211
|
+
headers?: Headers;
|
|
212
|
+
}
|
|
213
|
+
type RequestHandler = (opts: RequestHandlerOptions) => Promise<RequestHandlerResult>;
|
|
214
|
+
|
|
172
215
|
/**
|
|
173
216
|
* Error codes for the query pipeline
|
|
174
217
|
* These match the server-side error codes returned in API responses
|
|
@@ -191,8 +234,8 @@ type QueryErrorCode = (typeof QueryErrorCode)[keyof typeof QueryErrorCode];
|
|
|
191
234
|
*/
|
|
192
235
|
declare class QueryPipelineError extends Error {
|
|
193
236
|
readonly code: QueryErrorCode;
|
|
194
|
-
readonly details?: Record<string, unknown
|
|
195
|
-
constructor(message: string, code: QueryErrorCode, details?: Record<string, unknown>);
|
|
237
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
238
|
+
constructor(message: string, code: QueryErrorCode, details?: Record<string, unknown> | undefined);
|
|
196
239
|
/**
|
|
197
240
|
* Check if this is a moderation error
|
|
198
241
|
*/
|
|
@@ -315,6 +358,78 @@ interface ActiveChartListOptions extends ChartListOptions {
|
|
|
315
358
|
withData?: boolean;
|
|
316
359
|
}
|
|
317
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Dashboard interface matching querypanel-sdk schema
|
|
363
|
+
*/
|
|
364
|
+
interface SdkDashboard {
|
|
365
|
+
id: string;
|
|
366
|
+
organization_id: string;
|
|
367
|
+
name: string;
|
|
368
|
+
description: string | null;
|
|
369
|
+
status: "draft" | "deployed";
|
|
370
|
+
content_json: string | null;
|
|
371
|
+
widget_config: Record<string, unknown> | null;
|
|
372
|
+
editor_type: "blocknote" | "custom";
|
|
373
|
+
is_customer_fork: boolean;
|
|
374
|
+
forked_from_dashboard_id: string | null;
|
|
375
|
+
tenant_id: string | null;
|
|
376
|
+
datasource_id: string | null;
|
|
377
|
+
version: number;
|
|
378
|
+
deployed_at: string | null;
|
|
379
|
+
created_at: string;
|
|
380
|
+
updated_at: string;
|
|
381
|
+
created_by: string | null;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Dashboard creation input
|
|
385
|
+
*/
|
|
386
|
+
interface DashboardCreateInput {
|
|
387
|
+
name: string;
|
|
388
|
+
description?: string;
|
|
389
|
+
content_json?: string;
|
|
390
|
+
widget_config?: Record<string, unknown>;
|
|
391
|
+
editor_type?: "blocknote" | "custom";
|
|
392
|
+
datasource_id?: string;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Dashboard update input
|
|
396
|
+
*/
|
|
397
|
+
interface DashboardUpdateInput {
|
|
398
|
+
name?: string;
|
|
399
|
+
description?: string;
|
|
400
|
+
content_json?: string;
|
|
401
|
+
widget_config?: Record<string, unknown>;
|
|
402
|
+
editor_type?: "blocknote" | "custom";
|
|
403
|
+
datasource_id?: string | null;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Dashboard list options
|
|
407
|
+
*/
|
|
408
|
+
interface DashboardListOptions {
|
|
409
|
+
tenantId?: string;
|
|
410
|
+
userId?: string;
|
|
411
|
+
scopes?: string[];
|
|
412
|
+
pagination?: PaginationQuery$1;
|
|
413
|
+
status?: "draft" | "deployed";
|
|
414
|
+
sortBy?: "name" | "created_at" | "updated_at" | "deployed_at";
|
|
415
|
+
sortDir?: "asc" | "desc";
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Fork dashboard input
|
|
419
|
+
*/
|
|
420
|
+
interface DashboardForkInput {
|
|
421
|
+
tenant_id: string;
|
|
422
|
+
name?: string;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Fork update input
|
|
426
|
+
*/
|
|
427
|
+
interface DashboardForkUpdateInput {
|
|
428
|
+
tenant_id: string;
|
|
429
|
+
content_json?: string;
|
|
430
|
+
widget_config?: Record<string, unknown>;
|
|
431
|
+
}
|
|
432
|
+
|
|
318
433
|
interface IngestResponse {
|
|
319
434
|
success: boolean;
|
|
320
435
|
message: string;
|
|
@@ -741,6 +856,8 @@ interface ChartModifyOptions {
|
|
|
741
856
|
* QueryPanel session ID for context-aware follow-ups.
|
|
742
857
|
* Pass the querypanelSessionId from a previous ask() response
|
|
743
858
|
* to preserve conversation history when modifying charts.
|
|
859
|
+
* If omitted, modifyChart starts a new QueryPanel session and sends
|
|
860
|
+
* the original question with modification hints.
|
|
744
861
|
*/
|
|
745
862
|
querypanelSessionId?: string;
|
|
746
863
|
}
|
|
@@ -869,19 +986,84 @@ interface VizSpecResponse {
|
|
|
869
986
|
notes: string | null;
|
|
870
987
|
}
|
|
871
988
|
|
|
989
|
+
/**
|
|
990
|
+
* API client that delegates every request to a callback instead of HTTP.
|
|
991
|
+
* Use this when running the SDK inside your own API so that "API" calls are handled in-process (e.g. by calling querypanel-sdk services directly) and do not cause recursion.
|
|
992
|
+
*/
|
|
993
|
+
declare class CallbackApiClient implements IQueryPanelApi {
|
|
994
|
+
private readonly requestHandler;
|
|
995
|
+
private readonly defaultTenantId?;
|
|
996
|
+
constructor(requestHandler: RequestHandler, options?: {
|
|
997
|
+
defaultTenantId?: string;
|
|
998
|
+
});
|
|
999
|
+
getDefaultTenantId(): string | undefined;
|
|
1000
|
+
private request;
|
|
1001
|
+
get<T>(path: string, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
1002
|
+
post<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
1003
|
+
postWithHeaders<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<{
|
|
1004
|
+
data: T;
|
|
1005
|
+
headers: Headers;
|
|
1006
|
+
}>;
|
|
1007
|
+
put<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
1008
|
+
patch<T>(path: string, body: unknown, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
1009
|
+
delete<T = void>(path: string, tenantId: string, userId?: string, scopes?: string[], signal?: AbortSignal, sessionId?: string): Promise<T>;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/** Options when constructing the SDK with HTTP (default) or with a custom API implementation. */
|
|
1013
|
+
interface QueryPanelSdkAPIOptions {
|
|
1014
|
+
defaultTenantId?: string;
|
|
1015
|
+
additionalHeaders?: Record<string, string>;
|
|
1016
|
+
fetch?: typeof fetch;
|
|
1017
|
+
/**
|
|
1018
|
+
* Use a custom API implementation (e.g. CallbackApiClient) instead of HTTP.
|
|
1019
|
+
* When set, baseUrl and privateKey are ignored and no requests are sent to querypanel-sdk;
|
|
1020
|
+
* use this when calling the SDK from within your own API to avoid recursion.
|
|
1021
|
+
*/
|
|
1022
|
+
api?: IQueryPanelApi;
|
|
1023
|
+
}
|
|
872
1024
|
/**
|
|
873
1025
|
* Main SDK class - Thin orchestrator
|
|
874
|
-
* Delegates to deep modules (ApiClient, QueryEngine, route modules)
|
|
1026
|
+
* Delegates to deep modules (ApiClient or custom API, QueryEngine, route modules)
|
|
875
1027
|
* Following Ousterhout's principle: "Simple interface hiding complexity"
|
|
876
1028
|
*/
|
|
877
1029
|
declare class QueryPanelSdkAPI {
|
|
878
1030
|
private readonly client;
|
|
879
1031
|
private readonly queryEngine;
|
|
880
|
-
constructor(baseUrl: string, privateKey: string, organizationId: string, options?:
|
|
1032
|
+
constructor(baseUrl: string, privateKey: string, organizationId: string, options?: QueryPanelSdkAPIOptions);
|
|
1033
|
+
/**
|
|
1034
|
+
* Create an SDK instance that uses a request callback instead of HTTP.
|
|
1035
|
+
* Use this when calling the SDK from within your own API so that "API" calls
|
|
1036
|
+
* are handled in-process (e.g. by invoking querypanel-sdk services directly)
|
|
1037
|
+
* and do not cause recursion.
|
|
1038
|
+
*
|
|
1039
|
+
* @param organizationId - Organization identifier
|
|
1040
|
+
* @param requestHandler - Callback invoked for each logical API request (method, path, body, tenantId, etc.)
|
|
1041
|
+
* @param options - Optional defaultTenantId
|
|
1042
|
+
* @returns QueryPanelSdkAPI instance; attach databases and call ask(), syncSchema(), etc. as usual
|
|
1043
|
+
*
|
|
1044
|
+
* @example
|
|
1045
|
+
* ```ts
|
|
1046
|
+
* const qp = QueryPanelSdkAPI.withCallbacks(
|
|
1047
|
+
* process.env.ORGANIZATION_ID!,
|
|
1048
|
+
* async (opts) => {
|
|
1049
|
+
* // Call your in-process services (e.g. querypanel-sdk logic) instead of HTTP
|
|
1050
|
+
* if (opts.path === '/query' || opts.path === '/v2/query') {
|
|
1051
|
+
* const result = await yourSqlGenerator.generate(opts.body, opts.tenantId);
|
|
1052
|
+
* return { data: result, headers: new Headers({ 'x-querypanel-session-id': result.sessionId }) };
|
|
1053
|
+
* }
|
|
1054
|
+
* if (opts.path === '/chart') return { data: await yourChartService.generate(opts.body) };
|
|
1055
|
+
* // ... other paths
|
|
1056
|
+
* return { data: await yourProxy(opts) };
|
|
1057
|
+
* },
|
|
1058
|
+
* { defaultTenantId: process.env.DEFAULT_TENANT_ID }
|
|
1059
|
+
* );
|
|
1060
|
+
* qp.attachPostgres('db', createClient, { tenantFieldName: 'tenant_id' });
|
|
1061
|
+
* const result = await qp.ask('Top 10 orders', { tenantId: 't1', database: 'db' });
|
|
1062
|
+
* ```
|
|
1063
|
+
*/
|
|
1064
|
+
static withCallbacks(organizationId: string, requestHandler: RequestHandler, options?: {
|
|
881
1065
|
defaultTenantId?: string;
|
|
882
|
-
|
|
883
|
-
fetch?: typeof fetch;
|
|
884
|
-
});
|
|
1066
|
+
}): QueryPanelSdkAPI;
|
|
885
1067
|
attachClickhouse(name: string, clientFn: ClickHouseClientFn, options?: ClickHouseAdapterOptions & {
|
|
886
1068
|
description?: string;
|
|
887
1069
|
tags?: string[];
|
|
@@ -955,6 +1137,31 @@ declare class QueryPanelSdkAPI {
|
|
|
955
1137
|
* ```
|
|
956
1138
|
*/
|
|
957
1139
|
ask(question: string, options: AskOptions, signal?: AbortSignal): Promise<AskResponse>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Creates a JWT for the given tenant (and optional userId, scopes).
|
|
1142
|
+
* Use this when you need to pass a token to the embed (e.g. frontend or demo).
|
|
1143
|
+
* Only available when using the HTTP client (ApiClient); not available when using withCallbacks.
|
|
1144
|
+
*/
|
|
1145
|
+
createJwt(options: {
|
|
1146
|
+
tenantId: string;
|
|
1147
|
+
userId?: string;
|
|
1148
|
+
scopes?: string[];
|
|
1149
|
+
}): Promise<string>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Runs SQL against an attached database with tenant isolation applied.
|
|
1152
|
+
* Used by embed run-sql (e.g. dashboard chart execution). Requires a database
|
|
1153
|
+
* to be attached (e.g. via attachPostgres) and options.tenantId.
|
|
1154
|
+
*/
|
|
1155
|
+
runSqlForDashboard(input: {
|
|
1156
|
+
sql: string;
|
|
1157
|
+
params?: Record<string, unknown>;
|
|
1158
|
+
database?: string;
|
|
1159
|
+
}, options: {
|
|
1160
|
+
tenantId: string;
|
|
1161
|
+
}): Promise<{
|
|
1162
|
+
rows: unknown[];
|
|
1163
|
+
fields: string[];
|
|
1164
|
+
}>;
|
|
958
1165
|
/**
|
|
959
1166
|
* Generates a VizSpec visualization specification from query results.
|
|
960
1167
|
*
|
|
@@ -1336,6 +1543,248 @@ declare class QueryPanelSdkAPI {
|
|
|
1336
1543
|
userId?: string;
|
|
1337
1544
|
scopes?: string[];
|
|
1338
1545
|
}, signal?: AbortSignal): Promise<void>;
|
|
1546
|
+
/**
|
|
1547
|
+
* Creates a new dashboard with BlockNote content.
|
|
1548
|
+
*
|
|
1549
|
+
* @param body - Dashboard configuration including name and BlockNote content
|
|
1550
|
+
* @param options - Tenant, user, and scope options
|
|
1551
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1552
|
+
* @returns Created dashboard
|
|
1553
|
+
*
|
|
1554
|
+
* @example
|
|
1555
|
+
* ```typescript
|
|
1556
|
+
* const dashboard = await qp.createDashboard({
|
|
1557
|
+
* name: "Sales Dashboard",
|
|
1558
|
+
* description: "Monthly sales metrics",
|
|
1559
|
+
* content_json: blockNoteContent,
|
|
1560
|
+
* editor_type: "blocknote",
|
|
1561
|
+
* }, { tenantId: "tenant_123" });
|
|
1562
|
+
* ```
|
|
1563
|
+
*/
|
|
1564
|
+
createDashboard(body: DashboardCreateInput, options?: {
|
|
1565
|
+
tenantId?: string;
|
|
1566
|
+
userId?: string;
|
|
1567
|
+
scopes?: string[];
|
|
1568
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Lists dashboards with pagination and filtering.
|
|
1571
|
+
*
|
|
1572
|
+
* @param options - Filtering and pagination options
|
|
1573
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1574
|
+
* @returns Paginated list of dashboards
|
|
1575
|
+
*
|
|
1576
|
+
* @example
|
|
1577
|
+
* ```typescript
|
|
1578
|
+
* const dashboards = await qp.listDashboards({
|
|
1579
|
+
* tenantId: "tenant_123",
|
|
1580
|
+
* status: "deployed",
|
|
1581
|
+
* pagination: { page: 1, limit: 10 },
|
|
1582
|
+
* });
|
|
1583
|
+
* ```
|
|
1584
|
+
*/
|
|
1585
|
+
listDashboards(options?: DashboardListOptions, signal?: AbortSignal): Promise<PaginatedResponse$1<SdkDashboard>>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Gets a dashboard by ID.
|
|
1588
|
+
*
|
|
1589
|
+
* @param id - Dashboard ID
|
|
1590
|
+
* @param options - Tenant, user, and scope options
|
|
1591
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1592
|
+
* @returns Dashboard details
|
|
1593
|
+
*
|
|
1594
|
+
* @example
|
|
1595
|
+
* ```typescript
|
|
1596
|
+
* const dashboard = await qp.getDashboard("dash_123", {
|
|
1597
|
+
* tenantId: "tenant_123",
|
|
1598
|
+
* });
|
|
1599
|
+
* ```
|
|
1600
|
+
*/
|
|
1601
|
+
getDashboard(id: string, options?: {
|
|
1602
|
+
tenantId?: string;
|
|
1603
|
+
userId?: string;
|
|
1604
|
+
scopes?: string[];
|
|
1605
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Gets a dashboard for a specific tenant.
|
|
1608
|
+
* Returns customer fork if exists, otherwise returns the original dashboard.
|
|
1609
|
+
*
|
|
1610
|
+
* @param id - Dashboard ID
|
|
1611
|
+
* @param tenantId - Tenant ID to check for fork
|
|
1612
|
+
* @param options - Additional auth options
|
|
1613
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1614
|
+
* @returns Dashboard (fork if exists, original otherwise)
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* ```typescript
|
|
1618
|
+
* const dashboard = await qp.getDashboardForTenant(
|
|
1619
|
+
* "dash_123",
|
|
1620
|
+
* "tenant_456",
|
|
1621
|
+
* );
|
|
1622
|
+
* ```
|
|
1623
|
+
*/
|
|
1624
|
+
getDashboardForTenant(id: string, tenantId: string, options?: {
|
|
1625
|
+
userId?: string;
|
|
1626
|
+
scopes?: string[];
|
|
1627
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1628
|
+
/**
|
|
1629
|
+
* Updates a dashboard.
|
|
1630
|
+
*
|
|
1631
|
+
* @param id - Dashboard ID to update
|
|
1632
|
+
* @param body - Fields to update
|
|
1633
|
+
* @param options - Tenant, user, and scope options
|
|
1634
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1635
|
+
* @returns Updated dashboard
|
|
1636
|
+
*
|
|
1637
|
+
* @example
|
|
1638
|
+
* ```typescript
|
|
1639
|
+
* const updated = await qp.updateDashboard("dash_123", {
|
|
1640
|
+
* name: "Updated Dashboard",
|
|
1641
|
+
* content_json: newBlockNoteContent,
|
|
1642
|
+
* }, { tenantId: "tenant_123" });
|
|
1643
|
+
* ```
|
|
1644
|
+
*/
|
|
1645
|
+
updateDashboard(id: string, body: DashboardUpdateInput, options?: {
|
|
1646
|
+
tenantId?: string;
|
|
1647
|
+
userId?: string;
|
|
1648
|
+
scopes?: string[];
|
|
1649
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Updates dashboard status (deploy/undeploy).
|
|
1652
|
+
*
|
|
1653
|
+
* @param id - Dashboard ID
|
|
1654
|
+
* @param status - New status
|
|
1655
|
+
* @param options - Tenant, user, and scope options
|
|
1656
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1657
|
+
* @returns Updated dashboard
|
|
1658
|
+
*
|
|
1659
|
+
* @example
|
|
1660
|
+
* ```typescript
|
|
1661
|
+
* const deployed = await qp.updateDashboardStatus(
|
|
1662
|
+
* "dash_123",
|
|
1663
|
+
* "deployed",
|
|
1664
|
+
* { tenantId: "tenant_123" },
|
|
1665
|
+
* );
|
|
1666
|
+
* ```
|
|
1667
|
+
*/
|
|
1668
|
+
updateDashboardStatus(id: string, status: "draft" | "deployed", options?: {
|
|
1669
|
+
tenantId?: string;
|
|
1670
|
+
userId?: string;
|
|
1671
|
+
scopes?: string[];
|
|
1672
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1673
|
+
/**
|
|
1674
|
+
* Deletes a dashboard.
|
|
1675
|
+
*
|
|
1676
|
+
* @param id - Dashboard ID to delete
|
|
1677
|
+
* @param options - Tenant, user, and scope options
|
|
1678
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1679
|
+
*
|
|
1680
|
+
* @example
|
|
1681
|
+
* ```typescript
|
|
1682
|
+
* await qp.deleteDashboard("dash_123", { tenantId: "tenant_123" });
|
|
1683
|
+
* ```
|
|
1684
|
+
*/
|
|
1685
|
+
deleteDashboard(id: string, options?: {
|
|
1686
|
+
tenantId?: string;
|
|
1687
|
+
userId?: string;
|
|
1688
|
+
scopes?: string[];
|
|
1689
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
1690
|
+
/**
|
|
1691
|
+
* Forks a dashboard for customer customization (copy-on-write).
|
|
1692
|
+
*
|
|
1693
|
+
* Creates a full copy of the dashboard that the customer can edit independently.
|
|
1694
|
+
* The original dashboard remains unchanged.
|
|
1695
|
+
*
|
|
1696
|
+
* @param id - Dashboard ID to fork
|
|
1697
|
+
* @param input - Fork configuration with tenant_id
|
|
1698
|
+
* @param options - Additional auth options
|
|
1699
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1700
|
+
* @returns Forked dashboard
|
|
1701
|
+
*
|
|
1702
|
+
* @example
|
|
1703
|
+
* ```typescript
|
|
1704
|
+
* const fork = await qp.forkDashboard("dash_123", {
|
|
1705
|
+
* tenant_id: "tenant_456",
|
|
1706
|
+
* name: "Customer's Custom Dashboard",
|
|
1707
|
+
* });
|
|
1708
|
+
* ```
|
|
1709
|
+
*/
|
|
1710
|
+
forkDashboard(id: string, input: DashboardForkInput, options?: {
|
|
1711
|
+
userId?: string;
|
|
1712
|
+
scopes?: string[];
|
|
1713
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Updates a customer fork.
|
|
1716
|
+
*
|
|
1717
|
+
* @param forkId - Fork ID to update
|
|
1718
|
+
* @param input - Update data including tenant_id
|
|
1719
|
+
* @param options - Additional auth options
|
|
1720
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1721
|
+
* @returns Updated fork
|
|
1722
|
+
*
|
|
1723
|
+
* @example
|
|
1724
|
+
* ```typescript
|
|
1725
|
+
* const updated = await qp.updateFork("fork_123", {
|
|
1726
|
+
* tenant_id: "tenant_456",
|
|
1727
|
+
* content_json: newBlockNoteContent,
|
|
1728
|
+
* });
|
|
1729
|
+
* ```
|
|
1730
|
+
*/
|
|
1731
|
+
updateFork(forkId: string, input: DashboardForkUpdateInput, options?: {
|
|
1732
|
+
userId?: string;
|
|
1733
|
+
scopes?: string[];
|
|
1734
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1735
|
+
/**
|
|
1736
|
+
* Rollbacks a fork to the original dashboard.
|
|
1737
|
+
* This deletes the fork and the customer will see the original again.
|
|
1738
|
+
*
|
|
1739
|
+
* @param forkId - Fork ID to rollback
|
|
1740
|
+
* @param tenantId - Tenant ID
|
|
1741
|
+
* @param options - Additional auth options
|
|
1742
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1743
|
+
* @returns Original dashboard
|
|
1744
|
+
*
|
|
1745
|
+
* @example
|
|
1746
|
+
* ```typescript
|
|
1747
|
+
* const original = await qp.rollbackFork("fork_123", "tenant_456");
|
|
1748
|
+
* ```
|
|
1749
|
+
*/
|
|
1750
|
+
rollbackFork(forkId: string, tenantId: string, options?: {
|
|
1751
|
+
userId?: string;
|
|
1752
|
+
scopes?: string[];
|
|
1753
|
+
}, signal?: AbortSignal): Promise<SdkDashboard>;
|
|
1754
|
+
/**
|
|
1755
|
+
* Deletes a customer fork.
|
|
1756
|
+
*
|
|
1757
|
+
* @param forkId - Fork ID to delete
|
|
1758
|
+
* @param tenantId - Tenant ID
|
|
1759
|
+
* @param options - Additional auth options
|
|
1760
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1761
|
+
*
|
|
1762
|
+
* @example
|
|
1763
|
+
* ```typescript
|
|
1764
|
+
* await qp.deleteFork("fork_123", "tenant_456");
|
|
1765
|
+
* ```
|
|
1766
|
+
*/
|
|
1767
|
+
deleteFork(forkId: string, tenantId: string, options?: {
|
|
1768
|
+
userId?: string;
|
|
1769
|
+
scopes?: string[];
|
|
1770
|
+
}, signal?: AbortSignal): Promise<void>;
|
|
1771
|
+
/**
|
|
1772
|
+
* Lists all customer forks for a tenant.
|
|
1773
|
+
*
|
|
1774
|
+
* @param tenantId - Tenant ID
|
|
1775
|
+
* @param options - Additional auth options
|
|
1776
|
+
* @param signal - Optional AbortSignal for cancellation
|
|
1777
|
+
* @returns Array of forks
|
|
1778
|
+
*
|
|
1779
|
+
* @example
|
|
1780
|
+
* ```typescript
|
|
1781
|
+
* const forks = await qp.listForksForTenant("tenant_456");
|
|
1782
|
+
* ```
|
|
1783
|
+
*/
|
|
1784
|
+
listForksForTenant(tenantId: string, options?: {
|
|
1785
|
+
userId?: string;
|
|
1786
|
+
scopes?: string[];
|
|
1787
|
+
}, signal?: AbortSignal): Promise<SdkDashboard[]>;
|
|
1339
1788
|
}
|
|
1340
1789
|
|
|
1341
|
-
export { type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListOptions, type ChartModifyInput, type ChartModifyOptions, type ChartModifyResponse, type ChartSpec, type ChartType, type ChartUpdateInput, ClickHouseAdapter, type ClickHouseAdapterOptions, type ClickHouseClientFn, type ContextDocument, type DatabaseAdapter, type DatabaseDialect, type DateRangeInput, type EncodingHints, type FieldRef, type FieldRefInput, type FieldType, type IngestResponse, type IntentResult, type MetricEncoding, type MetricField, type MetricSpec, type PaginatedResponse$1 as PaginatedResponse, type PaginationInfo$1 as PaginationInfo, type PaginationQuery$1 as PaginationQuery, type ParamRecord, type ParamValue, type PipelineTrace, PostgresAdapter, type PostgresAdapterOptions, type PostgresClientFn, QueryErrorCode, QueryErrorCode as QueryErrorCodeType, QueryPanelSdkAPI, QueryPipelineError, type SchemaIntrospection, type SchemaSyncOptions, type SdkActiveChart, type SdkChart, type SdkSession, type SdkSessionTurn, type SessionGetOptions, type SessionListOptions, type SessionUpdateInput, type SqlModifications, type StackingMode, type TableColumn, type TableEncoding, type TableSpec, type TimeUnit, type ValueFormat, type VizModifications, type VizSpec, type VizSpecGenerateInput, type VizSpecGenerateOptions, type VizSpecGeneratorInput, type VizSpecKind, type VizSpecResponse, type VizSpecResult, anonymizeResults };
|
|
1790
|
+
export { type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, CallbackApiClient, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListOptions, type ChartModifyInput, type ChartModifyOptions, type ChartModifyResponse, type ChartSpec, type ChartType, type ChartUpdateInput, ClickHouseAdapter, type ClickHouseAdapterOptions, type ClickHouseClientFn, type ContextDocument, type DashboardCreateInput, type DashboardForkInput, type DashboardForkUpdateInput, type DashboardListOptions, type DashboardUpdateInput, type DatabaseAdapter, type DatabaseDialect, type DateRangeInput, type EncodingHints, type FieldRef, type FieldRefInput, type FieldType, type IQueryPanelApi, type IngestResponse, type IntentResult, type MetricEncoding, type MetricField, type MetricSpec, type PaginatedResponse$1 as PaginatedResponse, type PaginationInfo$1 as PaginationInfo, type PaginationQuery$1 as PaginationQuery, type ParamRecord, type ParamValue, type PipelineTrace, PostgresAdapter, type PostgresAdapterOptions, type PostgresClientFn, QueryErrorCode, QueryErrorCode as QueryErrorCodeType, QueryPanelSdkAPI, type QueryPanelSdkAPIOptions, QueryPipelineError, type RequestHandler, type RequestHandlerOptions, type RequestHandlerResult, type SchemaIntrospection, type SchemaSyncOptions, type SdkActiveChart, type SdkChart, type SdkDashboard, type SdkSession, type SdkSessionTurn, type SessionGetOptions, type SessionListOptions, type SessionUpdateInput, type SqlModifications, type StackingMode, type TableColumn, type TableEncoding, type TableSpec, type TimeUnit, type ValueFormat, type VizModifications, type VizSpec, type VizSpecGenerateInput, type VizSpecGenerateOptions, type VizSpecGeneratorInput, type VizSpecKind, type VizSpecResponse, type VizSpecResult, anonymizeResults };
|