@budibase/server 2.7.5-alpha.0 → 2.7.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.7.5-alpha.0",
4
+ "version": "2.7.6",
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.7.5-alpha.0",
50
- "@budibase/client": "2.7.5-alpha.0",
51
- "@budibase/pro": "2.7.5-alpha.0",
52
- "@budibase/shared-core": "2.7.5-alpha.0",
53
- "@budibase/string-templates": "2.7.5-alpha.0",
54
- "@budibase/types": "2.7.5-alpha.0",
49
+ "@budibase/backend-core": "2.7.6",
50
+ "@budibase/client": "2.7.6",
51
+ "@budibase/pro": "2.7.6",
52
+ "@budibase/shared-core": "2.7.6",
53
+ "@budibase/string-templates": "2.7.6",
54
+ "@budibase/types": "2.7.6",
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": "73e0a61690d414ffbd592f4cd5765897597408d7"
198
+ "gitHead": "f35112cc9cd7ee93c9dcb43bc68ea6e86ac786a9"
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, cache } from "@budibase/backend-core"
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 "../../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 { cache, configs, context, HTTPError } from "@budibase/backend-core"
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: "Spreadsheet URL",
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,