@budibase/server 2.4.10 → 2.4.12-alpha.0
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/builder/assets/{index.b0e3aca6.css → index.af76a09d.css} +2 -2
- package/builder/assets/{index.2ce42aa5.js → index.cbe2be2f.js} +375 -375
- package/builder/index.html +2 -2
- package/dist/api/controllers/row/ExternalRequest.js +10 -2
- package/dist/api/controllers/row/external.js +1 -1
- package/dist/integrations/base/sql.js +1 -1
- package/dist/integrations/googlesheets.js +14 -3
- package/dist/package.json +7 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/jest.config.ts +1 -0
- package/package.json +8 -7
- package/src/api/controllers/row/ExternalRequest.ts +12 -2
- package/src/api/controllers/row/external.ts +3 -3
- package/src/integrations/base/sql.ts +2 -1
- package/src/integrations/googlesheets.ts +30 -4
- package/tsconfig.json +5 -10
package/builder/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
11
11
|
rel="stylesheet"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/builder/assets/index.
|
|
14
|
-
<link rel="stylesheet" href="/builder/assets/index.
|
|
13
|
+
<script type="module" crossorigin src="/builder/assets/index.cbe2be2f.js"></script>
|
|
14
|
+
<link rel="stylesheet" href="/builder/assets/index.af76a09d.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body id="app">
|
|
17
17
|
|
|
@@ -614,8 +614,16 @@ class ExternalRequest {
|
|
|
614
614
|
let { id, row, filters, sort, paginate, rows } = cleanupConfig(config, table);
|
|
615
615
|
//if the sort column is a formula, remove it
|
|
616
616
|
for (let sortColumn of Object.keys(sort || {})) {
|
|
617
|
-
if ((
|
|
618
|
-
|
|
617
|
+
if (!(sort === null || sort === void 0 ? void 0 : sort[sortColumn])) {
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
switch ((_a = table.schema[sortColumn]) === null || _a === void 0 ? void 0 : _a.type) {
|
|
621
|
+
case types_1.FieldType.FORMULA:
|
|
622
|
+
sort === null || sort === void 0 ? true : delete sort[sortColumn];
|
|
623
|
+
break;
|
|
624
|
+
case types_1.FieldType.NUMBER:
|
|
625
|
+
sort[sortColumn].type = types_1.SortType.number;
|
|
626
|
+
break;
|
|
619
627
|
}
|
|
620
628
|
}
|
|
621
629
|
filters = buildFilters(id, filters || {}, table);
|
|
@@ -293,7 +293,7 @@ class InternalBuilder {
|
|
|
293
293
|
const table = (_a = json.meta) === null || _a === void 0 ? void 0 : _a.table;
|
|
294
294
|
if (sort) {
|
|
295
295
|
for (let [key, value] of Object.entries(sort)) {
|
|
296
|
-
const direction = value === types_1.SortDirection.ASCENDING ? "asc" : "desc";
|
|
296
|
+
const direction = value.direction === types_1.SortDirection.ASCENDING ? "asc" : "desc";
|
|
297
297
|
query = query.orderBy(`${table === null || table === void 0 ? void 0 : table.name}.${key}`, direction);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -19,6 +19,7 @@ const constants_1 = require("../constants");
|
|
|
19
19
|
const google_spreadsheet_1 = require("google-spreadsheet");
|
|
20
20
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
21
21
|
const backend_core_1 = require("@budibase/backend-core");
|
|
22
|
+
const shared_core_1 = require("@budibase/shared-core");
|
|
22
23
|
const SCHEMA = {
|
|
23
24
|
plus: true,
|
|
24
25
|
auth: {
|
|
@@ -196,7 +197,7 @@ class GoogleSheetsIntegration {
|
|
|
196
197
|
const sheet = json.endpoint.entityId;
|
|
197
198
|
const handlers = {
|
|
198
199
|
[constants_1.DataSourceOperation.CREATE]: () => this.create({ sheet, row: json.body }),
|
|
199
|
-
[constants_1.DataSourceOperation.READ]: () => this.read({ sheet }),
|
|
200
|
+
[constants_1.DataSourceOperation.READ]: () => this.read(Object.assign(Object.assign({}, json), { sheet })),
|
|
200
201
|
[constants_1.DataSourceOperation.UPDATE]: () => {
|
|
201
202
|
var _a, _b, _c;
|
|
202
203
|
return this.update({
|
|
@@ -312,11 +313,21 @@ class GoogleSheetsIntegration {
|
|
|
312
313
|
yield this.connect();
|
|
313
314
|
const sheet = this.client.sheetsByTitle[query.sheet];
|
|
314
315
|
const rows = yield sheet.getRows();
|
|
316
|
+
const filtered = shared_core_1.dataFilters.runLuceneQuery(rows, query.filters);
|
|
315
317
|
const headerValues = sheet.headerValues;
|
|
316
|
-
|
|
317
|
-
for (let row of
|
|
318
|
+
let response = [];
|
|
319
|
+
for (let row of filtered) {
|
|
318
320
|
response.push(this.buildRowObject(headerValues, row._rawData, row._rowNumber));
|
|
319
321
|
}
|
|
322
|
+
if (query.sort) {
|
|
323
|
+
if (Object.keys(query.sort).length !== 1) {
|
|
324
|
+
console.warn("Googlesheets does not support multiple sorting", {
|
|
325
|
+
sortInfo: query.sort,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
const [sortField, sortInfo] = Object.entries(query.sort)[0];
|
|
329
|
+
response = shared_core_1.dataFilters.luceneSort(response, sortField, sortInfo.direction, sortInfo.type);
|
|
330
|
+
}
|
|
320
331
|
return response;
|
|
321
332
|
}
|
|
322
333
|
catch (err) {
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.11",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -43,11 +43,12 @@
|
|
|
43
43
|
"license": "GPL-3.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "^2.4.
|
|
47
|
-
"@budibase/client": "^2.4.
|
|
48
|
-
"@budibase/pro": "2.4.
|
|
49
|
-
"@budibase/
|
|
50
|
-
"@budibase/
|
|
46
|
+
"@budibase/backend-core": "^2.4.11",
|
|
47
|
+
"@budibase/client": "^2.4.11",
|
|
48
|
+
"@budibase/pro": "2.4.11",
|
|
49
|
+
"@budibase/shared-core": "2.4.8-alpha.4",
|
|
50
|
+
"@budibase/string-templates": "^2.4.11",
|
|
51
|
+
"@budibase/types": "^2.4.11",
|
|
51
52
|
"@bull-board/api": "3.7.0",
|
|
52
53
|
"@bull-board/koa": "3.9.4",
|
|
53
54
|
"@elastic/elasticsearch": "7.10.0",
|