@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.
@@ -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.cbe2be2f.js"></script>
14
- <link rel="stylesheet" href="/builder/assets/index.af76a09d.css">
13
+ <script type="module" crossorigin src="/builder/assets/index.f6010748.js"></script>
14
+ <link rel="stylesheet" href="/builder/assets/index.b0e3aca6.css">
15
15
  </head>
16
16
  <body id="app">
17
17
 
@@ -614,16 +614,8 @@ 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 (!(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;
617
+ if (((_a = table.schema[sortColumn]) === null || _a === void 0 ? void 0 : _a.type) === "formula") {
618
+ sort === null || sort === void 0 ? true : delete sort[sortColumn];
627
619
  }
628
620
  }
629
621
  filters = buildFilters(id, filters || {}, table);
@@ -188,7 +188,7 @@ function search(ctx) {
188
188
  ? constants_1.SortDirection.DESCENDING
189
189
  : constants_1.SortDirection.ASCENDING;
190
190
  sort = {
191
- [params.sort]: { direction },
191
+ [params.sort]: direction,
192
192
  };
193
193
  }
194
194
  try {
@@ -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.direction === types_1.SortDirection.ASCENDING ? "asc" : "desc";
296
+ const direction = value === 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,7 +19,6 @@ 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");
23
22
  const SCHEMA = {
24
23
  plus: true,
25
24
  auth: {
@@ -197,7 +196,7 @@ class GoogleSheetsIntegration {
197
196
  const sheet = json.endpoint.entityId;
198
197
  const handlers = {
199
198
  [constants_1.DataSourceOperation.CREATE]: () => this.create({ sheet, row: json.body }),
200
- [constants_1.DataSourceOperation.READ]: () => this.read(Object.assign(Object.assign({}, json), { sheet })),
199
+ [constants_1.DataSourceOperation.READ]: () => this.read({ sheet }),
201
200
  [constants_1.DataSourceOperation.UPDATE]: () => {
202
201
  var _a, _b, _c;
203
202
  return this.update({
@@ -313,21 +312,11 @@ class GoogleSheetsIntegration {
313
312
  yield this.connect();
314
313
  const sheet = this.client.sheetsByTitle[query.sheet];
315
314
  const rows = yield sheet.getRows();
316
- const filtered = shared_core_1.dataFilters.runLuceneQuery(rows, query.filters);
317
315
  const headerValues = sheet.headerValues;
318
- let response = [];
319
- for (let row of filtered) {
316
+ const response = [];
317
+ for (let row of rows) {
320
318
  response.push(this.buildRowObject(headerValues, row._rawData, row._rowNumber));
321
319
  }
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
- }
331
320
  return response;
332
321
  }
333
322
  catch (err) {
package/dist/package.json CHANGED
@@ -46,7 +46,6 @@
46
46
  "@budibase/backend-core": "^2.4.11",
47
47
  "@budibase/client": "^2.4.11",
48
48
  "@budibase/pro": "2.4.11",
49
- "@budibase/shared-core": "2.4.8-alpha.4",
50
49
  "@budibase/string-templates": "^2.4.11",
51
50
  "@budibase/types": "^2.4.11",
52
51
  "@bull-board/api": "3.7.0",