diff --git a/packages/builder/src/components/common/HelpIcon.svelte b/packages/builder/src/components/common/HelpIcon.svelte index bebc67e5f2..bb3256792e 100644 --- a/packages/builder/src/components/common/HelpIcon.svelte +++ b/packages/builder/src/components/common/HelpIcon.svelte @@ -1,12 +1,30 @@ - + + + Need help? Go to our forums + + + diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte index 904cec9944..bde1dc256a 100644 --- a/packages/builder/src/components/integration/KeyValueBuilder.svelte +++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte @@ -134,4 +134,7 @@ .container-active { grid-template-columns: 1fr 1fr 50px 20px; } + .readOnly { + grid-template-columns: 1fr 1fr; + } diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte index 3c611459c1..53a4b0bf41 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte @@ -266,7 +266,10 @@ /> - + + + + {#if response} diff --git a/packages/server/src/api/controllers/query/index.js b/packages/server/src/api/controllers/query/index.js index 7c9bf173bc..e12b0039a5 100644 --- a/packages/server/src/api/controllers/query/index.js +++ b/packages/server/src/api/controllers/query/index.js @@ -151,7 +151,7 @@ exports.preview = async function (ctx) { const enrichedQuery = await enrichQueryFields(fields, parameters) try { - const { rows, keys, info, raw } = await Runner.run({ + const { rows, keys, info, extra } = await Runner.run({ datasource, queryVerb, query: enrichedQuery, @@ -162,7 +162,7 @@ exports.preview = async function (ctx) { rows, schemaFields: [...new Set(keys)], info, - raw, + extra, } } catch (err) { ctx.throw(400, err) diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 35230cba4a..e474d996b6 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -122,7 +122,7 @@ module RestModule { } async parseResponse(response: any) { - let data, raw + let data, raw, headers const contentType = response.headers.get("content-type") if (contentType && contentType.indexOf("application/json") !== -1) { data = await response.json() @@ -133,6 +133,10 @@ module RestModule { } const size = formatBytes(response.headers.get("content-length") || 0) const time = `${Math.round(performance.now() - this.startTimeMs)}ms` + headers = response.headers.raw() + for (let [key, value] of Object.entries(headers)) { + headers[key] = Array.isArray(value) ? value[0] : value + } return { data, info: { @@ -140,7 +144,10 @@ module RestModule { size, time, }, - raw, + extra: { + raw, + headers, + }, } } diff --git a/packages/server/src/threads/query.js b/packages/server/src/threads/query.js index d94c4e6c2c..9645bfcd47 100644 --- a/packages/server/src/threads/query.js +++ b/packages/server/src/threads/query.js @@ -19,8 +19,8 @@ function hasExtraData(response) { return ( typeof response === "object" && !Array.isArray(response) && - response.data && - response.info + response.data != null && + response.info != null ) } @@ -34,11 +34,11 @@ async function runAndTransform(datasource, queryVerb, query, transformer) { let output = formatResponse(await integration[queryVerb](query)) let rows = output, info = undefined, - raw = undefined + extra = undefined if (hasExtraData(output)) { rows = output.data info = output.info - raw = output.raw + extra = output.extra } // transform as required @@ -64,7 +64,7 @@ async function runAndTransform(datasource, queryVerb, query, transformer) { integration.end() } - return { rows, keys, info, raw } + return { rows, keys, info, extra } } module.exports = (input, callback) => {