@quillsql/admin 1.7.3 → 1.7.5
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/index.cjs +215 -150
- package/dist/index.js +215 -150
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -606,7 +606,7 @@ var MemoizedButton = ({
|
|
|
606
606
|
color: ${primary ? state.theme?.primaryButtonTextColor ?? "white" : state.theme?.secondaryTextColor}
|
|
607
607
|
}
|
|
608
608
|
.quill-button:hover {
|
|
609
|
-
background-color: ${primary ? state.theme?.hoverPrimaryButtonColor : "rgba(56, 65, 81, 0.9)"};
|
|
609
|
+
background-color: ${primary ? state.theme?.hoverPrimaryButtonColor ?? "rgba(56, 65, 81, 0.9)" : "rgba(56, 65, 81, 0.9)"};
|
|
610
610
|
color: ${primary ? state.theme?.hoverPrimaryButtonTextColor ?? "white" : state.theme?.secondaryTextColor}
|
|
611
611
|
}` }),
|
|
612
612
|
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingSpinner, {}) }) : null,
|
|
@@ -1935,7 +1935,7 @@ var quillFetch = async ({
|
|
|
1935
1935
|
};
|
|
1936
1936
|
|
|
1937
1937
|
// src/api/ConnectionClient.ts
|
|
1938
|
-
async function testConnectionString(queryEndpoint, connectionString, databaseType, getToken, clientId, queryHeaders) {
|
|
1938
|
+
async function testConnectionString(queryEndpoint, connectionString, databaseType, getToken, clientId, queryHeaders, withCredentials) {
|
|
1939
1939
|
const controller = new AbortController();
|
|
1940
1940
|
const timeoutId = setTimeout(() => controller.abort(), 1e4);
|
|
1941
1941
|
try {
|
|
@@ -1960,7 +1960,7 @@ async function testConnectionString(queryEndpoint, connectionString, databaseTyp
|
|
|
1960
1960
|
queryEndpoint,
|
|
1961
1961
|
queryHeaders,
|
|
1962
1962
|
clientId,
|
|
1963
|
-
withCredentials:
|
|
1963
|
+
withCredentials: !!withCredentials
|
|
1964
1964
|
},
|
|
1965
1965
|
task: "test-connection",
|
|
1966
1966
|
metadata: {
|
|
@@ -1981,13 +1981,13 @@ async function testConnectionString(queryEndpoint, connectionString, databaseTyp
|
|
|
1981
1981
|
throw error;
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
|
-
async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, queryHeaders) {
|
|
1984
|
+
async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, queryHeaders, withCredentials) {
|
|
1985
1985
|
await quillFetch({
|
|
1986
1986
|
client: {
|
|
1987
1987
|
queryEndpoint,
|
|
1988
1988
|
queryHeaders,
|
|
1989
1989
|
clientId,
|
|
1990
|
-
withCredentials:
|
|
1990
|
+
withCredentials: !!withCredentials
|
|
1991
1991
|
},
|
|
1992
1992
|
task: "set-schemas",
|
|
1993
1993
|
metadata: {
|
|
@@ -1997,14 +1997,14 @@ async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, qu
|
|
|
1997
1997
|
getToken
|
|
1998
1998
|
});
|
|
1999
1999
|
}
|
|
2000
|
-
async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, getToken, queryHeaders) {
|
|
2000
|
+
async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, getToken, queryHeaders, withCredentials) {
|
|
2001
2001
|
const schemaMap = {};
|
|
2002
2002
|
const { queries } = await quillFetch({
|
|
2003
2003
|
client: {
|
|
2004
2004
|
queryEndpoint,
|
|
2005
2005
|
queryHeaders,
|
|
2006
2006
|
clientId,
|
|
2007
|
-
withCredentials:
|
|
2007
|
+
withCredentials: !!withCredentials
|
|
2008
2008
|
},
|
|
2009
2009
|
task: "get-tables-by-schemas",
|
|
2010
2010
|
metadata: {
|
|
@@ -2036,13 +2036,13 @@ async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, g
|
|
|
2036
2036
|
}
|
|
2037
2037
|
return { tables: allTables.flat(), schema: schemaMap };
|
|
2038
2038
|
}
|
|
2039
|
-
async function getTableColumns(tables, databaseType, queryEndpoint, clientId, getToken, queryHeaders) {
|
|
2039
|
+
async function getTableColumns(tables, databaseType, queryEndpoint, clientId, getToken, queryHeaders, withCredentials) {
|
|
2040
2040
|
const { queries } = await quillFetch({
|
|
2041
2041
|
client: {
|
|
2042
2042
|
queryEndpoint,
|
|
2043
2043
|
queryHeaders,
|
|
2044
2044
|
clientId,
|
|
2045
|
-
withCredentials:
|
|
2045
|
+
withCredentials: !!withCredentials
|
|
2046
2046
|
},
|
|
2047
2047
|
task: "get-schema-table-columns",
|
|
2048
2048
|
metadata: {
|
|
@@ -2077,7 +2077,7 @@ async function getTableColumns(tables, databaseType, queryEndpoint, clientId, ge
|
|
|
2077
2077
|
}
|
|
2078
2078
|
return columnsByTable;
|
|
2079
2079
|
}
|
|
2080
|
-
async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, databaseType, getToken, schemas, queryHeaders) {
|
|
2080
|
+
async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, databaseType, getToken, schemas, queryHeaders, withCredentials) {
|
|
2081
2081
|
if (isSelfHosted) {
|
|
2082
2082
|
const { tables, schema } = await getSchemaTables(
|
|
2083
2083
|
schemas,
|
|
@@ -2085,7 +2085,8 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2085
2085
|
queryEndpoint,
|
|
2086
2086
|
clientId,
|
|
2087
2087
|
getToken,
|
|
2088
|
-
queryHeaders
|
|
2088
|
+
queryHeaders,
|
|
2089
|
+
withCredentials
|
|
2089
2090
|
);
|
|
2090
2091
|
const columnsByTable = await getTableColumns(
|
|
2091
2092
|
tables,
|
|
@@ -2093,7 +2094,8 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2093
2094
|
queryEndpoint,
|
|
2094
2095
|
clientId,
|
|
2095
2096
|
getToken,
|
|
2096
|
-
queryHeaders
|
|
2097
|
+
queryHeaders,
|
|
2098
|
+
withCredentials
|
|
2097
2099
|
);
|
|
2098
2100
|
return { columnsByTable, schema };
|
|
2099
2101
|
} else {
|
|
@@ -2102,7 +2104,7 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2102
2104
|
queryEndpoint,
|
|
2103
2105
|
queryHeaders,
|
|
2104
2106
|
clientId,
|
|
2105
|
-
withCredentials:
|
|
2107
|
+
withCredentials: !!withCredentials
|
|
2106
2108
|
},
|
|
2107
2109
|
task: "table-info-by-schema",
|
|
2108
2110
|
metadata: {
|
|
@@ -2132,7 +2134,7 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2132
2134
|
return { columnsByTable: formattedResults, schema: results.data.schema };
|
|
2133
2135
|
}
|
|
2134
2136
|
}
|
|
2135
|
-
async function getVirtualTableData(clientId, query, databaseType, queryEndpoint, getToken, eventTracking, queryHeaders) {
|
|
2137
|
+
async function getVirtualTableData(clientId, query, databaseType, queryEndpoint, getToken, eventTracking, queryHeaders, withCredentials) {
|
|
2136
2138
|
let queryAst = void 0;
|
|
2137
2139
|
try {
|
|
2138
2140
|
const { data } = await quillFetch({
|
|
@@ -2140,7 +2142,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2140
2142
|
queryEndpoint,
|
|
2141
2143
|
queryHeaders,
|
|
2142
2144
|
clientId,
|
|
2143
|
-
withCredentials:
|
|
2145
|
+
withCredentials: !!withCredentials
|
|
2144
2146
|
},
|
|
2145
2147
|
task: "astify",
|
|
2146
2148
|
metadata: {
|
|
@@ -2148,6 +2150,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2148
2150
|
query,
|
|
2149
2151
|
useNewNodeSql: true
|
|
2150
2152
|
},
|
|
2153
|
+
credentials: withCredentials ? "include" : "omit",
|
|
2151
2154
|
getToken
|
|
2152
2155
|
});
|
|
2153
2156
|
queryAst = data;
|
|
@@ -2179,7 +2182,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2179
2182
|
queryEndpoint,
|
|
2180
2183
|
queryHeaders,
|
|
2181
2184
|
clientId,
|
|
2182
|
-
withCredentials:
|
|
2185
|
+
withCredentials: !!withCredentials
|
|
2183
2186
|
},
|
|
2184
2187
|
task: "query-view",
|
|
2185
2188
|
metadata: {
|
|
@@ -2251,7 +2254,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2251
2254
|
success: results.status === "success" ? true : false
|
|
2252
2255
|
} : { ...results, ...queryAst };
|
|
2253
2256
|
}
|
|
2254
|
-
async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryEndpoint, aiPrompt, clientId, getToken, schemaNames, queryHeaders) {
|
|
2257
|
+
async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryEndpoint, aiPrompt, clientId, getToken, schemaNames, queryHeaders, withCredentials) {
|
|
2255
2258
|
if (aiPrompt.trim().length > 500) {
|
|
2256
2259
|
return "";
|
|
2257
2260
|
}
|
|
@@ -2260,7 +2263,7 @@ async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryE
|
|
|
2260
2263
|
queryEndpoint,
|
|
2261
2264
|
queryHeaders,
|
|
2262
2265
|
clientId,
|
|
2263
|
-
withCredentials:
|
|
2266
|
+
withCredentials: !!withCredentials
|
|
2264
2267
|
},
|
|
2265
2268
|
task: "ai-from-client-schema",
|
|
2266
2269
|
metadata: {
|
|
@@ -3709,7 +3712,8 @@ function ConnectDatabase({
|
|
|
3709
3712
|
clientId,
|
|
3710
3713
|
selectedSchemas,
|
|
3711
3714
|
getToken,
|
|
3712
|
-
state.queryHeaders
|
|
3715
|
+
state.queryHeaders,
|
|
3716
|
+
state.withCredentials
|
|
3713
3717
|
);
|
|
3714
3718
|
const databaseSchema = await getTableColumnsBySchema(
|
|
3715
3719
|
state.isSelfHosted,
|
|
@@ -3718,7 +3722,8 @@ function ConnectDatabase({
|
|
|
3718
3722
|
databaseConnectionDetails.type,
|
|
3719
3723
|
getToken,
|
|
3720
3724
|
selectedSchemas,
|
|
3721
|
-
state.queryHeaders
|
|
3725
|
+
state.queryHeaders,
|
|
3726
|
+
state.withCredentials
|
|
3722
3727
|
).then((res) => res.columnsByTable);
|
|
3723
3728
|
setEnvironmentDetails(
|
|
3724
3729
|
databaseConnectionDetails,
|
|
@@ -3785,7 +3790,8 @@ function ConnectDatabase({
|
|
|
3785
3790
|
databaseConnectionDetails.type,
|
|
3786
3791
|
getToken,
|
|
3787
3792
|
clientId,
|
|
3788
|
-
state.queryHeaders
|
|
3793
|
+
state.queryHeaders,
|
|
3794
|
+
state.withCredentials
|
|
3789
3795
|
);
|
|
3790
3796
|
if (result.success) {
|
|
3791
3797
|
try {
|
|
@@ -4400,7 +4406,8 @@ var useDatabaseSchema = () => {
|
|
|
4400
4406
|
state.client.databaseType,
|
|
4401
4407
|
getToken,
|
|
4402
4408
|
state.client.schemaNames ?? [],
|
|
4403
|
-
state.queryHeaders
|
|
4409
|
+
state.queryHeaders,
|
|
4410
|
+
state.withCredentials
|
|
4404
4411
|
);
|
|
4405
4412
|
dispatch({
|
|
4406
4413
|
type: "SET_DATABASE_SCHEMA",
|
|
@@ -5746,7 +5753,8 @@ function EditTenant({
|
|
|
5746
5753
|
queryEndpoint,
|
|
5747
5754
|
getToken,
|
|
5748
5755
|
eventTracking,
|
|
5749
|
-
client.queryHeaders
|
|
5756
|
+
client.queryHeaders,
|
|
5757
|
+
state.withCredentials
|
|
5750
5758
|
);
|
|
5751
5759
|
if (resp.status === "error") {
|
|
5752
5760
|
throw new Error(resp.error);
|
|
@@ -5774,7 +5782,8 @@ function EditTenant({
|
|
|
5774
5782
|
queryEndpoint,
|
|
5775
5783
|
getToken,
|
|
5776
5784
|
eventTracking,
|
|
5777
|
-
client.queryHeaders
|
|
5785
|
+
client.queryHeaders,
|
|
5786
|
+
state.withCredentials
|
|
5778
5787
|
);
|
|
5779
5788
|
if (resp.status === "error") {
|
|
5780
5789
|
throw new Error(resp.error);
|
|
@@ -5818,7 +5827,7 @@ function EditTenant({
|
|
|
5818
5827
|
client: {
|
|
5819
5828
|
queryEndpoint,
|
|
5820
5829
|
clientId: client._id,
|
|
5821
|
-
withCredentials:
|
|
5830
|
+
withCredentials: !!state.withCredentials,
|
|
5822
5831
|
queryHeaders: client.queryHeaders
|
|
5823
5832
|
},
|
|
5824
5833
|
task: "validate-tenant-mapping",
|
|
@@ -5969,7 +5978,6 @@ function EditTenant({
|
|
|
5969
5978
|
)
|
|
5970
5979
|
] });
|
|
5971
5980
|
}
|
|
5972
|
-
console.log("STATE: ", state);
|
|
5973
5981
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
5974
5982
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
5975
5983
|
"div",
|
|
@@ -7694,7 +7702,8 @@ function CreateEnvironment({
|
|
|
7694
7702
|
connection.type,
|
|
7695
7703
|
getToken,
|
|
7696
7704
|
selectedSchemaNames,
|
|
7697
|
-
state.queryHeaders
|
|
7705
|
+
state.queryHeaders,
|
|
7706
|
+
state.withCredentials
|
|
7698
7707
|
).then((schema2) => {
|
|
7699
7708
|
dispatch({
|
|
7700
7709
|
type: "SET_DATABASE_SCHEMA",
|
|
@@ -8285,7 +8294,8 @@ function AdminProvider({
|
|
|
8285
8294
|
labelFontWeight: theme?.labelFontWeight ?? defaultTheme.labelFontWeight,
|
|
8286
8295
|
fontSize: theme?.fontSize ?? defaultTheme.fontSize,
|
|
8287
8296
|
primaryButtonTextColor: theme?.primaryButtonTextColor ?? defaultTheme.primaryButtonTextColor,
|
|
8288
|
-
hoverBackgroundColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverBackgroundColor
|
|
8297
|
+
hoverBackgroundColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverBackgroundColor,
|
|
8298
|
+
hoverPrimaryButtonColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverPrimaryButtonColor
|
|
8289
8299
|
};
|
|
8290
8300
|
return {
|
|
8291
8301
|
loading: true,
|
|
@@ -12610,11 +12620,27 @@ var convertCustomIntervalToDateRange = (interval) => {
|
|
|
12610
12620
|
endDate: endOfToday()
|
|
12611
12621
|
};
|
|
12612
12622
|
case "repeating": {
|
|
12613
|
-
const
|
|
12614
|
-
const
|
|
12615
|
-
const currentSubInterval = interval.subIntervals.find(
|
|
12616
|
-
|
|
12617
|
-
|
|
12623
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
12624
|
+
const currentYear = currentDate.getFullYear();
|
|
12625
|
+
const currentSubInterval = interval.subIntervals.find((subInterval) => {
|
|
12626
|
+
const intervalStart = set(/* @__PURE__ */ new Date(), {
|
|
12627
|
+
year: currentYear,
|
|
12628
|
+
month: subInterval.startDate.month - 1,
|
|
12629
|
+
date: subInterval.startDate.day,
|
|
12630
|
+
hours: 0,
|
|
12631
|
+
minutes: 0,
|
|
12632
|
+
seconds: 0
|
|
12633
|
+
});
|
|
12634
|
+
const intervalEnd = set(/* @__PURE__ */ new Date(), {
|
|
12635
|
+
year: currentYear,
|
|
12636
|
+
month: subInterval.endDate.month - 1,
|
|
12637
|
+
date: subInterval.endDate.day,
|
|
12638
|
+
hours: 23,
|
|
12639
|
+
minutes: 59,
|
|
12640
|
+
seconds: 59
|
|
12641
|
+
});
|
|
12642
|
+
return currentDate >= intervalStart && currentDate <= intervalEnd;
|
|
12643
|
+
});
|
|
12618
12644
|
if (!currentSubInterval) {
|
|
12619
12645
|
throw new Error("Date is not valid in this interval");
|
|
12620
12646
|
}
|
|
@@ -12772,10 +12798,29 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12772
12798
|
let currentDate = endOfDay(option.loopEnd ?? /* @__PURE__ */ new Date());
|
|
12773
12799
|
const cutoffDate = option.loopStart;
|
|
12774
12800
|
while (currentDate > cutoffDate) {
|
|
12775
|
-
const
|
|
12776
|
-
const currentDay = currentDate.getDate();
|
|
12801
|
+
const loopCurrentYear = currentDate.getFullYear();
|
|
12777
12802
|
const currentSubInterval = option.subIntervals.find(
|
|
12778
|
-
(subInterval) =>
|
|
12803
|
+
(subInterval) => {
|
|
12804
|
+
const intervalStart2 = set(/* @__PURE__ */ new Date(), {
|
|
12805
|
+
year: loopCurrentYear,
|
|
12806
|
+
month: subInterval.startDate.month - 1,
|
|
12807
|
+
// convert 1-index to 0-index
|
|
12808
|
+
date: subInterval.startDate.day,
|
|
12809
|
+
hours: 0,
|
|
12810
|
+
minutes: 0,
|
|
12811
|
+
seconds: 0
|
|
12812
|
+
});
|
|
12813
|
+
const intervalEnd = set(/* @__PURE__ */ new Date(), {
|
|
12814
|
+
year: loopCurrentYear,
|
|
12815
|
+
month: subInterval.endDate.month - 1,
|
|
12816
|
+
// convert 1-index to 0-index
|
|
12817
|
+
date: subInterval.endDate.day,
|
|
12818
|
+
hours: 23,
|
|
12819
|
+
minutes: 59,
|
|
12820
|
+
seconds: 59
|
|
12821
|
+
});
|
|
12822
|
+
return currentDate >= intervalStart2 && currentDate <= intervalEnd;
|
|
12823
|
+
}
|
|
12779
12824
|
);
|
|
12780
12825
|
if (!currentSubInterval) {
|
|
12781
12826
|
return [];
|
|
@@ -12794,6 +12839,7 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12794
12839
|
startDate: set(/* @__PURE__ */ new Date(), {
|
|
12795
12840
|
year: currentYear,
|
|
12796
12841
|
month: currentSubInterval.startDate.month - 1,
|
|
12842
|
+
// convert 1-index to 0-index
|
|
12797
12843
|
date: currentSubInterval.startDate.day,
|
|
12798
12844
|
minutes: 0,
|
|
12799
12845
|
hours: 0,
|
|
@@ -12802,6 +12848,7 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12802
12848
|
endDate: set(/* @__PURE__ */ new Date(), {
|
|
12803
12849
|
year: currentYear,
|
|
12804
12850
|
month: currentSubInterval.endDate.month - 1,
|
|
12851
|
+
// convert 1-index to 0-index
|
|
12805
12852
|
date: currentSubInterval.endDate.day,
|
|
12806
12853
|
minutes: 59,
|
|
12807
12854
|
hours: 23,
|
|
@@ -18470,7 +18517,7 @@ function EditFiltersModal({
|
|
|
18470
18517
|
onClick: () => {
|
|
18471
18518
|
openPromoteModal();
|
|
18472
18519
|
},
|
|
18473
|
-
label: "
|
|
18520
|
+
label: "Promote Dashboard",
|
|
18474
18521
|
style: {
|
|
18475
18522
|
width: "fit-content"
|
|
18476
18523
|
}
|
|
@@ -20146,7 +20193,8 @@ function EditEnvironmentModal({
|
|
|
20146
20193
|
state.client.databaseType,
|
|
20147
20194
|
getToken,
|
|
20148
20195
|
state.client.schemaNames ?? [],
|
|
20149
|
-
state.queryHeaders
|
|
20196
|
+
state.queryHeaders,
|
|
20197
|
+
state.withCredentials
|
|
20150
20198
|
);
|
|
20151
20199
|
const tenantTables = state.client.allTenantTypes?.filter(
|
|
20152
20200
|
(t2) => t2.tenantTable !== void 0
|
|
@@ -21647,85 +21695,87 @@ function EmptyDashboardComponent() {
|
|
|
21647
21695
|
boxShadow: "0px 1px 12px rgba(0, 0, 0, 0.07)"
|
|
21648
21696
|
},
|
|
21649
21697
|
children: [
|
|
21650
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
|
|
21654
|
-
|
|
21655
|
-
|
|
21656
|
-
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
21667
|
-
|
|
21668
|
-
|
|
21669
|
-
|
|
21670
|
-
|
|
21671
|
-
|
|
21672
|
-
|
|
21673
|
-
|
|
21674
|
-
|
|
21675
|
-
|
|
21676
|
-
|
|
21677
|
-
|
|
21678
|
-
|
|
21679
|
-
|
|
21680
|
-
|
|
21681
|
-
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
|
|
21685
|
-
|
|
21686
|
-
|
|
21687
|
-
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21698
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
21699
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
21700
|
+
"div",
|
|
21701
|
+
{
|
|
21702
|
+
style: {
|
|
21703
|
+
display: "flex",
|
|
21704
|
+
flexDirection: "row",
|
|
21705
|
+
alignItems: "center",
|
|
21706
|
+
justifyContent: "center",
|
|
21707
|
+
width: 260
|
|
21708
|
+
},
|
|
21709
|
+
children: [
|
|
21710
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
21711
|
+
"svg",
|
|
21712
|
+
{
|
|
21713
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21714
|
+
viewBox: "0 0 24 24",
|
|
21715
|
+
fill: "#565656",
|
|
21716
|
+
height: 26,
|
|
21717
|
+
width: 26,
|
|
21718
|
+
children: [
|
|
21719
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21720
|
+
"path",
|
|
21721
|
+
{
|
|
21722
|
+
fillRule: "evenodd",
|
|
21723
|
+
d: "M2.25 13.5a8.25 8.25 0 0 1 8.25-8.25.75.75 0 0 1 .75.75v6.75H18a.75.75 0 0 1 .75.75 8.25 8.25 0 0 1-16.5 0Z",
|
|
21724
|
+
clipRule: "evenodd"
|
|
21725
|
+
}
|
|
21726
|
+
),
|
|
21727
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21728
|
+
"path",
|
|
21729
|
+
{
|
|
21730
|
+
fillRule: "evenodd",
|
|
21731
|
+
d: "M12.75 3a.75.75 0 0 1 .75-.75 8.25 8.25 0 0 1 8.25 8.25.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75V3Z",
|
|
21732
|
+
clipRule: "evenodd"
|
|
21733
|
+
}
|
|
21734
|
+
)
|
|
21735
|
+
]
|
|
21736
|
+
}
|
|
21737
|
+
),
|
|
21738
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21739
|
+
"div",
|
|
21740
|
+
{
|
|
21741
|
+
style: {
|
|
21742
|
+
fontSize: state.theme.fontSize,
|
|
21743
|
+
fontFamily: state.theme.fontFamily,
|
|
21744
|
+
fontWeight: 500,
|
|
21745
|
+
color: "#565656",
|
|
21746
|
+
// border: '1px solid #e7e7e7',
|
|
21747
|
+
paddingTop: 8,
|
|
21748
|
+
paddingBottom: 8,
|
|
21749
|
+
paddingRight: 12,
|
|
21750
|
+
paddingLeft: 12,
|
|
21751
|
+
borderRadius: 4,
|
|
21752
|
+
cursor: "pointer"
|
|
21753
|
+
},
|
|
21754
|
+
className: "quill-hover-button",
|
|
21755
|
+
children: "No reports created yet."
|
|
21756
|
+
}
|
|
21757
|
+
)
|
|
21758
|
+
]
|
|
21759
|
+
}
|
|
21760
|
+
),
|
|
21761
|
+
state.AskAIButton ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21762
|
+
"div",
|
|
21763
|
+
{
|
|
21764
|
+
style: {
|
|
21765
|
+
display: "flex",
|
|
21766
|
+
justifyContent: "flex-start",
|
|
21767
|
+
width: 144
|
|
21768
|
+
},
|
|
21769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21770
|
+
state.AskAIButton,
|
|
21711
21771
|
{
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
justifyContent: "flex-start",
|
|
21715
|
-
width: 144
|
|
21716
|
-
},
|
|
21717
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21718
|
-
state.AskAIButton,
|
|
21719
|
-
{
|
|
21720
|
-
label: "What is a report?",
|
|
21721
|
-
prompt: "what is a report?"
|
|
21722
|
-
}
|
|
21723
|
-
)
|
|
21772
|
+
label: "What is a report?",
|
|
21773
|
+
prompt: "what is a report?"
|
|
21724
21774
|
}
|
|
21725
|
-
)
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
),
|
|
21775
|
+
)
|
|
21776
|
+
}
|
|
21777
|
+
) : null
|
|
21778
|
+
] }),
|
|
21729
21779
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { paddingBottom: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
21730
21780
|
MemoizedButton,
|
|
21731
21781
|
{
|
|
@@ -26122,43 +26172,55 @@ Affected item${plural ? "s" : ""} ${value.affected.join(", ")}`
|
|
|
26122
26172
|
]
|
|
26123
26173
|
}
|
|
26124
26174
|
),
|
|
26125
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.
|
|
26126
|
-
"div",
|
|
26127
|
-
{
|
|
26128
|
-
style: {
|
|
26129
|
-
fontSize: state.theme?.fontSize,
|
|
26130
|
-
fontWeight: 500,
|
|
26131
|
-
fontFamily: state.theme?.fontFamily,
|
|
26132
|
-
fontSizeAdjust: 0.5,
|
|
26133
|
-
color: "#565656",
|
|
26134
|
-
paddingTop: 8,
|
|
26135
|
-
paddingBottom: 8,
|
|
26136
|
-
paddingRight: 12,
|
|
26137
|
-
paddingLeft: 12,
|
|
26138
|
-
borderRadius: 4,
|
|
26139
|
-
cursor: "pointer"
|
|
26140
|
-
},
|
|
26141
|
-
className: "quill-hover-button",
|
|
26142
|
-
children: "No dashboards created yet."
|
|
26143
|
-
}
|
|
26144
|
-
),
|
|
26145
|
-
state.AskAIButton ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
26175
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
26146
26176
|
"div",
|
|
26147
26177
|
{
|
|
26148
26178
|
style: {
|
|
26149
26179
|
display: "flex",
|
|
26150
|
-
|
|
26151
|
-
|
|
26180
|
+
flexDirection: "column",
|
|
26181
|
+
gap: 8
|
|
26152
26182
|
},
|
|
26153
|
-
children:
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26183
|
+
children: [
|
|
26184
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
26185
|
+
"div",
|
|
26186
|
+
{
|
|
26187
|
+
style: {
|
|
26188
|
+
fontSize: state.theme?.fontSize,
|
|
26189
|
+
fontWeight: 500,
|
|
26190
|
+
fontFamily: state.theme?.fontFamily,
|
|
26191
|
+
fontSizeAdjust: 0.5,
|
|
26192
|
+
color: "#565656",
|
|
26193
|
+
paddingTop: 8,
|
|
26194
|
+
paddingBottom: 8,
|
|
26195
|
+
paddingRight: 12,
|
|
26196
|
+
paddingLeft: 12,
|
|
26197
|
+
borderRadius: 4,
|
|
26198
|
+
cursor: "pointer"
|
|
26199
|
+
},
|
|
26200
|
+
className: "quill-hover-button",
|
|
26201
|
+
children: "No dashboards created yet."
|
|
26202
|
+
}
|
|
26203
|
+
),
|
|
26204
|
+
state.AskAIButton ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
26205
|
+
"div",
|
|
26206
|
+
{
|
|
26207
|
+
style: {
|
|
26208
|
+
display: "flex",
|
|
26209
|
+
justifyContent: "flex-start",
|
|
26210
|
+
width: 144
|
|
26211
|
+
},
|
|
26212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
26213
|
+
state.AskAIButton,
|
|
26214
|
+
{
|
|
26215
|
+
label: "What is a dashboard?",
|
|
26216
|
+
prompt: "what is a dashboard?"
|
|
26217
|
+
}
|
|
26218
|
+
)
|
|
26219
|
+
}
|
|
26220
|
+
) : null
|
|
26221
|
+
]
|
|
26160
26222
|
}
|
|
26161
|
-
)
|
|
26223
|
+
)
|
|
26162
26224
|
]
|
|
26163
26225
|
}
|
|
26164
26226
|
),
|
|
@@ -26699,7 +26761,8 @@ function CreateEditVirtualTable({
|
|
|
26699
26761
|
state.client._id,
|
|
26700
26762
|
getToken,
|
|
26701
26763
|
state.client.schemaNames,
|
|
26702
|
-
state.queryHeaders
|
|
26764
|
+
state.queryHeaders,
|
|
26765
|
+
state.withCredentials
|
|
26703
26766
|
);
|
|
26704
26767
|
setEditVirtualTableQuery(results);
|
|
26705
26768
|
setAskAIButtonLoading(false);
|
|
@@ -26748,7 +26811,8 @@ function CreateEditVirtualTable({
|
|
|
26748
26811
|
state.queryEndpoint,
|
|
26749
26812
|
getToken,
|
|
26750
26813
|
eventTracking,
|
|
26751
|
-
state.queryHeaders
|
|
26814
|
+
state.queryHeaders,
|
|
26815
|
+
state.withCredentials
|
|
26752
26816
|
);
|
|
26753
26817
|
if (!resp.success) {
|
|
26754
26818
|
setErrorInfo({ show: true, message: resp.error });
|
|
@@ -26791,7 +26855,7 @@ function CreateEditVirtualTable({
|
|
|
26791
26855
|
queryEndpoint: state.queryEndpoint,
|
|
26792
26856
|
queryHeaders: state.queryHeaders,
|
|
26793
26857
|
clientId: state.client._id,
|
|
26794
|
-
withCredentials:
|
|
26858
|
+
withCredentials: !!state.withCredentials
|
|
26795
26859
|
},
|
|
26796
26860
|
task: "sqlify",
|
|
26797
26861
|
metadata: {
|
|
@@ -29035,7 +29099,8 @@ function EditAddViewModal({
|
|
|
29035
29099
|
state.queryEndpoint,
|
|
29036
29100
|
getToken,
|
|
29037
29101
|
eventTracking,
|
|
29038
|
-
state.queryHeaders
|
|
29102
|
+
state.queryHeaders,
|
|
29103
|
+
state.withCredentials
|
|
29039
29104
|
);
|
|
29040
29105
|
if (!getSqlResults.success) {
|
|
29041
29106
|
setErrorInfo({
|
package/dist/index.js
CHANGED
|
@@ -580,7 +580,7 @@ var MemoizedButton = ({
|
|
|
580
580
|
color: ${primary ? state.theme?.primaryButtonTextColor ?? "white" : state.theme?.secondaryTextColor}
|
|
581
581
|
}
|
|
582
582
|
.quill-button:hover {
|
|
583
|
-
background-color: ${primary ? state.theme?.hoverPrimaryButtonColor : "rgba(56, 65, 81, 0.9)"};
|
|
583
|
+
background-color: ${primary ? state.theme?.hoverPrimaryButtonColor ?? "rgba(56, 65, 81, 0.9)" : "rgba(56, 65, 81, 0.9)"};
|
|
584
584
|
color: ${primary ? state.theme?.hoverPrimaryButtonTextColor ?? "white" : state.theme?.secondaryTextColor}
|
|
585
585
|
}` }),
|
|
586
586
|
isLoading ? /* @__PURE__ */ jsx5("div", { style: { position: "absolute" }, children: /* @__PURE__ */ jsx5(LoadingSpinner, {}) }) : null,
|
|
@@ -1909,7 +1909,7 @@ var quillFetch = async ({
|
|
|
1909
1909
|
};
|
|
1910
1910
|
|
|
1911
1911
|
// src/api/ConnectionClient.ts
|
|
1912
|
-
async function testConnectionString(queryEndpoint, connectionString, databaseType, getToken, clientId, queryHeaders) {
|
|
1912
|
+
async function testConnectionString(queryEndpoint, connectionString, databaseType, getToken, clientId, queryHeaders, withCredentials) {
|
|
1913
1913
|
const controller = new AbortController();
|
|
1914
1914
|
const timeoutId = setTimeout(() => controller.abort(), 1e4);
|
|
1915
1915
|
try {
|
|
@@ -1934,7 +1934,7 @@ async function testConnectionString(queryEndpoint, connectionString, databaseTyp
|
|
|
1934
1934
|
queryEndpoint,
|
|
1935
1935
|
queryHeaders,
|
|
1936
1936
|
clientId,
|
|
1937
|
-
withCredentials:
|
|
1937
|
+
withCredentials: !!withCredentials
|
|
1938
1938
|
},
|
|
1939
1939
|
task: "test-connection",
|
|
1940
1940
|
metadata: {
|
|
@@ -1955,13 +1955,13 @@ async function testConnectionString(queryEndpoint, connectionString, databaseTyp
|
|
|
1955
1955
|
throw error;
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, queryHeaders) {
|
|
1958
|
+
async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, queryHeaders, withCredentials) {
|
|
1959
1959
|
await quillFetch({
|
|
1960
1960
|
client: {
|
|
1961
1961
|
queryEndpoint,
|
|
1962
1962
|
queryHeaders,
|
|
1963
1963
|
clientId,
|
|
1964
|
-
withCredentials:
|
|
1964
|
+
withCredentials: !!withCredentials
|
|
1965
1965
|
},
|
|
1966
1966
|
task: "set-schemas",
|
|
1967
1967
|
metadata: {
|
|
@@ -1971,14 +1971,14 @@ async function setSchemaNames(queryEndpoint, clientId, schemaNames, getToken, qu
|
|
|
1971
1971
|
getToken
|
|
1972
1972
|
});
|
|
1973
1973
|
}
|
|
1974
|
-
async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, getToken, queryHeaders) {
|
|
1974
|
+
async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, getToken, queryHeaders, withCredentials) {
|
|
1975
1975
|
const schemaMap = {};
|
|
1976
1976
|
const { queries } = await quillFetch({
|
|
1977
1977
|
client: {
|
|
1978
1978
|
queryEndpoint,
|
|
1979
1979
|
queryHeaders,
|
|
1980
1980
|
clientId,
|
|
1981
|
-
withCredentials:
|
|
1981
|
+
withCredentials: !!withCredentials
|
|
1982
1982
|
},
|
|
1983
1983
|
task: "get-tables-by-schemas",
|
|
1984
1984
|
metadata: {
|
|
@@ -2010,13 +2010,13 @@ async function getSchemaTables(schemas, databaseType, queryEndpoint, clientId, g
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return { tables: allTables.flat(), schema: schemaMap };
|
|
2012
2012
|
}
|
|
2013
|
-
async function getTableColumns(tables, databaseType, queryEndpoint, clientId, getToken, queryHeaders) {
|
|
2013
|
+
async function getTableColumns(tables, databaseType, queryEndpoint, clientId, getToken, queryHeaders, withCredentials) {
|
|
2014
2014
|
const { queries } = await quillFetch({
|
|
2015
2015
|
client: {
|
|
2016
2016
|
queryEndpoint,
|
|
2017
2017
|
queryHeaders,
|
|
2018
2018
|
clientId,
|
|
2019
|
-
withCredentials:
|
|
2019
|
+
withCredentials: !!withCredentials
|
|
2020
2020
|
},
|
|
2021
2021
|
task: "get-schema-table-columns",
|
|
2022
2022
|
metadata: {
|
|
@@ -2051,7 +2051,7 @@ async function getTableColumns(tables, databaseType, queryEndpoint, clientId, ge
|
|
|
2051
2051
|
}
|
|
2052
2052
|
return columnsByTable;
|
|
2053
2053
|
}
|
|
2054
|
-
async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, databaseType, getToken, schemas, queryHeaders) {
|
|
2054
|
+
async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, databaseType, getToken, schemas, queryHeaders, withCredentials) {
|
|
2055
2055
|
if (isSelfHosted) {
|
|
2056
2056
|
const { tables, schema } = await getSchemaTables(
|
|
2057
2057
|
schemas,
|
|
@@ -2059,7 +2059,8 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2059
2059
|
queryEndpoint,
|
|
2060
2060
|
clientId,
|
|
2061
2061
|
getToken,
|
|
2062
|
-
queryHeaders
|
|
2062
|
+
queryHeaders,
|
|
2063
|
+
withCredentials
|
|
2063
2064
|
);
|
|
2064
2065
|
const columnsByTable = await getTableColumns(
|
|
2065
2066
|
tables,
|
|
@@ -2067,7 +2068,8 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2067
2068
|
queryEndpoint,
|
|
2068
2069
|
clientId,
|
|
2069
2070
|
getToken,
|
|
2070
|
-
queryHeaders
|
|
2071
|
+
queryHeaders,
|
|
2072
|
+
withCredentials
|
|
2071
2073
|
);
|
|
2072
2074
|
return { columnsByTable, schema };
|
|
2073
2075
|
} else {
|
|
@@ -2076,7 +2078,7 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2076
2078
|
queryEndpoint,
|
|
2077
2079
|
queryHeaders,
|
|
2078
2080
|
clientId,
|
|
2079
|
-
withCredentials:
|
|
2081
|
+
withCredentials: !!withCredentials
|
|
2080
2082
|
},
|
|
2081
2083
|
task: "table-info-by-schema",
|
|
2082
2084
|
metadata: {
|
|
@@ -2106,7 +2108,7 @@ async function getTableColumnsBySchema(isSelfHosted, queryEndpoint, clientId, da
|
|
|
2106
2108
|
return { columnsByTable: formattedResults, schema: results.data.schema };
|
|
2107
2109
|
}
|
|
2108
2110
|
}
|
|
2109
|
-
async function getVirtualTableData(clientId, query, databaseType, queryEndpoint, getToken, eventTracking, queryHeaders) {
|
|
2111
|
+
async function getVirtualTableData(clientId, query, databaseType, queryEndpoint, getToken, eventTracking, queryHeaders, withCredentials) {
|
|
2110
2112
|
let queryAst = void 0;
|
|
2111
2113
|
try {
|
|
2112
2114
|
const { data } = await quillFetch({
|
|
@@ -2114,7 +2116,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2114
2116
|
queryEndpoint,
|
|
2115
2117
|
queryHeaders,
|
|
2116
2118
|
clientId,
|
|
2117
|
-
withCredentials:
|
|
2119
|
+
withCredentials: !!withCredentials
|
|
2118
2120
|
},
|
|
2119
2121
|
task: "astify",
|
|
2120
2122
|
metadata: {
|
|
@@ -2122,6 +2124,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2122
2124
|
query,
|
|
2123
2125
|
useNewNodeSql: true
|
|
2124
2126
|
},
|
|
2127
|
+
credentials: withCredentials ? "include" : "omit",
|
|
2125
2128
|
getToken
|
|
2126
2129
|
});
|
|
2127
2130
|
queryAst = data;
|
|
@@ -2153,7 +2156,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2153
2156
|
queryEndpoint,
|
|
2154
2157
|
queryHeaders,
|
|
2155
2158
|
clientId,
|
|
2156
|
-
withCredentials:
|
|
2159
|
+
withCredentials: !!withCredentials
|
|
2157
2160
|
},
|
|
2158
2161
|
task: "query-view",
|
|
2159
2162
|
metadata: {
|
|
@@ -2225,7 +2228,7 @@ async function getVirtualTableData(clientId, query, databaseType, queryEndpoint,
|
|
|
2225
2228
|
success: results.status === "success" ? true : false
|
|
2226
2229
|
} : { ...results, ...queryAst };
|
|
2227
2230
|
}
|
|
2228
|
-
async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryEndpoint, aiPrompt, clientId, getToken, schemaNames, queryHeaders) {
|
|
2231
|
+
async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryEndpoint, aiPrompt, clientId, getToken, schemaNames, queryHeaders, withCredentials) {
|
|
2229
2232
|
if (aiPrompt.trim().length > 500) {
|
|
2230
2233
|
return "";
|
|
2231
2234
|
}
|
|
@@ -2234,7 +2237,7 @@ async function getQueryFromAiWithConnection(isSelfHosted, databaseSchema, queryE
|
|
|
2234
2237
|
queryEndpoint,
|
|
2235
2238
|
queryHeaders,
|
|
2236
2239
|
clientId,
|
|
2237
|
-
withCredentials:
|
|
2240
|
+
withCredentials: !!withCredentials
|
|
2238
2241
|
},
|
|
2239
2242
|
task: "ai-from-client-schema",
|
|
2240
2243
|
metadata: {
|
|
@@ -3683,7 +3686,8 @@ function ConnectDatabase({
|
|
|
3683
3686
|
clientId,
|
|
3684
3687
|
selectedSchemas,
|
|
3685
3688
|
getToken,
|
|
3686
|
-
state.queryHeaders
|
|
3689
|
+
state.queryHeaders,
|
|
3690
|
+
state.withCredentials
|
|
3687
3691
|
);
|
|
3688
3692
|
const databaseSchema = await getTableColumnsBySchema(
|
|
3689
3693
|
state.isSelfHosted,
|
|
@@ -3692,7 +3696,8 @@ function ConnectDatabase({
|
|
|
3692
3696
|
databaseConnectionDetails.type,
|
|
3693
3697
|
getToken,
|
|
3694
3698
|
selectedSchemas,
|
|
3695
|
-
state.queryHeaders
|
|
3699
|
+
state.queryHeaders,
|
|
3700
|
+
state.withCredentials
|
|
3696
3701
|
).then((res) => res.columnsByTable);
|
|
3697
3702
|
setEnvironmentDetails(
|
|
3698
3703
|
databaseConnectionDetails,
|
|
@@ -3759,7 +3764,8 @@ function ConnectDatabase({
|
|
|
3759
3764
|
databaseConnectionDetails.type,
|
|
3760
3765
|
getToken,
|
|
3761
3766
|
clientId,
|
|
3762
|
-
state.queryHeaders
|
|
3767
|
+
state.queryHeaders,
|
|
3768
|
+
state.withCredentials
|
|
3763
3769
|
);
|
|
3764
3770
|
if (result.success) {
|
|
3765
3771
|
try {
|
|
@@ -4379,7 +4385,8 @@ var useDatabaseSchema = () => {
|
|
|
4379
4385
|
state.client.databaseType,
|
|
4380
4386
|
getToken,
|
|
4381
4387
|
state.client.schemaNames ?? [],
|
|
4382
|
-
state.queryHeaders
|
|
4388
|
+
state.queryHeaders,
|
|
4389
|
+
state.withCredentials
|
|
4383
4390
|
);
|
|
4384
4391
|
dispatch({
|
|
4385
4392
|
type: "SET_DATABASE_SCHEMA",
|
|
@@ -5734,7 +5741,8 @@ function EditTenant({
|
|
|
5734
5741
|
queryEndpoint,
|
|
5735
5742
|
getToken,
|
|
5736
5743
|
eventTracking,
|
|
5737
|
-
client.queryHeaders
|
|
5744
|
+
client.queryHeaders,
|
|
5745
|
+
state.withCredentials
|
|
5738
5746
|
);
|
|
5739
5747
|
if (resp.status === "error") {
|
|
5740
5748
|
throw new Error(resp.error);
|
|
@@ -5762,7 +5770,8 @@ function EditTenant({
|
|
|
5762
5770
|
queryEndpoint,
|
|
5763
5771
|
getToken,
|
|
5764
5772
|
eventTracking,
|
|
5765
|
-
client.queryHeaders
|
|
5773
|
+
client.queryHeaders,
|
|
5774
|
+
state.withCredentials
|
|
5766
5775
|
);
|
|
5767
5776
|
if (resp.status === "error") {
|
|
5768
5777
|
throw new Error(resp.error);
|
|
@@ -5806,7 +5815,7 @@ function EditTenant({
|
|
|
5806
5815
|
client: {
|
|
5807
5816
|
queryEndpoint,
|
|
5808
5817
|
clientId: client._id,
|
|
5809
|
-
withCredentials:
|
|
5818
|
+
withCredentials: !!state.withCredentials,
|
|
5810
5819
|
queryHeaders: client.queryHeaders
|
|
5811
5820
|
},
|
|
5812
5821
|
task: "validate-tenant-mapping",
|
|
@@ -5957,7 +5966,6 @@ function EditTenant({
|
|
|
5957
5966
|
)
|
|
5958
5967
|
] });
|
|
5959
5968
|
}
|
|
5960
|
-
console.log("STATE: ", state);
|
|
5961
5969
|
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
5962
5970
|
/* @__PURE__ */ jsxs16(
|
|
5963
5971
|
"div",
|
|
@@ -7682,7 +7690,8 @@ function CreateEnvironment({
|
|
|
7682
7690
|
connection.type,
|
|
7683
7691
|
getToken,
|
|
7684
7692
|
selectedSchemaNames,
|
|
7685
|
-
state.queryHeaders
|
|
7693
|
+
state.queryHeaders,
|
|
7694
|
+
state.withCredentials
|
|
7686
7695
|
).then((schema2) => {
|
|
7687
7696
|
dispatch({
|
|
7688
7697
|
type: "SET_DATABASE_SCHEMA",
|
|
@@ -8273,7 +8282,8 @@ function AdminProvider({
|
|
|
8273
8282
|
labelFontWeight: theme?.labelFontWeight ?? defaultTheme.labelFontWeight,
|
|
8274
8283
|
fontSize: theme?.fontSize ?? defaultTheme.fontSize,
|
|
8275
8284
|
primaryButtonTextColor: theme?.primaryButtonTextColor ?? defaultTheme.primaryButtonTextColor,
|
|
8276
|
-
hoverBackgroundColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverBackgroundColor
|
|
8285
|
+
hoverBackgroundColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverBackgroundColor,
|
|
8286
|
+
hoverPrimaryButtonColor: theme?.hoverBackgroundColor ?? defaultTheme.hoverPrimaryButtonColor
|
|
8277
8287
|
};
|
|
8278
8288
|
return {
|
|
8279
8289
|
loading: true,
|
|
@@ -12609,11 +12619,27 @@ var convertCustomIntervalToDateRange = (interval) => {
|
|
|
12609
12619
|
endDate: endOfToday()
|
|
12610
12620
|
};
|
|
12611
12621
|
case "repeating": {
|
|
12612
|
-
const
|
|
12613
|
-
const
|
|
12614
|
-
const currentSubInterval = interval.subIntervals.find(
|
|
12615
|
-
|
|
12616
|
-
|
|
12622
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
12623
|
+
const currentYear = currentDate.getFullYear();
|
|
12624
|
+
const currentSubInterval = interval.subIntervals.find((subInterval) => {
|
|
12625
|
+
const intervalStart = set(/* @__PURE__ */ new Date(), {
|
|
12626
|
+
year: currentYear,
|
|
12627
|
+
month: subInterval.startDate.month - 1,
|
|
12628
|
+
date: subInterval.startDate.day,
|
|
12629
|
+
hours: 0,
|
|
12630
|
+
minutes: 0,
|
|
12631
|
+
seconds: 0
|
|
12632
|
+
});
|
|
12633
|
+
const intervalEnd = set(/* @__PURE__ */ new Date(), {
|
|
12634
|
+
year: currentYear,
|
|
12635
|
+
month: subInterval.endDate.month - 1,
|
|
12636
|
+
date: subInterval.endDate.day,
|
|
12637
|
+
hours: 23,
|
|
12638
|
+
minutes: 59,
|
|
12639
|
+
seconds: 59
|
|
12640
|
+
});
|
|
12641
|
+
return currentDate >= intervalStart && currentDate <= intervalEnd;
|
|
12642
|
+
});
|
|
12617
12643
|
if (!currentSubInterval) {
|
|
12618
12644
|
throw new Error("Date is not valid in this interval");
|
|
12619
12645
|
}
|
|
@@ -12771,10 +12797,29 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12771
12797
|
let currentDate = endOfDay(option.loopEnd ?? /* @__PURE__ */ new Date());
|
|
12772
12798
|
const cutoffDate = option.loopStart;
|
|
12773
12799
|
while (currentDate > cutoffDate) {
|
|
12774
|
-
const
|
|
12775
|
-
const currentDay = currentDate.getDate();
|
|
12800
|
+
const loopCurrentYear = currentDate.getFullYear();
|
|
12776
12801
|
const currentSubInterval = option.subIntervals.find(
|
|
12777
|
-
(subInterval) =>
|
|
12802
|
+
(subInterval) => {
|
|
12803
|
+
const intervalStart2 = set(/* @__PURE__ */ new Date(), {
|
|
12804
|
+
year: loopCurrentYear,
|
|
12805
|
+
month: subInterval.startDate.month - 1,
|
|
12806
|
+
// convert 1-index to 0-index
|
|
12807
|
+
date: subInterval.startDate.day,
|
|
12808
|
+
hours: 0,
|
|
12809
|
+
minutes: 0,
|
|
12810
|
+
seconds: 0
|
|
12811
|
+
});
|
|
12812
|
+
const intervalEnd = set(/* @__PURE__ */ new Date(), {
|
|
12813
|
+
year: loopCurrentYear,
|
|
12814
|
+
month: subInterval.endDate.month - 1,
|
|
12815
|
+
// convert 1-index to 0-index
|
|
12816
|
+
date: subInterval.endDate.day,
|
|
12817
|
+
hours: 23,
|
|
12818
|
+
minutes: 59,
|
|
12819
|
+
seconds: 59
|
|
12820
|
+
});
|
|
12821
|
+
return currentDate >= intervalStart2 && currentDate <= intervalEnd;
|
|
12822
|
+
}
|
|
12778
12823
|
);
|
|
12779
12824
|
if (!currentSubInterval) {
|
|
12780
12825
|
return [];
|
|
@@ -12793,6 +12838,7 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12793
12838
|
startDate: set(/* @__PURE__ */ new Date(), {
|
|
12794
12839
|
year: currentYear,
|
|
12795
12840
|
month: currentSubInterval.startDate.month - 1,
|
|
12841
|
+
// convert 1-index to 0-index
|
|
12796
12842
|
date: currentSubInterval.startDate.day,
|
|
12797
12843
|
minutes: 0,
|
|
12798
12844
|
hours: 0,
|
|
@@ -12801,6 +12847,7 @@ var convertPresetOptionsToSelectableList = (customIntervals, defaultIntervals) =
|
|
|
12801
12847
|
endDate: set(/* @__PURE__ */ new Date(), {
|
|
12802
12848
|
year: currentYear,
|
|
12803
12849
|
month: currentSubInterval.endDate.month - 1,
|
|
12850
|
+
// convert 1-index to 0-index
|
|
12804
12851
|
date: currentSubInterval.endDate.day,
|
|
12805
12852
|
minutes: 59,
|
|
12806
12853
|
hours: 23,
|
|
@@ -18473,7 +18520,7 @@ function EditFiltersModal({
|
|
|
18473
18520
|
onClick: () => {
|
|
18474
18521
|
openPromoteModal();
|
|
18475
18522
|
},
|
|
18476
|
-
label: "
|
|
18523
|
+
label: "Promote Dashboard",
|
|
18477
18524
|
style: {
|
|
18478
18525
|
width: "fit-content"
|
|
18479
18526
|
}
|
|
@@ -20156,7 +20203,8 @@ function EditEnvironmentModal({
|
|
|
20156
20203
|
state.client.databaseType,
|
|
20157
20204
|
getToken,
|
|
20158
20205
|
state.client.schemaNames ?? [],
|
|
20159
|
-
state.queryHeaders
|
|
20206
|
+
state.queryHeaders,
|
|
20207
|
+
state.withCredentials
|
|
20160
20208
|
);
|
|
20161
20209
|
const tenantTables = state.client.allTenantTypes?.filter(
|
|
20162
20210
|
(t2) => t2.tenantTable !== void 0
|
|
@@ -21695,85 +21743,87 @@ function EmptyDashboardComponent() {
|
|
|
21695
21743
|
boxShadow: "0px 1px 12px rgba(0, 0, 0, 0.07)"
|
|
21696
21744
|
},
|
|
21697
21745
|
children: [
|
|
21698
|
-
/* @__PURE__ */ jsxs42(
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
|
|
21731
|
-
|
|
21732
|
-
|
|
21733
|
-
|
|
21734
|
-
|
|
21735
|
-
|
|
21736
|
-
|
|
21737
|
-
|
|
21738
|
-
|
|
21739
|
-
|
|
21740
|
-
|
|
21741
|
-
|
|
21742
|
-
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21746
|
+
/* @__PURE__ */ jsxs42("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
21747
|
+
/* @__PURE__ */ jsxs42(
|
|
21748
|
+
"div",
|
|
21749
|
+
{
|
|
21750
|
+
style: {
|
|
21751
|
+
display: "flex",
|
|
21752
|
+
flexDirection: "row",
|
|
21753
|
+
alignItems: "center",
|
|
21754
|
+
justifyContent: "center",
|
|
21755
|
+
width: 260
|
|
21756
|
+
},
|
|
21757
|
+
children: [
|
|
21758
|
+
/* @__PURE__ */ jsxs42(
|
|
21759
|
+
"svg",
|
|
21760
|
+
{
|
|
21761
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21762
|
+
viewBox: "0 0 24 24",
|
|
21763
|
+
fill: "#565656",
|
|
21764
|
+
height: 26,
|
|
21765
|
+
width: 26,
|
|
21766
|
+
children: [
|
|
21767
|
+
/* @__PURE__ */ jsx57(
|
|
21768
|
+
"path",
|
|
21769
|
+
{
|
|
21770
|
+
fillRule: "evenodd",
|
|
21771
|
+
d: "M2.25 13.5a8.25 8.25 0 0 1 8.25-8.25.75.75 0 0 1 .75.75v6.75H18a.75.75 0 0 1 .75.75 8.25 8.25 0 0 1-16.5 0Z",
|
|
21772
|
+
clipRule: "evenodd"
|
|
21773
|
+
}
|
|
21774
|
+
),
|
|
21775
|
+
/* @__PURE__ */ jsx57(
|
|
21776
|
+
"path",
|
|
21777
|
+
{
|
|
21778
|
+
fillRule: "evenodd",
|
|
21779
|
+
d: "M12.75 3a.75.75 0 0 1 .75-.75 8.25 8.25 0 0 1 8.25 8.25.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75V3Z",
|
|
21780
|
+
clipRule: "evenodd"
|
|
21781
|
+
}
|
|
21782
|
+
)
|
|
21783
|
+
]
|
|
21784
|
+
}
|
|
21785
|
+
),
|
|
21786
|
+
/* @__PURE__ */ jsx57(
|
|
21787
|
+
"div",
|
|
21788
|
+
{
|
|
21789
|
+
style: {
|
|
21790
|
+
fontSize: state.theme.fontSize,
|
|
21791
|
+
fontFamily: state.theme.fontFamily,
|
|
21792
|
+
fontWeight: 500,
|
|
21793
|
+
color: "#565656",
|
|
21794
|
+
// border: '1px solid #e7e7e7',
|
|
21795
|
+
paddingTop: 8,
|
|
21796
|
+
paddingBottom: 8,
|
|
21797
|
+
paddingRight: 12,
|
|
21798
|
+
paddingLeft: 12,
|
|
21799
|
+
borderRadius: 4,
|
|
21800
|
+
cursor: "pointer"
|
|
21801
|
+
},
|
|
21802
|
+
className: "quill-hover-button",
|
|
21803
|
+
children: "No reports created yet."
|
|
21804
|
+
}
|
|
21805
|
+
)
|
|
21806
|
+
]
|
|
21807
|
+
}
|
|
21808
|
+
),
|
|
21809
|
+
state.AskAIButton ? /* @__PURE__ */ jsx57(
|
|
21810
|
+
"div",
|
|
21811
|
+
{
|
|
21812
|
+
style: {
|
|
21813
|
+
display: "flex",
|
|
21814
|
+
justifyContent: "flex-start",
|
|
21815
|
+
width: 144
|
|
21816
|
+
},
|
|
21817
|
+
children: /* @__PURE__ */ jsx57(
|
|
21818
|
+
state.AskAIButton,
|
|
21759
21819
|
{
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
justifyContent: "flex-start",
|
|
21763
|
-
width: 144
|
|
21764
|
-
},
|
|
21765
|
-
children: /* @__PURE__ */ jsx57(
|
|
21766
|
-
state.AskAIButton,
|
|
21767
|
-
{
|
|
21768
|
-
label: "What is a report?",
|
|
21769
|
-
prompt: "what is a report?"
|
|
21770
|
-
}
|
|
21771
|
-
)
|
|
21820
|
+
label: "What is a report?",
|
|
21821
|
+
prompt: "what is a report?"
|
|
21772
21822
|
}
|
|
21773
|
-
)
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
),
|
|
21823
|
+
)
|
|
21824
|
+
}
|
|
21825
|
+
) : null
|
|
21826
|
+
] }),
|
|
21777
21827
|
/* @__PURE__ */ jsx57("div", { style: { paddingBottom: 8 }, children: /* @__PURE__ */ jsx57(
|
|
21778
21828
|
MemoizedButton,
|
|
21779
21829
|
{
|
|
@@ -26170,43 +26220,55 @@ Affected item${plural ? "s" : ""} ${value.affected.join(", ")}`
|
|
|
26170
26220
|
]
|
|
26171
26221
|
}
|
|
26172
26222
|
),
|
|
26173
|
-
/* @__PURE__ */
|
|
26174
|
-
"div",
|
|
26175
|
-
{
|
|
26176
|
-
style: {
|
|
26177
|
-
fontSize: state.theme?.fontSize,
|
|
26178
|
-
fontWeight: 500,
|
|
26179
|
-
fontFamily: state.theme?.fontFamily,
|
|
26180
|
-
fontSizeAdjust: 0.5,
|
|
26181
|
-
color: "#565656",
|
|
26182
|
-
paddingTop: 8,
|
|
26183
|
-
paddingBottom: 8,
|
|
26184
|
-
paddingRight: 12,
|
|
26185
|
-
paddingLeft: 12,
|
|
26186
|
-
borderRadius: 4,
|
|
26187
|
-
cursor: "pointer"
|
|
26188
|
-
},
|
|
26189
|
-
className: "quill-hover-button",
|
|
26190
|
-
children: "No dashboards created yet."
|
|
26191
|
-
}
|
|
26192
|
-
),
|
|
26193
|
-
state.AskAIButton ? /* @__PURE__ */ jsx64(
|
|
26223
|
+
/* @__PURE__ */ jsxs49(
|
|
26194
26224
|
"div",
|
|
26195
26225
|
{
|
|
26196
26226
|
style: {
|
|
26197
26227
|
display: "flex",
|
|
26198
|
-
|
|
26199
|
-
|
|
26228
|
+
flexDirection: "column",
|
|
26229
|
+
gap: 8
|
|
26200
26230
|
},
|
|
26201
|
-
children:
|
|
26202
|
-
|
|
26203
|
-
|
|
26204
|
-
|
|
26205
|
-
|
|
26206
|
-
|
|
26207
|
-
|
|
26231
|
+
children: [
|
|
26232
|
+
/* @__PURE__ */ jsx64(
|
|
26233
|
+
"div",
|
|
26234
|
+
{
|
|
26235
|
+
style: {
|
|
26236
|
+
fontSize: state.theme?.fontSize,
|
|
26237
|
+
fontWeight: 500,
|
|
26238
|
+
fontFamily: state.theme?.fontFamily,
|
|
26239
|
+
fontSizeAdjust: 0.5,
|
|
26240
|
+
color: "#565656",
|
|
26241
|
+
paddingTop: 8,
|
|
26242
|
+
paddingBottom: 8,
|
|
26243
|
+
paddingRight: 12,
|
|
26244
|
+
paddingLeft: 12,
|
|
26245
|
+
borderRadius: 4,
|
|
26246
|
+
cursor: "pointer"
|
|
26247
|
+
},
|
|
26248
|
+
className: "quill-hover-button",
|
|
26249
|
+
children: "No dashboards created yet."
|
|
26250
|
+
}
|
|
26251
|
+
),
|
|
26252
|
+
state.AskAIButton ? /* @__PURE__ */ jsx64(
|
|
26253
|
+
"div",
|
|
26254
|
+
{
|
|
26255
|
+
style: {
|
|
26256
|
+
display: "flex",
|
|
26257
|
+
justifyContent: "flex-start",
|
|
26258
|
+
width: 144
|
|
26259
|
+
},
|
|
26260
|
+
children: /* @__PURE__ */ jsx64(
|
|
26261
|
+
state.AskAIButton,
|
|
26262
|
+
{
|
|
26263
|
+
label: "What is a dashboard?",
|
|
26264
|
+
prompt: "what is a dashboard?"
|
|
26265
|
+
}
|
|
26266
|
+
)
|
|
26267
|
+
}
|
|
26268
|
+
) : null
|
|
26269
|
+
]
|
|
26208
26270
|
}
|
|
26209
|
-
)
|
|
26271
|
+
)
|
|
26210
26272
|
]
|
|
26211
26273
|
}
|
|
26212
26274
|
),
|
|
@@ -26750,7 +26812,8 @@ function CreateEditVirtualTable({
|
|
|
26750
26812
|
state.client._id,
|
|
26751
26813
|
getToken,
|
|
26752
26814
|
state.client.schemaNames,
|
|
26753
|
-
state.queryHeaders
|
|
26815
|
+
state.queryHeaders,
|
|
26816
|
+
state.withCredentials
|
|
26754
26817
|
);
|
|
26755
26818
|
setEditVirtualTableQuery(results);
|
|
26756
26819
|
setAskAIButtonLoading(false);
|
|
@@ -26799,7 +26862,8 @@ function CreateEditVirtualTable({
|
|
|
26799
26862
|
state.queryEndpoint,
|
|
26800
26863
|
getToken,
|
|
26801
26864
|
eventTracking,
|
|
26802
|
-
state.queryHeaders
|
|
26865
|
+
state.queryHeaders,
|
|
26866
|
+
state.withCredentials
|
|
26803
26867
|
);
|
|
26804
26868
|
if (!resp.success) {
|
|
26805
26869
|
setErrorInfo({ show: true, message: resp.error });
|
|
@@ -26842,7 +26906,7 @@ function CreateEditVirtualTable({
|
|
|
26842
26906
|
queryEndpoint: state.queryEndpoint,
|
|
26843
26907
|
queryHeaders: state.queryHeaders,
|
|
26844
26908
|
clientId: state.client._id,
|
|
26845
|
-
withCredentials:
|
|
26909
|
+
withCredentials: !!state.withCredentials
|
|
26846
26910
|
},
|
|
26847
26911
|
task: "sqlify",
|
|
26848
26912
|
metadata: {
|
|
@@ -29100,7 +29164,8 @@ function EditAddViewModal({
|
|
|
29100
29164
|
state.queryEndpoint,
|
|
29101
29165
|
getToken,
|
|
29102
29166
|
eventTracking,
|
|
29103
|
-
state.queryHeaders
|
|
29167
|
+
state.queryHeaders,
|
|
29168
|
+
state.withCredentials
|
|
29104
29169
|
);
|
|
29105
29170
|
if (!getSqlResults.success) {
|
|
29106
29171
|
setErrorInfo({
|