@budibase/server 2.1.14-alpha.1 → 2.1.14
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/__mocks__/aws-sdk.ts +0 -14
- package/builder/assets/{index.2b55d764.js → index.bc9920b1.js} +3 -3
- package/builder/index.html +1 -1
- package/coverage/clover.xml +6 -6
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +15 -15
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +10 -10
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +1 -1
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/plugins.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +4 -4
- package/dist/api/controllers/row/ExternalRequest.js +1 -6
- package/dist/api/controllers/row/index.js +7 -16
- package/dist/integrations/elasticsearch.js +2 -26
- package/dist/integrations/s3.js +1 -157
- package/dist/package.json +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/api/controllers/row/ExternalRequest.ts +3 -5
- package/src/api/controllers/row/index.ts +9 -17
- package/src/integrations/elasticsearch.ts +2 -32
- package/src/integrations/s3.ts +3 -179
- package/src/integrations/tests/s3.spec.ts +1 -85
package/dist/integrations/s3.js
CHANGED
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const types_1 = require("@budibase/types");
|
|
13
13
|
const AWS = require("aws-sdk");
|
|
14
|
-
const csv = require("csvtojson");
|
|
15
14
|
const SCHEMA = {
|
|
16
15
|
docs: "https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html",
|
|
17
16
|
description: "Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
|
|
@@ -42,106 +41,16 @@ const SCHEMA = {
|
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
query: {
|
|
45
|
-
create: {
|
|
46
|
-
type: types_1.QueryType.FIELDS,
|
|
47
|
-
fields: {
|
|
48
|
-
bucket: {
|
|
49
|
-
display: "New Bucket",
|
|
50
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
51
|
-
required: true,
|
|
52
|
-
},
|
|
53
|
-
location: {
|
|
54
|
-
required: true,
|
|
55
|
-
default: "us-east-1",
|
|
56
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
57
|
-
},
|
|
58
|
-
grantFullControl: {
|
|
59
|
-
display: "Grant full control",
|
|
60
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
61
|
-
},
|
|
62
|
-
grantRead: {
|
|
63
|
-
display: "Grant read",
|
|
64
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
65
|
-
},
|
|
66
|
-
grantReadAcp: {
|
|
67
|
-
display: "Grant read ACP",
|
|
68
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
69
|
-
},
|
|
70
|
-
grantWrite: {
|
|
71
|
-
display: "Grant write",
|
|
72
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
73
|
-
},
|
|
74
|
-
grantWriteAcp: {
|
|
75
|
-
display: "Grant write ACP",
|
|
76
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
44
|
read: {
|
|
81
45
|
type: types_1.QueryType.FIELDS,
|
|
82
46
|
fields: {
|
|
83
47
|
bucket: {
|
|
84
|
-
type:
|
|
85
|
-
required: true,
|
|
86
|
-
},
|
|
87
|
-
delimiter: {
|
|
88
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
89
|
-
},
|
|
90
|
-
marker: {
|
|
91
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
92
|
-
},
|
|
93
|
-
maxKeys: {
|
|
94
|
-
type: types_1.DatasourceFieldType.NUMBER,
|
|
95
|
-
display: "Max Keys",
|
|
96
|
-
},
|
|
97
|
-
prefix: {
|
|
98
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
readCsv: {
|
|
103
|
-
displayName: "Read CSV",
|
|
104
|
-
type: types_1.QueryType.FIELDS,
|
|
105
|
-
fields: {
|
|
106
|
-
bucket: {
|
|
107
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
108
|
-
required: true,
|
|
109
|
-
},
|
|
110
|
-
key: {
|
|
111
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
112
|
-
required: true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
delete: {
|
|
117
|
-
type: types_1.QueryType.FIELDS,
|
|
118
|
-
fields: {
|
|
119
|
-
bucket: {
|
|
120
|
-
type: types_1.DatasourceFieldType.STRING,
|
|
121
|
-
required: true,
|
|
122
|
-
},
|
|
123
|
-
delete: {
|
|
124
|
-
type: types_1.DatasourceFieldType.JSON,
|
|
48
|
+
type: "string",
|
|
125
49
|
required: true,
|
|
126
50
|
},
|
|
127
51
|
},
|
|
128
52
|
},
|
|
129
53
|
},
|
|
130
|
-
extra: {
|
|
131
|
-
acl: {
|
|
132
|
-
required: false,
|
|
133
|
-
displayName: "ACL",
|
|
134
|
-
type: types_1.DatasourceFieldType.LIST,
|
|
135
|
-
data: {
|
|
136
|
-
create: [
|
|
137
|
-
"private",
|
|
138
|
-
"public-read",
|
|
139
|
-
"public-read-write",
|
|
140
|
-
"authenticated-read",
|
|
141
|
-
],
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
54
|
};
|
|
146
55
|
class S3Integration {
|
|
147
56
|
constructor(config) {
|
|
@@ -154,81 +63,16 @@ class S3Integration {
|
|
|
154
63
|
}
|
|
155
64
|
this.client = new AWS.S3(this.config);
|
|
156
65
|
}
|
|
157
|
-
create(query) {
|
|
158
|
-
var _a;
|
|
159
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
let params = {
|
|
161
|
-
Bucket: query.bucket,
|
|
162
|
-
ACL: (_a = query.extra) === null || _a === void 0 ? void 0 : _a.acl,
|
|
163
|
-
GrantFullControl: query.grantFullControl,
|
|
164
|
-
GrantRead: query.grantRead,
|
|
165
|
-
GrantReadACP: query.grantReadAcp,
|
|
166
|
-
GrantWrite: query.grantWrite,
|
|
167
|
-
GrantWriteACP: query.grantWriteAcp,
|
|
168
|
-
};
|
|
169
|
-
if (query.location) {
|
|
170
|
-
params["CreateBucketConfiguration"] = {
|
|
171
|
-
LocationConstraint: query.location,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
return yield this.client.createBucket(params).promise();
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
66
|
read(query) {
|
|
178
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
68
|
const response = yield this.client
|
|
180
69
|
.listObjects({
|
|
181
70
|
Bucket: query.bucket,
|
|
182
|
-
Delimiter: query.delimiter,
|
|
183
|
-
Marker: query.marker,
|
|
184
|
-
MaxKeys: query.maxKeys,
|
|
185
|
-
Prefix: query.prefix,
|
|
186
71
|
})
|
|
187
72
|
.promise();
|
|
188
73
|
return response.Contents;
|
|
189
74
|
});
|
|
190
75
|
}
|
|
191
|
-
readCsv(query) {
|
|
192
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
const stream = this.client
|
|
194
|
-
.getObject({
|
|
195
|
-
Bucket: query.bucket,
|
|
196
|
-
Key: query.key,
|
|
197
|
-
})
|
|
198
|
-
.createReadStream();
|
|
199
|
-
let csvError = false;
|
|
200
|
-
return new Promise((resolve, reject) => {
|
|
201
|
-
stream.on("error", (err) => {
|
|
202
|
-
reject(err);
|
|
203
|
-
});
|
|
204
|
-
const response = csv()
|
|
205
|
-
.fromStream(stream)
|
|
206
|
-
.on("error", () => {
|
|
207
|
-
csvError = true;
|
|
208
|
-
});
|
|
209
|
-
stream.on("finish", () => {
|
|
210
|
-
resolve(response);
|
|
211
|
-
});
|
|
212
|
-
}).catch(err => {
|
|
213
|
-
if (csvError) {
|
|
214
|
-
throw new Error("Could not read CSV");
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
throw err;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
delete(query) {
|
|
223
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
-
return yield this.client
|
|
225
|
-
.deleteObjects({
|
|
226
|
-
Bucket: query.bucket,
|
|
227
|
-
Delete: JSON.parse(query.delete),
|
|
228
|
-
})
|
|
229
|
-
.promise();
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
76
|
}
|
|
233
77
|
exports.default = {
|
|
234
78
|
schema: SCHEMA,
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.13",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"license": "GPL-3.0",
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
80
|
-
"@budibase/backend-core": "2.1.
|
|
81
|
-
"@budibase/client": "2.1.
|
|
82
|
-
"@budibase/pro": "2.1.
|
|
83
|
-
"@budibase/string-templates": "2.1.
|
|
84
|
-
"@budibase/types": "2.1.
|
|
80
|
+
"@budibase/backend-core": "^2.1.13",
|
|
81
|
+
"@budibase/client": "^2.1.13",
|
|
82
|
+
"@budibase/pro": "2.1.13",
|
|
83
|
+
"@budibase/string-templates": "^2.1.13",
|
|
84
|
+
"@budibase/types": "^2.1.13",
|
|
85
85
|
"@bull-board/api": "3.7.0",
|
|
86
86
|
"@bull-board/koa": "3.9.4",
|
|
87
87
|
"@elastic/elasticsearch": "7.10.0",
|