@budibase/server 2.6.8-alpha.2 → 2.6.8-alpha.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.6.8-alpha.2",
4
+ "version": "2.6.8-alpha.6",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -45,12 +45,12 @@
45
45
  "license": "GPL-3.0",
46
46
  "dependencies": {
47
47
  "@apidevtools/swagger-parser": "10.0.3",
48
- "@budibase/backend-core": "2.6.8-alpha.2",
49
- "@budibase/client": "2.6.8-alpha.2",
50
- "@budibase/pro": "2.6.8-alpha.2",
51
- "@budibase/shared-core": "2.6.8-alpha.2",
52
- "@budibase/string-templates": "2.6.8-alpha.2",
53
- "@budibase/types": "2.6.8-alpha.2",
48
+ "@budibase/backend-core": "2.6.8-alpha.6",
49
+ "@budibase/client": "2.6.8-alpha.6",
50
+ "@budibase/pro": "2.6.8-alpha.6",
51
+ "@budibase/shared-core": "2.6.8-alpha.6",
52
+ "@budibase/string-templates": "2.6.8-alpha.6",
53
+ "@budibase/types": "2.6.8-alpha.6",
54
54
  "@bull-board/api": "3.7.0",
55
55
  "@bull-board/koa": "3.9.4",
56
56
  "@elastic/elasticsearch": "7.10.0",
@@ -176,5 +176,5 @@
176
176
  "optionalDependencies": {
177
177
  "oracledb": "5.3.0"
178
178
  },
179
- "gitHead": "65cb1efba0c97707137786e4ed2722d2e8465bd1"
179
+ "gitHead": "1f8cbc54b04c655b204813748d415400c886d9c5"
180
180
  }
@@ -15,7 +15,7 @@ import {
15
15
  } from "@budibase/types"
16
16
  import { OAuth2Client } from "google-auth-library"
17
17
  import { buildExternalTableId, finaliseExternalTables } from "./utils"
18
- import { GoogleSpreadsheet } from "google-spreadsheet"
18
+ import { GoogleSpreadsheet, GoogleSpreadsheetRow } from "google-spreadsheet"
19
19
  import fetch from "node-fetch"
20
20
  import { configs, HTTPError } from "@budibase/backend-core"
21
21
  import { dataFilters } from "@budibase/shared-core"
@@ -434,7 +434,20 @@ class GoogleSheetsIntegration implements DatasourcePlus {
434
434
  try {
435
435
  await this.connect()
436
436
  const sheet = this.client.sheetsByTitle[query.sheet]
437
- const rows = await sheet.getRows()
437
+ let rows: GoogleSpreadsheetRow[] = []
438
+ if (query.paginate) {
439
+ const limit = query.paginate.limit || 100
440
+ let page: number =
441
+ typeof query.paginate.page === "number"
442
+ ? query.paginate.page
443
+ : parseInt(query.paginate.page || "1")
444
+ rows = await sheet.getRows({
445
+ limit,
446
+ offset: (page - 1) * limit,
447
+ })
448
+ } else {
449
+ rows = await sheet.getRows()
450
+ }
438
451
  const filtered = dataFilters.runLuceneQuery(rows, query.filters)
439
452
  const headerValues = sheet.headerValues
440
453
  let response = []