@budibase/server 2.4.12-alpha.0 → 2.4.12
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.af76a09d.css → index.b0e3aca6.css} +2 -2
- package/builder/assets/{index.cbe2be2f.js → index.f6010748.js} +378 -378
- package/builder/index.html +2 -2
- package/dist/api/controllers/row/ExternalRequest.js +2 -10
- package/dist/api/controllers/row/external.js +1 -1
- package/dist/integrations/base/sql.js +1 -1
- package/dist/integrations/googlesheets.js +3 -14
- package/dist/package.json +0 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/jest.config.ts +0 -1
- package/package.json +6 -7
- package/src/api/controllers/row/ExternalRequest.ts +2 -12
- package/src/api/controllers/row/external.ts +3 -3
- package/src/integrations/base/sql.ts +1 -2
- package/src/integrations/googlesheets.ts +4 -30
- package/tsconfig.json +10 -5
package/jest.config.ts
CHANGED
|
@@ -14,7 +14,6 @@ const baseConfig: Config.InitialProjectOptions = {
|
|
|
14
14
|
moduleNameMapper: {
|
|
15
15
|
"@budibase/backend-core/(.*)": "<rootDir>/../backend-core/$1",
|
|
16
16
|
"@budibase/backend-core": "<rootDir>/../backend-core/src",
|
|
17
|
-
"@budibase/shared-core": "<rootDir>/../shared-core/src",
|
|
18
17
|
"@budibase/types": "<rootDir>/../types/src",
|
|
19
18
|
},
|
|
20
19
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.12
|
|
4
|
+
"version": "2.4.12",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -43,12 +43,11 @@
|
|
|
43
43
|
"license": "GPL-3.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "2.4.12
|
|
47
|
-
"@budibase/client": "2.4.12
|
|
46
|
+
"@budibase/backend-core": "^2.4.12",
|
|
47
|
+
"@budibase/client": "^2.4.12",
|
|
48
48
|
"@budibase/pro": "2.4.11",
|
|
49
|
-
"@budibase/
|
|
50
|
-
"@budibase/
|
|
51
|
-
"@budibase/types": "2.4.12-alpha.0",
|
|
49
|
+
"@budibase/string-templates": "^2.4.12",
|
|
50
|
+
"@budibase/types": "^2.4.12",
|
|
52
51
|
"@bull-board/api": "3.7.0",
|
|
53
52
|
"@bull-board/koa": "3.9.4",
|
|
54
53
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -175,5 +174,5 @@
|
|
|
175
174
|
"optionalDependencies": {
|
|
176
175
|
"oracledb": "5.3.0"
|
|
177
176
|
},
|
|
178
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "ac4c0b3dd60c901691c7644c2f9aa6a5458b03f4"
|
|
179
178
|
}
|
|
@@ -11,8 +11,6 @@ import {
|
|
|
11
11
|
Row,
|
|
12
12
|
Table,
|
|
13
13
|
RelationshipTypes,
|
|
14
|
-
FieldType,
|
|
15
|
-
SortType,
|
|
16
14
|
} from "@budibase/types"
|
|
17
15
|
import {
|
|
18
16
|
breakRowIdField,
|
|
@@ -751,16 +749,8 @@ export class ExternalRequest {
|
|
|
751
749
|
)
|
|
752
750
|
//if the sort column is a formula, remove it
|
|
753
751
|
for (let sortColumn of Object.keys(sort || {})) {
|
|
754
|
-
if (
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
switch (table.schema[sortColumn]?.type) {
|
|
758
|
-
case FieldType.FORMULA:
|
|
759
|
-
delete sort?.[sortColumn]
|
|
760
|
-
break
|
|
761
|
-
case FieldType.NUMBER:
|
|
762
|
-
sort[sortColumn].type = SortType.number
|
|
763
|
-
break
|
|
752
|
+
if (table.schema[sortColumn]?.type === "formula") {
|
|
753
|
+
delete sort?.[sortColumn]
|
|
764
754
|
}
|
|
765
755
|
}
|
|
766
756
|
filters = buildFilters(id, filters || {}, table)
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
breakRowIdField,
|
|
9
9
|
} from "../../../integrations/utils"
|
|
10
10
|
import { ExternalRequest, RunConfig } from "./ExternalRequest"
|
|
11
|
+
import { context } from "@budibase/backend-core"
|
|
11
12
|
import * as exporters from "../view/exporters"
|
|
12
13
|
import { apiFileReturn } from "../../../utilities/fileSystem"
|
|
13
14
|
import {
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
Table,
|
|
19
20
|
Datasource,
|
|
20
21
|
IncludeRelationship,
|
|
21
|
-
SortJson,
|
|
22
22
|
} from "@budibase/types"
|
|
23
23
|
import sdk from "../../../sdk"
|
|
24
24
|
|
|
@@ -142,14 +142,14 @@ export async function search(ctx: BBContext) {
|
|
|
142
142
|
limit: limit,
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
let sort
|
|
145
|
+
let sort
|
|
146
146
|
if (params.sort) {
|
|
147
147
|
const direction =
|
|
148
148
|
params.sortOrder === "descending"
|
|
149
149
|
? SortDirection.DESCENDING
|
|
150
150
|
: SortDirection.ASCENDING
|
|
151
151
|
sort = {
|
|
152
|
-
[params.sort]:
|
|
152
|
+
[params.sort]: direction,
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
try {
|
|
@@ -317,8 +317,7 @@ class InternalBuilder {
|
|
|
317
317
|
const table = json.meta?.table
|
|
318
318
|
if (sort) {
|
|
319
319
|
for (let [key, value] of Object.entries(sort)) {
|
|
320
|
-
const direction =
|
|
321
|
-
value.direction === SortDirection.ASCENDING ? "asc" : "desc"
|
|
320
|
+
const direction = value === SortDirection.ASCENDING ? "asc" : "desc"
|
|
322
321
|
query = query.orderBy(`${table?.name}.${key}`, direction)
|
|
323
322
|
}
|
|
324
323
|
} else if (this.client === SqlClient.MS_SQL && paginate?.limit) {
|
|
@@ -2,11 +2,8 @@ import {
|
|
|
2
2
|
DatasourceFieldType,
|
|
3
3
|
DatasourcePlus,
|
|
4
4
|
Integration,
|
|
5
|
-
PaginationJson,
|
|
6
5
|
QueryJson,
|
|
7
6
|
QueryType,
|
|
8
|
-
SearchFilters,
|
|
9
|
-
SortJson,
|
|
10
7
|
Table,
|
|
11
8
|
TableSchema,
|
|
12
9
|
} from "@budibase/types"
|
|
@@ -16,7 +13,6 @@ import { DataSourceOperation, FieldTypes } from "../constants"
|
|
|
16
13
|
import { GoogleSpreadsheet } from "google-spreadsheet"
|
|
17
14
|
import fetch from "node-fetch"
|
|
18
15
|
import { configs, HTTPError } from "@budibase/backend-core"
|
|
19
|
-
import { dataFilters } from "@budibase/shared-core"
|
|
20
16
|
|
|
21
17
|
interface GoogleSheetsConfig {
|
|
22
18
|
spreadsheetId: string
|
|
@@ -241,7 +237,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|
|
241
237
|
const handlers = {
|
|
242
238
|
[DataSourceOperation.CREATE]: () =>
|
|
243
239
|
this.create({ sheet, row: json.body }),
|
|
244
|
-
[DataSourceOperation.READ]: () => this.read({
|
|
240
|
+
[DataSourceOperation.READ]: () => this.read({ sheet }),
|
|
245
241
|
[DataSourceOperation.UPDATE]: () =>
|
|
246
242
|
this.update({
|
|
247
243
|
// exclude the header row and zero index
|
|
@@ -349,40 +345,18 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|
|
349
345
|
}
|
|
350
346
|
}
|
|
351
347
|
|
|
352
|
-
async read(query: {
|
|
353
|
-
sheet: string
|
|
354
|
-
filters?: SearchFilters
|
|
355
|
-
sort?: SortJson
|
|
356
|
-
paginate?: PaginationJson
|
|
357
|
-
}) {
|
|
348
|
+
async read(query: { sheet: string }) {
|
|
358
349
|
try {
|
|
359
350
|
await this.connect()
|
|
360
351
|
const sheet = this.client.sheetsByTitle[query.sheet]
|
|
361
352
|
const rows = await sheet.getRows()
|
|
362
|
-
const filtered = dataFilters.runLuceneQuery(rows, query.filters)
|
|
363
353
|
const headerValues = sheet.headerValues
|
|
364
|
-
|
|
365
|
-
for (let row of
|
|
354
|
+
const response = []
|
|
355
|
+
for (let row of rows) {
|
|
366
356
|
response.push(
|
|
367
357
|
this.buildRowObject(headerValues, row._rawData, row._rowNumber)
|
|
368
358
|
)
|
|
369
359
|
}
|
|
370
|
-
|
|
371
|
-
if (query.sort) {
|
|
372
|
-
if (Object.keys(query.sort).length !== 1) {
|
|
373
|
-
console.warn("Googlesheets does not support multiple sorting", {
|
|
374
|
-
sortInfo: query.sort,
|
|
375
|
-
})
|
|
376
|
-
}
|
|
377
|
-
const [sortField, sortInfo] = Object.entries(query.sort)[0]
|
|
378
|
-
response = dataFilters.luceneSort(
|
|
379
|
-
response,
|
|
380
|
-
sortField,
|
|
381
|
-
sortInfo.direction,
|
|
382
|
-
sortInfo.type
|
|
383
|
-
)
|
|
384
|
-
}
|
|
385
|
-
|
|
386
360
|
return response
|
|
387
361
|
} catch (err) {
|
|
388
362
|
console.error("Error reading from google sheets", err)
|
package/tsconfig.json
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"@budibase/types": ["../types/src"],
|
|
10
10
|
"@budibase/backend-core": ["../backend-core/src"],
|
|
11
11
|
"@budibase/backend-core/*": ["../backend-core/*"],
|
|
12
|
-
"@budibase/shared-core": ["../shared-core/src"],
|
|
13
12
|
"@budibase/pro": ["../../../budibase-pro/packages/pro/src"]
|
|
14
13
|
}
|
|
15
14
|
},
|
|
@@ -20,9 +19,15 @@
|
|
|
20
19
|
"references": [
|
|
21
20
|
{ "path": "../types" },
|
|
22
21
|
{ "path": "../backend-core" },
|
|
23
|
-
{ "path": "../shared-core" },
|
|
24
22
|
{ "path": "../../../budibase-pro/packages/pro" }
|
|
25
23
|
],
|
|
26
|
-
"include": [
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
"include": [
|
|
25
|
+
"src/**/*",
|
|
26
|
+
"specs",
|
|
27
|
+
"package.json"
|
|
28
|
+
],
|
|
29
|
+
"exclude": [
|
|
30
|
+
"node_modules",
|
|
31
|
+
"dist"
|
|
32
|
+
]
|
|
33
|
+
}
|