@budibase/server 2.6.28-alpha.0 → 2.6.28
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.9465fac4.js → index.4ca5529d.js} +399 -399
- package/builder/assets/{index.b33e8ad5.css → index.a86e2071.css} +1 -1
- package/builder/index.html +2 -2
- package/dist/automation.js +34 -45
- package/dist/automation.js.map +3 -3
- package/dist/index.js +34 -49
- package/dist/index.js.map +3 -3
- package/dist/query.js +19 -22
- package/dist/query.js.map +3 -3
- package/package.json +8 -8
- package/src/api/controllers/datasource.ts +1 -13
- package/src/integrations/googlesheets.ts +2 -18
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.6.28
|
|
4
|
+
"version": "2.6.28",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"license": "GPL-3.0",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
49
|
-
"@budibase/backend-core": "2.6.28
|
|
50
|
-
"@budibase/client": "2.6.28
|
|
51
|
-
"@budibase/pro": "2.6.28
|
|
52
|
-
"@budibase/shared-core": "2.6.28
|
|
53
|
-
"@budibase/string-templates": "2.6.28
|
|
54
|
-
"@budibase/types": "2.6.28
|
|
49
|
+
"@budibase/backend-core": "2.6.28",
|
|
50
|
+
"@budibase/client": "2.6.28",
|
|
51
|
+
"@budibase/pro": "2.6.28",
|
|
52
|
+
"@budibase/shared-core": "2.6.28",
|
|
53
|
+
"@budibase/string-templates": "2.6.28",
|
|
54
|
+
"@budibase/types": "2.6.28",
|
|
55
55
|
"@bull-board/api": "3.7.0",
|
|
56
56
|
"@bull-board/koa": "3.9.4",
|
|
57
57
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -195,5 +195,5 @@
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
|
-
"gitHead": "
|
|
198
|
+
"gitHead": "f8d5909e6f248c043d9e707b71730df3d0949b4a"
|
|
199
199
|
}
|
|
@@ -11,7 +11,7 @@ import { BuildSchemaErrors, InvalidColumns } from "../../constants"
|
|
|
11
11
|
import { getIntegration } from "../../integrations"
|
|
12
12
|
import { getDatasourceAndQuery } from "./row/utils"
|
|
13
13
|
import { invalidateDynamicVariables } from "../../threads/utils"
|
|
14
|
-
import { db as dbCore, context, events
|
|
14
|
+
import { db as dbCore, context, events } from "@budibase/backend-core"
|
|
15
15
|
import {
|
|
16
16
|
UserCtx,
|
|
17
17
|
Datasource,
|
|
@@ -25,11 +25,9 @@ import {
|
|
|
25
25
|
FetchDatasourceInfoResponse,
|
|
26
26
|
IntegrationBase,
|
|
27
27
|
DatasourcePlus,
|
|
28
|
-
SourceName,
|
|
29
28
|
} from "@budibase/types"
|
|
30
29
|
import sdk from "../../sdk"
|
|
31
30
|
import { builderSocket } from "../../websockets"
|
|
32
|
-
import { setupCreationAuth as googleSetupCreationAuth } from "src/integrations/googlesheets"
|
|
33
31
|
|
|
34
32
|
function getErrorTables(errors: any, errorType: string) {
|
|
35
33
|
return Object.entries(errors)
|
|
@@ -308,12 +306,6 @@ export async function update(ctx: UserCtx<any, UpdateDatasourceResponse>) {
|
|
|
308
306
|
builderSocket?.emitDatasourceUpdate(ctx, datasource)
|
|
309
307
|
}
|
|
310
308
|
|
|
311
|
-
const preSaveAction: Partial<Record<SourceName, any>> = {
|
|
312
|
-
[SourceName.GOOGLE_SHEETS]: async (datasource: Datasource) => {
|
|
313
|
-
await googleSetupCreationAuth(datasource.config as any)
|
|
314
|
-
},
|
|
315
|
-
}
|
|
316
|
-
|
|
317
309
|
export async function save(
|
|
318
310
|
ctx: UserCtx<CreateDatasourceRequest, CreateDatasourceResponse>
|
|
319
311
|
) {
|
|
@@ -335,10 +327,6 @@ export async function save(
|
|
|
335
327
|
setDefaultDisplayColumns(datasource)
|
|
336
328
|
}
|
|
337
329
|
|
|
338
|
-
if (preSaveAction[datasource.source]) {
|
|
339
|
-
await preSaveAction[datasource.source](datasource)
|
|
340
|
-
}
|
|
341
|
-
|
|
342
330
|
const dbResp = await db.put(datasource)
|
|
343
331
|
await events.datasource.created(datasource)
|
|
344
332
|
datasource._rev = dbResp.rev
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionInfo,
|
|
3
|
-
Datasource,
|
|
4
3
|
DatasourceFeature,
|
|
5
4
|
DatasourceFieldType,
|
|
6
5
|
DatasourcePlus,
|
|
@@ -20,15 +19,13 @@ import { OAuth2Client } from "google-auth-library"
|
|
|
20
19
|
import { buildExternalTableId, finaliseExternalTables } from "./utils"
|
|
21
20
|
import { GoogleSpreadsheet, GoogleSpreadsheetRow } from "google-spreadsheet"
|
|
22
21
|
import fetch from "node-fetch"
|
|
23
|
-
import {
|
|
22
|
+
import { configs, HTTPError } from "@budibase/backend-core"
|
|
24
23
|
import { dataFilters } from "@budibase/shared-core"
|
|
25
24
|
import { GOOGLE_SHEETS_PRIMARY_KEY } from "../constants"
|
|
26
|
-
import sdk from "../sdk"
|
|
27
25
|
|
|
28
26
|
interface GoogleSheetsConfig {
|
|
29
27
|
spreadsheetId: string
|
|
30
28
|
auth: OAuthClientConfig
|
|
31
|
-
continueSetupId?: string
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
interface OAuthClientConfig {
|
|
@@ -75,7 +72,7 @@ const SCHEMA: Integration = {
|
|
|
75
72
|
},
|
|
76
73
|
datasource: {
|
|
77
74
|
spreadsheetId: {
|
|
78
|
-
display: "
|
|
75
|
+
display: "Google Sheet URL",
|
|
79
76
|
type: DatasourceFieldType.STRING,
|
|
80
77
|
required: true,
|
|
81
78
|
},
|
|
@@ -150,7 +147,6 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|
|
150
147
|
|
|
151
148
|
async testConnection(): Promise<ConnectionInfo> {
|
|
152
149
|
try {
|
|
153
|
-
await setupCreationAuth(this.config)
|
|
154
150
|
await this.connect()
|
|
155
151
|
return { connected: true }
|
|
156
152
|
} catch (e: any) {
|
|
@@ -570,18 +566,6 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|
|
570
566
|
}
|
|
571
567
|
}
|
|
572
568
|
|
|
573
|
-
export async function setupCreationAuth(datasouce: GoogleSheetsConfig) {
|
|
574
|
-
if (datasouce.continueSetupId) {
|
|
575
|
-
const appId = context.getAppId()
|
|
576
|
-
const tokens = await cache.get(
|
|
577
|
-
`datasource:creation:${appId}:google:${datasouce.continueSetupId}`
|
|
578
|
-
)
|
|
579
|
-
|
|
580
|
-
datasouce.auth = tokens.tokens
|
|
581
|
-
delete datasouce.continueSetupId
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
569
|
export default {
|
|
586
570
|
schema: SCHEMA,
|
|
587
571
|
integration: GoogleSheetsIntegration,
|