@querypanel/node-sdk 1.3.0-beta.0 → 1.3.0-beta.2
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 +57 -14
- package/dist/index.cjs +57 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -9
- package/dist/index.d.ts +15 -9
- package/dist/index.js +55 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -724,13 +724,14 @@ interface AskOptions {
|
|
|
724
724
|
*/
|
|
725
725
|
querypanelSessionId?: string;
|
|
726
726
|
/**
|
|
727
|
-
* Pipeline version
|
|
728
|
-
*
|
|
729
|
-
* - "v2":
|
|
727
|
+
* Pipeline version for query generation.
|
|
728
|
+
* Defaults to `"v2"` (`POST /v2/query`).
|
|
729
|
+
* - `"v2"` (default): intent planning, hybrid retrieval, schema linking, SQL reflection
|
|
730
|
+
* - `"v1"` (**deprecated**): legacy `POST /query` pipeline — prefer omitting or `"v2"`
|
|
730
731
|
*/
|
|
731
732
|
pipeline?: "v1" | "v2";
|
|
732
733
|
/**
|
|
733
|
-
* Optional model id for
|
|
734
|
+
* Optional model id for SQL generation (e.g. OpenAI or `gemini-*` when the API uses Gemini). Omit for server default.
|
|
734
735
|
*/
|
|
735
736
|
model?: string;
|
|
736
737
|
/**
|
|
@@ -742,7 +743,7 @@ interface AskOptions {
|
|
|
742
743
|
* Use this for tenant-specific policies (e.g. retention windows) that must
|
|
743
744
|
* be enforced on every query.
|
|
744
745
|
*
|
|
745
|
-
*
|
|
746
|
+
* Sent when the resolved pipeline is `"v2"` (the default).
|
|
746
747
|
*/
|
|
747
748
|
systemPrompt?: string;
|
|
748
749
|
/**
|
|
@@ -819,6 +820,10 @@ interface AskResponse {
|
|
|
819
820
|
/** Pipeline execution trace from v2 pipeline. */
|
|
820
821
|
trace?: PipelineTrace;
|
|
821
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* Resolve ask/modify pipeline. Defaults to v2; `"v1"` remains available but deprecated.
|
|
825
|
+
*/
|
|
826
|
+
declare function resolveQueryPipeline(pipeline?: "v1" | "v2"): "v1" | "v2";
|
|
822
827
|
declare function anonymizeResults(rows: Array<Record<string, unknown>>): Array<Record<string, string>>;
|
|
823
828
|
|
|
824
829
|
/**
|
|
@@ -962,9 +967,10 @@ interface ChartModifyOptions {
|
|
|
962
967
|
/** Chart generation method: 'vega-lite' or 'vizspec' */
|
|
963
968
|
chartType?: "vega-lite" | "vizspec";
|
|
964
969
|
/**
|
|
965
|
-
* Pipeline version
|
|
966
|
-
*
|
|
967
|
-
* - "v2":
|
|
970
|
+
* Pipeline version for SQL regeneration.
|
|
971
|
+
* Defaults to `"v2"` (`POST /v2/query`).
|
|
972
|
+
* - `"v2"` (default): intent planning, hybrid retrieval, schema linking, SQL reflection
|
|
973
|
+
* - `"v1"` (**deprecated**): legacy `POST /query` pipeline — prefer omitting or `"v2"`
|
|
968
974
|
*/
|
|
969
975
|
pipeline?: "v1" | "v2";
|
|
970
976
|
/**
|
|
@@ -1957,4 +1963,4 @@ declare class QueryPanelSdkAPI {
|
|
|
1957
1963
|
}, signal?: AbortSignal): Promise<SdkDashboard[]>;
|
|
1958
1964
|
}
|
|
1959
1965
|
|
|
1960
|
-
export { ALL_VIZ_CHART_TYPES, type ActiveChartBulkGetResponse, 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 ChartBulkGetResponse, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListAllOptions, 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, mapGeneratedParams, normalizeSqlParamsInput };
|
|
1966
|
+
export { ALL_VIZ_CHART_TYPES, type ActiveChartBulkGetResponse, 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 ChartBulkGetResponse, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListAllOptions, 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, mapGeneratedParams, normalizeSqlParamsInput, resolveQueryPipeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -724,13 +724,14 @@ interface AskOptions {
|
|
|
724
724
|
*/
|
|
725
725
|
querypanelSessionId?: string;
|
|
726
726
|
/**
|
|
727
|
-
* Pipeline version
|
|
728
|
-
*
|
|
729
|
-
* - "v2":
|
|
727
|
+
* Pipeline version for query generation.
|
|
728
|
+
* Defaults to `"v2"` (`POST /v2/query`).
|
|
729
|
+
* - `"v2"` (default): intent planning, hybrid retrieval, schema linking, SQL reflection
|
|
730
|
+
* - `"v1"` (**deprecated**): legacy `POST /query` pipeline — prefer omitting or `"v2"`
|
|
730
731
|
*/
|
|
731
732
|
pipeline?: "v1" | "v2";
|
|
732
733
|
/**
|
|
733
|
-
* Optional model id for
|
|
734
|
+
* Optional model id for SQL generation (e.g. OpenAI or `gemini-*` when the API uses Gemini). Omit for server default.
|
|
734
735
|
*/
|
|
735
736
|
model?: string;
|
|
736
737
|
/**
|
|
@@ -742,7 +743,7 @@ interface AskOptions {
|
|
|
742
743
|
* Use this for tenant-specific policies (e.g. retention windows) that must
|
|
743
744
|
* be enforced on every query.
|
|
744
745
|
*
|
|
745
|
-
*
|
|
746
|
+
* Sent when the resolved pipeline is `"v2"` (the default).
|
|
746
747
|
*/
|
|
747
748
|
systemPrompt?: string;
|
|
748
749
|
/**
|
|
@@ -819,6 +820,10 @@ interface AskResponse {
|
|
|
819
820
|
/** Pipeline execution trace from v2 pipeline. */
|
|
820
821
|
trace?: PipelineTrace;
|
|
821
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* Resolve ask/modify pipeline. Defaults to v2; `"v1"` remains available but deprecated.
|
|
825
|
+
*/
|
|
826
|
+
declare function resolveQueryPipeline(pipeline?: "v1" | "v2"): "v1" | "v2";
|
|
822
827
|
declare function anonymizeResults(rows: Array<Record<string, unknown>>): Array<Record<string, string>>;
|
|
823
828
|
|
|
824
829
|
/**
|
|
@@ -962,9 +967,10 @@ interface ChartModifyOptions {
|
|
|
962
967
|
/** Chart generation method: 'vega-lite' or 'vizspec' */
|
|
963
968
|
chartType?: "vega-lite" | "vizspec";
|
|
964
969
|
/**
|
|
965
|
-
* Pipeline version
|
|
966
|
-
*
|
|
967
|
-
* - "v2":
|
|
970
|
+
* Pipeline version for SQL regeneration.
|
|
971
|
+
* Defaults to `"v2"` (`POST /v2/query`).
|
|
972
|
+
* - `"v2"` (default): intent planning, hybrid retrieval, schema linking, SQL reflection
|
|
973
|
+
* - `"v1"` (**deprecated**): legacy `POST /query` pipeline — prefer omitting or `"v2"`
|
|
968
974
|
*/
|
|
969
975
|
pipeline?: "v1" | "v2";
|
|
970
976
|
/**
|
|
@@ -1957,4 +1963,4 @@ declare class QueryPanelSdkAPI {
|
|
|
1957
1963
|
}, signal?: AbortSignal): Promise<SdkDashboard[]>;
|
|
1958
1964
|
}
|
|
1959
1965
|
|
|
1960
|
-
export { ALL_VIZ_CHART_TYPES, type ActiveChartBulkGetResponse, 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 ChartBulkGetResponse, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListAllOptions, 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, mapGeneratedParams, normalizeSqlParamsInput };
|
|
1966
|
+
export { ALL_VIZ_CHART_TYPES, type ActiveChartBulkGetResponse, 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 ChartBulkGetResponse, type ChartCreateInput, type ChartEncoding, type ChartEnvelope, type ChartListAllOptions, 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, mapGeneratedParams, normalizeSqlParamsInput, resolveQueryPipeline };
|
package/dist/index.js
CHANGED
|
@@ -1921,11 +1921,17 @@ function buildSchemaRequest(databaseName, adapter, introspection, metadata) {
|
|
|
1921
1921
|
dialect,
|
|
1922
1922
|
tables
|
|
1923
1923
|
};
|
|
1924
|
-
if (metadata?.
|
|
1924
|
+
if (metadata?.enforceTenantIsolation === false) {
|
|
1925
|
+
request.tenant_settings = {
|
|
1926
|
+
tenantFieldName: metadata.tenantFieldName ?? "",
|
|
1927
|
+
tenantFieldType: metadata.tenantFieldType ?? "String",
|
|
1928
|
+
enforceTenantIsolation: false
|
|
1929
|
+
};
|
|
1930
|
+
} else if (metadata?.tenantFieldName && metadata?.tenantFieldType) {
|
|
1925
1931
|
request.tenant_settings = {
|
|
1926
1932
|
tenantFieldName: metadata.tenantFieldName,
|
|
1927
1933
|
tenantFieldType: metadata.tenantFieldType,
|
|
1928
|
-
enforceTenantIsolation:
|
|
1934
|
+
enforceTenantIsolation: true
|
|
1929
1935
|
};
|
|
1930
1936
|
}
|
|
1931
1937
|
return request;
|
|
@@ -1936,6 +1942,9 @@ import crypto4 from "crypto";
|
|
|
1936
1942
|
|
|
1937
1943
|
// src/routes/query.ts
|
|
1938
1944
|
import crypto3 from "crypto";
|
|
1945
|
+
function resolveQueryPipeline(pipeline) {
|
|
1946
|
+
return pipeline ?? "v2";
|
|
1947
|
+
}
|
|
1939
1948
|
async function ask(client, queryEngine, question, options, signal) {
|
|
1940
1949
|
const tenantId = resolveTenantId5(client, options.tenantId);
|
|
1941
1950
|
const sessionId = crypto3.randomUUID();
|
|
@@ -1944,16 +1953,23 @@ async function ask(client, queryEngine, question, options, signal) {
|
|
|
1944
1953
|
let attempt = 0;
|
|
1945
1954
|
let lastError = options.lastError;
|
|
1946
1955
|
let previousSql = options.previousSql;
|
|
1947
|
-
const
|
|
1956
|
+
const pipeline = resolveQueryPipeline(options.pipeline);
|
|
1957
|
+
const queryEndpoint = pipeline === "v2" ? "/v2/query" : "/query";
|
|
1948
1958
|
while (attempt <= maxRetry) {
|
|
1949
1959
|
const databaseName = options.database ?? queryEngine.getDefaultDatabase();
|
|
1950
1960
|
const metadata = databaseName ? queryEngine.getDatabaseMetadata(databaseName) : void 0;
|
|
1951
1961
|
let tenantSettings;
|
|
1952
|
-
if (metadata?.
|
|
1962
|
+
if (metadata?.enforceTenantIsolation === false) {
|
|
1963
|
+
tenantSettings = {
|
|
1964
|
+
tenantFieldName: metadata.tenantFieldName ?? "",
|
|
1965
|
+
tenantFieldType: metadata.tenantFieldType ?? "String",
|
|
1966
|
+
enforceTenantIsolation: false
|
|
1967
|
+
};
|
|
1968
|
+
} else if (metadata?.tenantFieldName) {
|
|
1953
1969
|
tenantSettings = {
|
|
1954
1970
|
tenantFieldName: metadata.tenantFieldName,
|
|
1955
1971
|
tenantFieldType: metadata.tenantFieldType,
|
|
1956
|
-
enforceTenantIsolation:
|
|
1972
|
+
enforceTenantIsolation: true
|
|
1957
1973
|
};
|
|
1958
1974
|
}
|
|
1959
1975
|
const queryResponse = await client.postWithHeaders(
|
|
@@ -1968,7 +1984,7 @@ async function ask(client, queryEngine, question, options, signal) {
|
|
|
1968
1984
|
...databaseName ? { database: databaseName } : {},
|
|
1969
1985
|
...metadata?.dialect ? { dialect: metadata.dialect } : {},
|
|
1970
1986
|
...options.model?.trim() ? { model: options.model.trim() } : {},
|
|
1971
|
-
...
|
|
1987
|
+
...pipeline === "v2" && options.systemPrompt?.trim() ? { system_prompt: options.systemPrompt.trim() } : {},
|
|
1972
1988
|
debug: options.debug ?? false
|
|
1973
1989
|
},
|
|
1974
1990
|
tenantId,
|
|
@@ -2283,7 +2299,8 @@ async function modifyChart(client, queryEngine, input, options, signal) {
|
|
|
2283
2299
|
const hasSqlMods = !!input.sqlModifications;
|
|
2284
2300
|
const hasVizMods = !!input.vizModifications;
|
|
2285
2301
|
const hasCustomSql = !!input.sqlModifications?.customSql;
|
|
2286
|
-
const
|
|
2302
|
+
const pipeline = resolveQueryPipeline(options?.pipeline);
|
|
2303
|
+
const queryEndpoint = pipeline === "v2" ? "/v2/query" : "/query";
|
|
2287
2304
|
let finalSql = input.sql;
|
|
2288
2305
|
let finalParams = input.params ?? {};
|
|
2289
2306
|
let paramMetadata = [];
|
|
@@ -2299,11 +2316,17 @@ async function modifyChart(client, queryEngine, input, options, signal) {
|
|
|
2299
2316
|
}
|
|
2300
2317
|
const metadata = queryEngine.getDatabaseMetadata(databaseName);
|
|
2301
2318
|
let tenantSettings;
|
|
2302
|
-
if (metadata?.
|
|
2319
|
+
if (metadata?.enforceTenantIsolation === false) {
|
|
2320
|
+
tenantSettings = {
|
|
2321
|
+
tenantFieldName: metadata.tenantFieldName ?? "",
|
|
2322
|
+
tenantFieldType: metadata.tenantFieldType ?? "String",
|
|
2323
|
+
enforceTenantIsolation: false
|
|
2324
|
+
};
|
|
2325
|
+
} else if (metadata?.tenantFieldName) {
|
|
2303
2326
|
tenantSettings = {
|
|
2304
2327
|
tenantFieldName: metadata.tenantFieldName,
|
|
2305
2328
|
tenantFieldType: metadata.tenantFieldType,
|
|
2306
|
-
enforceTenantIsolation:
|
|
2329
|
+
enforceTenantIsolation: true
|
|
2307
2330
|
};
|
|
2308
2331
|
}
|
|
2309
2332
|
if (hasCustomSql) {
|
|
@@ -2315,10 +2338,10 @@ async function modifyChart(client, queryEngine, input, options, signal) {
|
|
|
2315
2338
|
const modifiedQuestion = buildModifiedQuestion(
|
|
2316
2339
|
input.question,
|
|
2317
2340
|
input.sqlModifications,
|
|
2318
|
-
|
|
2341
|
+
pipeline,
|
|
2319
2342
|
hasQuerypanelSessionContext
|
|
2320
2343
|
);
|
|
2321
|
-
if (
|
|
2344
|
+
if (pipeline === "v2") {
|
|
2322
2345
|
finalQuestion = modifiedQuestion;
|
|
2323
2346
|
}
|
|
2324
2347
|
const queryResponse = await client.post(
|
|
@@ -2342,7 +2365,7 @@ async function modifyChart(client, queryEngine, input, options, signal) {
|
|
|
2342
2365
|
finalSql = queryResponse.sql;
|
|
2343
2366
|
paramMetadata = Array.isArray(queryResponse.params) ? queryResponse.params : [];
|
|
2344
2367
|
finalParams = queryEngine.mapGeneratedParams(paramMetadata);
|
|
2345
|
-
if (
|
|
2368
|
+
if (pipeline === "v2") {
|
|
2346
2369
|
applyDateRangeOverrides(
|
|
2347
2370
|
input.sqlModifications?.dateRange,
|
|
2348
2371
|
finalParams,
|
|
@@ -2559,6 +2582,12 @@ var ALL_VIZ_CHART_TYPES = [
|
|
|
2559
2582
|
];
|
|
2560
2583
|
|
|
2561
2584
|
// src/index.ts
|
|
2585
|
+
function resolveAttachEnforceTenantIsolation(tenantFieldName, enforceTenantIsolation) {
|
|
2586
|
+
if (enforceTenantIsolation !== void 0) {
|
|
2587
|
+
return enforceTenantIsolation;
|
|
2588
|
+
}
|
|
2589
|
+
return tenantFieldName ? true : void 0;
|
|
2590
|
+
}
|
|
2562
2591
|
var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
2563
2592
|
/**
|
|
2564
2593
|
* @param workspaceId - Workspace UUID (same value as your org in the dashboard). Passed to the API as JWT claim `organizationId`.
|
|
@@ -2629,7 +2658,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2629
2658
|
tags: options?.tags,
|
|
2630
2659
|
tenantFieldName: options?.tenantFieldName,
|
|
2631
2660
|
tenantFieldType: options?.tenantFieldType ?? "String",
|
|
2632
|
-
enforceTenantIsolation:
|
|
2661
|
+
enforceTenantIsolation: resolveAttachEnforceTenantIsolation(
|
|
2662
|
+
options?.tenantFieldName,
|
|
2663
|
+
options?.enforceTenantIsolation
|
|
2664
|
+
)
|
|
2633
2665
|
};
|
|
2634
2666
|
this.queryEngine.attachDatabase(name, adapter, metadata);
|
|
2635
2667
|
}
|
|
@@ -2642,7 +2674,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2642
2674
|
tags: options?.tags,
|
|
2643
2675
|
tenantFieldName: options?.tenantFieldName,
|
|
2644
2676
|
tenantFieldType: options?.tenantFieldType ?? "String",
|
|
2645
|
-
enforceTenantIsolation:
|
|
2677
|
+
enforceTenantIsolation: resolveAttachEnforceTenantIsolation(
|
|
2678
|
+
options?.tenantFieldName,
|
|
2679
|
+
options?.enforceTenantIsolation
|
|
2680
|
+
)
|
|
2646
2681
|
};
|
|
2647
2682
|
this.queryEngine.attachDatabase(name, adapter, metadata);
|
|
2648
2683
|
}
|
|
@@ -2655,7 +2690,10 @@ var QueryPanelSdkAPI = class _QueryPanelSdkAPI {
|
|
|
2655
2690
|
tags: options?.tags,
|
|
2656
2691
|
tenantFieldName: options?.tenantFieldName,
|
|
2657
2692
|
tenantFieldType: options?.tenantFieldType ?? "String",
|
|
2658
|
-
enforceTenantIsolation:
|
|
2693
|
+
enforceTenantIsolation: resolveAttachEnforceTenantIsolation(
|
|
2694
|
+
options?.tenantFieldName,
|
|
2695
|
+
options?.enforceTenantIsolation
|
|
2696
|
+
)
|
|
2659
2697
|
};
|
|
2660
2698
|
this.queryEngine.attachDatabase(name, adapter, metadata);
|
|
2661
2699
|
}
|
|
@@ -3584,6 +3622,7 @@ export {
|
|
|
3584
3622
|
QueryPipelineError,
|
|
3585
3623
|
anonymizeResults,
|
|
3586
3624
|
mapGeneratedParams,
|
|
3587
|
-
normalizeSqlParamsInput
|
|
3625
|
+
normalizeSqlParamsInput,
|
|
3626
|
+
resolveQueryPipeline
|
|
3588
3627
|
};
|
|
3589
3628
|
//# sourceMappingURL=index.js.map
|