@querypanel/node-sdk 1.2.1 → 1.2.3
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 +38 -0
- package/dist/index.cjs +40 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -1
- package/dist/index.d.ts +34 -1
- package/dist/index.js +39 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -554,6 +554,8 @@ interface VizSpecBase {
|
|
|
554
554
|
}
|
|
555
555
|
type VizSpecKind = VizSpecBase["kind"];
|
|
556
556
|
type ChartType = 'line' | 'bar' | 'column' | 'area' | 'scatter' | 'pie';
|
|
557
|
+
/** Full VizSpec chart catalog; use when building a custom `supportedChartTypes` list. */
|
|
558
|
+
declare const ALL_VIZ_CHART_TYPES: readonly ChartType[];
|
|
557
559
|
type StackingMode = 'none' | 'stacked' | 'percent';
|
|
558
560
|
interface ChartEncoding {
|
|
559
561
|
chartType: ChartType;
|
|
@@ -708,6 +710,23 @@ interface AskOptions {
|
|
|
708
710
|
* Optional OpenAI model id for v2 SQL generation. Omit to use server default.
|
|
709
711
|
*/
|
|
710
712
|
model?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Optional additional system prompt text for the v2 pipeline.
|
|
715
|
+
*
|
|
716
|
+
* This is appended to the backend's SQL generator/reflection system prompts
|
|
717
|
+
* (it does not change tenant isolation mechanics; it only guides the LLM).
|
|
718
|
+
*
|
|
719
|
+
* Use this for tenant-specific policies (e.g. retention windows) that must
|
|
720
|
+
* be enforced on every query.
|
|
721
|
+
*
|
|
722
|
+
* Only sent when `pipeline: "v2"`.
|
|
723
|
+
*/
|
|
724
|
+
systemPrompt?: string;
|
|
725
|
+
/**
|
|
726
|
+
* Restrict VizSpec `chartType` values when `chartType` is `"vizspec"`.
|
|
727
|
+
* Sent to `POST /vizspec` as `supported_chart_types`. Omitted allows all standard types.
|
|
728
|
+
*/
|
|
729
|
+
supportedChartTypes?: ChartType[];
|
|
711
730
|
}
|
|
712
731
|
/**
|
|
713
732
|
* Intent analysis result from the v2 pipeline.
|
|
@@ -928,6 +947,10 @@ interface ChartModifyOptions {
|
|
|
928
947
|
* the original question with modification hints.
|
|
929
948
|
*/
|
|
930
949
|
querypanelSessionId?: string;
|
|
950
|
+
/**
|
|
951
|
+
* Restrict VizSpec chart types for this call (merged with SDK default from constructor when omitted).
|
|
952
|
+
*/
|
|
953
|
+
supportedChartTypes?: ChartType[];
|
|
931
954
|
}
|
|
932
955
|
/**
|
|
933
956
|
* Response from modifyChart(), extending AskResponse with modification metadata.
|
|
@@ -1042,6 +1065,8 @@ interface VizSpecGenerateInput {
|
|
|
1042
1065
|
* When provided, these guide the LLM to generate specific visualization configurations.
|
|
1043
1066
|
*/
|
|
1044
1067
|
encoding_hints?: EncodingHints;
|
|
1068
|
+
/** When set, VizSpec kind "chart" may only use these chart types (API: supported_chart_types). */
|
|
1069
|
+
supported_chart_types?: ChartType[];
|
|
1045
1070
|
}
|
|
1046
1071
|
interface VizSpecGenerateOptions {
|
|
1047
1072
|
tenantId?: string;
|
|
@@ -1088,6 +1113,12 @@ interface QueryPanelSdkAPIOptions {
|
|
|
1088
1113
|
* use this when calling the SDK from within your own API to avoid recursion.
|
|
1089
1114
|
*/
|
|
1090
1115
|
api?: IQueryPanelApi;
|
|
1116
|
+
/**
|
|
1117
|
+
* Restrict VizSpec chart kinds (when using `chartType: "vizspec"`).
|
|
1118
|
+
* Omitted means all types: line, bar, column, area, scatter, pie.
|
|
1119
|
+
* Per-request `supportedChartTypes` on `ask` / `modifyChart` overrides this default.
|
|
1120
|
+
*/
|
|
1121
|
+
supportedChartTypes?: ChartType[];
|
|
1091
1122
|
}
|
|
1092
1123
|
/**
|
|
1093
1124
|
* Main SDK class - Thin orchestrator
|
|
@@ -1097,6 +1128,7 @@ interface QueryPanelSdkAPIOptions {
|
|
|
1097
1128
|
declare class QueryPanelSdkAPI {
|
|
1098
1129
|
private readonly client;
|
|
1099
1130
|
private readonly queryEngine;
|
|
1131
|
+
private readonly supportedChartTypes?;
|
|
1100
1132
|
/**
|
|
1101
1133
|
* @param workspaceId - Workspace UUID (same value as your org in the dashboard). Passed to the API as JWT claim `organizationId`.
|
|
1102
1134
|
*/
|
|
@@ -1134,6 +1166,7 @@ declare class QueryPanelSdkAPI {
|
|
|
1134
1166
|
*/
|
|
1135
1167
|
static withCallbacks(workspaceId: string, requestHandler: RequestHandler, options?: {
|
|
1136
1168
|
defaultTenantId?: string;
|
|
1169
|
+
supportedChartTypes?: ChartType[];
|
|
1137
1170
|
}): QueryPanelSdkAPI;
|
|
1138
1171
|
attachClickhouse(name: string, clientFn: ClickHouseClientFn, options?: ClickHouseAdapterOptions & {
|
|
1139
1172
|
description?: string;
|
|
@@ -1865,4 +1898,4 @@ declare class QueryPanelSdkAPI {
|
|
|
1865
1898
|
}, signal?: AbortSignal): Promise<SdkDashboard[]>;
|
|
1866
1899
|
}
|
|
1867
1900
|
|
|
1868
|
-
export { type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, BigQueryAdapter, type BigQueryAdapterOptions, type BigQueryClientFn, type BigQueryQueryRequest, type BigQueryQueryResult, 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 };
|
|
1901
|
+
export { ALL_VIZ_CHART_TYPES, type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, BigQueryAdapter, type BigQueryAdapterOptions, type BigQueryClientFn, type BigQueryQueryRequest, type BigQueryQueryResult, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -554,6 +554,8 @@ interface VizSpecBase {
|
|
|
554
554
|
}
|
|
555
555
|
type VizSpecKind = VizSpecBase["kind"];
|
|
556
556
|
type ChartType = 'line' | 'bar' | 'column' | 'area' | 'scatter' | 'pie';
|
|
557
|
+
/** Full VizSpec chart catalog; use when building a custom `supportedChartTypes` list. */
|
|
558
|
+
declare const ALL_VIZ_CHART_TYPES: readonly ChartType[];
|
|
557
559
|
type StackingMode = 'none' | 'stacked' | 'percent';
|
|
558
560
|
interface ChartEncoding {
|
|
559
561
|
chartType: ChartType;
|
|
@@ -708,6 +710,23 @@ interface AskOptions {
|
|
|
708
710
|
* Optional OpenAI model id for v2 SQL generation. Omit to use server default.
|
|
709
711
|
*/
|
|
710
712
|
model?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Optional additional system prompt text for the v2 pipeline.
|
|
715
|
+
*
|
|
716
|
+
* This is appended to the backend's SQL generator/reflection system prompts
|
|
717
|
+
* (it does not change tenant isolation mechanics; it only guides the LLM).
|
|
718
|
+
*
|
|
719
|
+
* Use this for tenant-specific policies (e.g. retention windows) that must
|
|
720
|
+
* be enforced on every query.
|
|
721
|
+
*
|
|
722
|
+
* Only sent when `pipeline: "v2"`.
|
|
723
|
+
*/
|
|
724
|
+
systemPrompt?: string;
|
|
725
|
+
/**
|
|
726
|
+
* Restrict VizSpec `chartType` values when `chartType` is `"vizspec"`.
|
|
727
|
+
* Sent to `POST /vizspec` as `supported_chart_types`. Omitted allows all standard types.
|
|
728
|
+
*/
|
|
729
|
+
supportedChartTypes?: ChartType[];
|
|
711
730
|
}
|
|
712
731
|
/**
|
|
713
732
|
* Intent analysis result from the v2 pipeline.
|
|
@@ -928,6 +947,10 @@ interface ChartModifyOptions {
|
|
|
928
947
|
* the original question with modification hints.
|
|
929
948
|
*/
|
|
930
949
|
querypanelSessionId?: string;
|
|
950
|
+
/**
|
|
951
|
+
* Restrict VizSpec chart types for this call (merged with SDK default from constructor when omitted).
|
|
952
|
+
*/
|
|
953
|
+
supportedChartTypes?: ChartType[];
|
|
931
954
|
}
|
|
932
955
|
/**
|
|
933
956
|
* Response from modifyChart(), extending AskResponse with modification metadata.
|
|
@@ -1042,6 +1065,8 @@ interface VizSpecGenerateInput {
|
|
|
1042
1065
|
* When provided, these guide the LLM to generate specific visualization configurations.
|
|
1043
1066
|
*/
|
|
1044
1067
|
encoding_hints?: EncodingHints;
|
|
1068
|
+
/** When set, VizSpec kind "chart" may only use these chart types (API: supported_chart_types). */
|
|
1069
|
+
supported_chart_types?: ChartType[];
|
|
1045
1070
|
}
|
|
1046
1071
|
interface VizSpecGenerateOptions {
|
|
1047
1072
|
tenantId?: string;
|
|
@@ -1088,6 +1113,12 @@ interface QueryPanelSdkAPIOptions {
|
|
|
1088
1113
|
* use this when calling the SDK from within your own API to avoid recursion.
|
|
1089
1114
|
*/
|
|
1090
1115
|
api?: IQueryPanelApi;
|
|
1116
|
+
/**
|
|
1117
|
+
* Restrict VizSpec chart kinds (when using `chartType: "vizspec"`).
|
|
1118
|
+
* Omitted means all types: line, bar, column, area, scatter, pie.
|
|
1119
|
+
* Per-request `supportedChartTypes` on `ask` / `modifyChart` overrides this default.
|
|
1120
|
+
*/
|
|
1121
|
+
supportedChartTypes?: ChartType[];
|
|
1091
1122
|
}
|
|
1092
1123
|
/**
|
|
1093
1124
|
* Main SDK class - Thin orchestrator
|
|
@@ -1097,6 +1128,7 @@ interface QueryPanelSdkAPIOptions {
|
|
|
1097
1128
|
declare class QueryPanelSdkAPI {
|
|
1098
1129
|
private readonly client;
|
|
1099
1130
|
private readonly queryEngine;
|
|
1131
|
+
private readonly supportedChartTypes?;
|
|
1100
1132
|
/**
|
|
1101
1133
|
* @param workspaceId - Workspace UUID (same value as your org in the dashboard). Passed to the API as JWT claim `organizationId`.
|
|
1102
1134
|
*/
|
|
@@ -1134,6 +1166,7 @@ declare class QueryPanelSdkAPI {
|
|
|
1134
1166
|
*/
|
|
1135
1167
|
static withCallbacks(workspaceId: string, requestHandler: RequestHandler, options?: {
|
|
1136
1168
|
defaultTenantId?: string;
|
|
1169
|
+
supportedChartTypes?: ChartType[];
|
|
1137
1170
|
}): QueryPanelSdkAPI;
|
|
1138
1171
|
attachClickhouse(name: string, clientFn: ClickHouseClientFn, options?: ClickHouseAdapterOptions & {
|
|
1139
1172
|
description?: string;
|
|
@@ -1865,4 +1898,4 @@ declare class QueryPanelSdkAPI {
|
|
|
1865
1898
|
}, signal?: AbortSignal): Promise<SdkDashboard[]>;
|
|
1866
1899
|
}
|
|
1867
1900
|
|
|
1868
|
-
export { type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, BigQueryAdapter, type BigQueryAdapterOptions, type BigQueryClientFn, type BigQueryQueryRequest, type BigQueryQueryResult, 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 };
|
|
1901
|
+
export { ALL_VIZ_CHART_TYPES, type ActiveChartCreateInput, type ActiveChartListOptions, type ActiveChartUpdateInput, type AggregateOp, type AskOptions, type AskResponse, type AxisField, type AxisFieldInput, BigQueryAdapter, type BigQueryAdapterOptions, type BigQueryClientFn, type BigQueryQueryRequest, type BigQueryQueryResult, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1722,7 +1722,8 @@ async function ask(client, queryEngine, question, options, signal) {
|
|
|
1722
1722
|
...tenantSettings ? { tenant_settings: tenantSettings } : {},
|
|
1723
1723
|
...databaseName ? { database: databaseName } : {},
|
|
1724
1724
|
...metadata?.dialect ? { dialect: metadata.dialect } : {},
|
|
1725
|
-
...options.model?.trim() ? { model: options.model.trim() } : {}
|
|
1725
|
+
...options.model?.trim() ? { model: options.model.trim() } : {},
|
|
1726
|
+
...options.pipeline === "v2" && options.systemPrompt?.trim() ? { system_prompt: options.systemPrompt.trim() } : {}
|
|
1726
1727
|
},
|
|
1727
1728
|
tenantId,
|
|
1728
1729
|
options.userId,
|
|
@@ -1775,7 +1776,10 @@ async function ask(client, queryEngine, question, options, signal) {
|
|
|
1775
1776
|
fields: execution.fields,
|
|
1776
1777
|
rows: anonymizeResults(rows),
|
|
1777
1778
|
max_retries: options.chartMaxRetries ?? 3,
|
|
1778
|
-
query_id: queryResponse.data.queryId
|
|
1779
|
+
query_id: queryResponse.data.queryId,
|
|
1780
|
+
...options.supportedChartTypes?.length ? {
|
|
1781
|
+
supported_chart_types: options.supportedChartTypes
|
|
1782
|
+
} : {}
|
|
1779
1783
|
},
|
|
1780
1784
|
tenantId,
|
|
1781
1785
|
options.userId,
|
|
@@ -2116,7 +2120,8 @@ async function modifyChart(client, queryEngine, input, options, signal) {
|
|
|
2116
2120
|
max_retries: options?.chartMaxRetries ?? 3,
|
|
2117
2121
|
query_id: queryId,
|
|
2118
2122
|
// Include viz hints for the chart generator
|
|
2119
|
-
...hasVizMods ? { encoding_hints: vizHintsForChart } : {}
|
|
2123
|
+
...hasVizMods ? { encoding_hints: vizHintsForChart } : {},
|
|
2124
|
+
...options?.supportedChartTypes?.length ? { supported_chart_types: options.supportedChartTypes } : {}
|
|
2120
2125
|
},
|
|
2121
2126
|
tenantId,
|
|
2122
2127
|
options?.userId,
|
|
@@ -2263,7 +2268,8 @@ async function generateVizSpec(client, input, options, signal) {
|
|
|
2263
2268
|
rows: input.rows,
|
|
2264
2269
|
max_retries: options?.maxRetries ?? input.max_retries ?? 3,
|
|
2265
2270
|
query_id: input.query_id,
|
|
2266
|
-
encoding_hints: input.encoding_hints
|
|
2271
|
+
encoding_hints: input.encoding_hints,
|
|
2272
|
+
...input.supported_chart_types?.length ? { supported_chart_types: input.supported_chart_types } : {}
|
|
2267
2273
|
},
|
|
2268
2274
|
tenantId,
|
|
2269
2275
|
options?.userId,
|
|
@@ -2283,10 +2289,21 @@ function resolveTenantId8(client, tenantId) {
|
|
|
2283
2289
|
return resolved;
|
|
2284
2290
|
}
|
|
2285
2291
|
|
|
2292
|
+
// src/types/vizspec.ts
|
|
2293
|
+
var ALL_VIZ_CHART_TYPES = [
|
|
2294
|
+
"line",
|
|
2295
|
+
"bar",
|
|
2296
|
+
"column",
|
|
2297
|
+
"area",
|
|
2298
|
+
"scatter",
|
|
2299
|
+
"pie"
|
|
2300
|
+
];
|
|
2301
|
+
|
|
2286
2302
|
// src/index.ts
|
|
2287
2303
|
var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
2288
2304
|
client;
|
|
2289
2305
|
queryEngine;
|
|
2306
|
+
supportedChartTypes;
|
|
2290
2307
|
/**
|
|
2291
2308
|
* @param workspaceId - Workspace UUID (same value as your org in the dashboard). Passed to the API as JWT claim `organizationId`.
|
|
2292
2309
|
*/
|
|
@@ -2304,6 +2321,7 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2304
2321
|
});
|
|
2305
2322
|
}
|
|
2306
2323
|
this.queryEngine = new QueryEngine();
|
|
2324
|
+
this.supportedChartTypes = options?.supportedChartTypes;
|
|
2307
2325
|
}
|
|
2308
2326
|
/**
|
|
2309
2327
|
* Create an SDK instance that uses a request callback instead of HTTP.
|
|
@@ -2340,7 +2358,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2340
2358
|
const api = new CallbackApiClient(requestHandler, {
|
|
2341
2359
|
defaultTenantId: options?.defaultTenantId
|
|
2342
2360
|
});
|
|
2343
|
-
return new _QueryPanelSdkAPI("", "", workspaceId, {
|
|
2361
|
+
return new _QueryPanelSdkAPI("", "", workspaceId, {
|
|
2362
|
+
api,
|
|
2363
|
+
supportedChartTypes: options?.supportedChartTypes
|
|
2364
|
+
});
|
|
2344
2365
|
}
|
|
2345
2366
|
// Database attachment methods
|
|
2346
2367
|
attachClickhouse(name, clientFn, options) {
|
|
@@ -2464,7 +2485,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2464
2485
|
this.client,
|
|
2465
2486
|
this.queryEngine,
|
|
2466
2487
|
question,
|
|
2467
|
-
|
|
2488
|
+
{
|
|
2489
|
+
...options,
|
|
2490
|
+
supportedChartTypes: options.supportedChartTypes ?? this.supportedChartTypes
|
|
2491
|
+
},
|
|
2468
2492
|
signal
|
|
2469
2493
|
);
|
|
2470
2494
|
}
|
|
@@ -2536,7 +2560,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2536
2560
|
async generateVizSpec(input, options, signal) {
|
|
2537
2561
|
return await generateVizSpec(
|
|
2538
2562
|
this.client,
|
|
2539
|
-
|
|
2563
|
+
{
|
|
2564
|
+
...input,
|
|
2565
|
+
supported_chart_types: input.supported_chart_types ?? this.supportedChartTypes
|
|
2566
|
+
},
|
|
2540
2567
|
options,
|
|
2541
2568
|
signal
|
|
2542
2569
|
);
|
|
@@ -2604,7 +2631,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2604
2631
|
this.client,
|
|
2605
2632
|
this.queryEngine,
|
|
2606
2633
|
input,
|
|
2607
|
-
options
|
|
2634
|
+
options ? {
|
|
2635
|
+
...options,
|
|
2636
|
+
supportedChartTypes: options.supportedChartTypes ?? this.supportedChartTypes
|
|
2637
|
+
} : this.supportedChartTypes ? { supportedChartTypes: this.supportedChartTypes } : void 0,
|
|
2608
2638
|
signal
|
|
2609
2639
|
);
|
|
2610
2640
|
}
|
|
@@ -3242,6 +3272,7 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
3242
3272
|
}
|
|
3243
3273
|
};
|
|
3244
3274
|
export {
|
|
3275
|
+
ALL_VIZ_CHART_TYPES,
|
|
3245
3276
|
BigQueryAdapter,
|
|
3246
3277
|
CallbackApiClient,
|
|
3247
3278
|
ClickHouseAdapter,
|