@budibase/server 2.6.15 → 2.6.16-alpha.1

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.
@@ -8,8 +8,8 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
10
10
  rel="stylesheet" />
11
- <script type="module" crossorigin src="/builder/assets/index.a40dcadd.js"></script>
12
- <link rel="stylesheet" href="/builder/assets/index.86c992bf.css">
11
+ <script type="module" crossorigin src="/builder/assets/index.6871cd96.js"></script>
12
+ <link rel="stylesheet" href="/builder/assets/index.99a64f16.css">
13
13
  </head>
14
14
 
15
15
  <body id="app">
@@ -33,6 +33,10 @@ exports.definition = {
33
33
  type: types_1.AutomationIOType.STRING,
34
34
  title: "Webhook URL",
35
35
  },
36
+ body: {
37
+ type: types_1.AutomationIOType.JSON,
38
+ title: "Payload",
39
+ },
36
40
  value1: {
37
41
  type: types_1.AutomationIOType.STRING,
38
42
  title: "Input Value 1",
@@ -78,7 +82,19 @@ exports.definition = {
78
82
  function run({ inputs }) {
79
83
  var _a;
80
84
  return __awaiter(this, void 0, void 0, function* () {
81
- const { url, value1, value2, value3, value4, value5 } = inputs;
85
+ //TODO - Remove deprecated values 1,2,3,4,5 after November 2023
86
+ const { url, value1, value2, value3, value4, value5, body } = inputs;
87
+ let payload = {};
88
+ try {
89
+ payload = (body === null || body === void 0 ? void 0 : body.value) ? JSON.parse(body === null || body === void 0 ? void 0 : body.value) : {};
90
+ }
91
+ catch (err) {
92
+ return {
93
+ httpStatus: 400,
94
+ response: "Invalid payload JSON",
95
+ success: false,
96
+ };
97
+ }
82
98
  if (!((_a = url === null || url === void 0 ? void 0 : url.trim()) === null || _a === void 0 ? void 0 : _a.length)) {
83
99
  return {
84
100
  httpStatus: 400,
@@ -90,13 +106,11 @@ function run({ inputs }) {
90
106
  try {
91
107
  response = yield (0, node_fetch_1.default)(url, {
92
108
  method: "post",
93
- body: JSON.stringify({
94
- value1,
109
+ body: JSON.stringify(Object.assign({ value1,
95
110
  value2,
96
111
  value3,
97
112
  value4,
98
- value5,
99
- }),
113
+ value5 }, payload)),
100
114
  headers: {
101
115
  "Content-Type": "application/json",
102
116
  },
@@ -32,6 +32,10 @@ exports.definition = {
32
32
  type: types_1.AutomationIOType.STRING,
33
33
  title: "Webhook URL",
34
34
  },
35
+ body: {
36
+ type: types_1.AutomationIOType.JSON,
37
+ title: "Payload",
38
+ },
35
39
  value1: {
36
40
  type: types_1.AutomationIOType.STRING,
37
41
  title: "Payload Value 1",
@@ -72,7 +76,19 @@ exports.definition = {
72
76
  function run({ inputs }) {
73
77
  var _a;
74
78
  return __awaiter(this, void 0, void 0, function* () {
75
- const { url, value1, value2, value3, value4, value5 } = inputs;
79
+ //TODO - Remove deprecated values 1,2,3,4,5 after November 2023
80
+ const { url, value1, value2, value3, value4, value5, body } = inputs;
81
+ let payload = {};
82
+ try {
83
+ payload = (body === null || body === void 0 ? void 0 : body.value) ? JSON.parse(body === null || body === void 0 ? void 0 : body.value) : {};
84
+ }
85
+ catch (err) {
86
+ return {
87
+ httpStatus: 400,
88
+ response: "Invalid payload JSON",
89
+ success: false,
90
+ };
91
+ }
76
92
  if (!((_a = url === null || url === void 0 ? void 0 : url.trim()) === null || _a === void 0 ? void 0 : _a.length)) {
77
93
  return {
78
94
  httpStatus: 400,
@@ -86,14 +102,11 @@ function run({ inputs }) {
86
102
  try {
87
103
  response = yield (0, node_fetch_1.default)(url, {
88
104
  method: "post",
89
- body: JSON.stringify({
90
- platform: "budibase",
91
- value1,
105
+ body: JSON.stringify(Object.assign({ platform: "budibase", value1,
92
106
  value2,
93
107
  value3,
94
108
  value4,
95
- value5,
96
- }),
109
+ value5 }, payload)),
97
110
  headers: {
98
111
  "Content-Type": "application/json",
99
112
  },
@@ -382,7 +382,20 @@ class GoogleSheetsIntegration {
382
382
  try {
383
383
  yield this.connect();
384
384
  const sheet = this.client.sheetsByTitle[query.sheet];
385
- const rows = yield sheet.getRows();
385
+ let rows = [];
386
+ if (query.paginate) {
387
+ const limit = query.paginate.limit || 100;
388
+ let page = typeof query.paginate.page === "number"
389
+ ? query.paginate.page
390
+ : parseInt(query.paginate.page || "1");
391
+ rows = yield sheet.getRows({
392
+ limit,
393
+ offset: (page - 1) * limit,
394
+ });
395
+ }
396
+ else {
397
+ rows = yield sheet.getRows();
398
+ }
386
399
  const filtered = shared_core_1.dataFilters.runLuceneQuery(rows, query.filters);
387
400
  const headerValues = sheet.headerValues;
388
401
  let response = [];