@budibase/server 2.0.40-alpha.3 → 2.1.0
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.3fa5bfe2.js → index.96455608.js} +3 -3
- package/builder/index.html +1 -1
- package/coverage/clover.xml +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/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/integrations/elasticsearch.ts +2 -32
- package/src/integrations/s3.ts +3 -179
- package/src/integrations/tests/s3.spec.ts +1 -85
|
@@ -142,7 +142,7 @@ module.exports = ScriptRunner
|
|
|
142
142
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
143
143
|
Code coverage generated by
|
|
144
144
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
145
|
-
at Tue Nov 01 2022
|
|
145
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
146
146
|
</div>
|
|
147
147
|
<script src="../prettify.js"></script>
|
|
148
148
|
<script>
|
|
@@ -283,7 +283,7 @@ exports.CURRENTLY_SUPPORTED_LEVELS = CURRENTLY_SUPPORTED_LEVELS
|
|
|
283
283
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
284
284
|
Code coverage generated by
|
|
285
285
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
286
|
-
at Tue Nov 01 2022
|
|
286
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
287
287
|
</div>
|
|
288
288
|
<script src="../prettify.js"></script>
|
|
289
289
|
<script>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
92
92
|
Code coverage generated by
|
|
93
93
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
94
|
-
at Tue Nov 01 2022
|
|
94
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../prettify.js"></script>
|
|
97
97
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at Tue Nov 01 2022
|
|
119
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -322,7 +322,7 @@ exports.getUniqueRows = async appIds => {
|
|
|
322
322
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
323
323
|
Code coverage generated by
|
|
324
324
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
325
|
-
at Tue Nov 01 2022
|
|
325
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
326
326
|
</div>
|
|
327
327
|
<script src="../../prettify.js"></script>
|
|
328
328
|
<script>
|
|
@@ -124,7 +124,7 @@ function <span class="fstat-no" title="function not covered" >resetQuotasIfRequi
|
|
|
124
124
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
125
125
|
Code coverage generated by
|
|
126
126
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
127
|
-
at Tue Nov 01 2022
|
|
127
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
128
128
|
</div>
|
|
129
129
|
<script src="../../prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -223,7 +223,7 @@ exports.publicApiUserFix = ctx => {
|
|
|
223
223
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
224
224
|
Code coverage generated by
|
|
225
225
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
226
|
-
at Tue Nov 01 2022
|
|
226
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
227
227
|
</div>
|
|
228
228
|
<script src="../prettify.js"></script>
|
|
229
229
|
<script>
|
|
@@ -589,7 +589,7 @@ exports.generateApiKey = <span class="fstat-no" title="function not covered" >as
|
|
|
589
589
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
590
590
|
Code coverage generated by
|
|
591
591
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
592
|
-
at Tue Nov 01 2022
|
|
592
|
+
at Tue Nov 01 2022 08:30:09 GMT+0000 (Coordinated Universal Time)
|
|
593
593
|
</div>
|
|
594
594
|
<script src="../prettify.js"></script>
|
|
595
595
|
<script>
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const types_1 = require("@budibase/types");
|
|
13
|
-
const
|
|
13
|
+
const { Client } = require("@elastic/elasticsearch");
|
|
14
14
|
const SCHEMA = {
|
|
15
15
|
docs: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
|
16
16
|
description: "Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.",
|
|
@@ -22,21 +22,6 @@ const SCHEMA = {
|
|
|
22
22
|
required: true,
|
|
23
23
|
default: "http://localhost:9200",
|
|
24
24
|
},
|
|
25
|
-
ssl: {
|
|
26
|
-
type: types_1.DatasourceFieldType.BOOLEAN,
|
|
27
|
-
default: false,
|
|
28
|
-
required: false,
|
|
29
|
-
},
|
|
30
|
-
rejectUnauthorized: {
|
|
31
|
-
type: types_1.DatasourceFieldType.BOOLEAN,
|
|
32
|
-
default: true,
|
|
33
|
-
required: false,
|
|
34
|
-
},
|
|
35
|
-
ca: {
|
|
36
|
-
type: types_1.DatasourceFieldType.LONGFORM,
|
|
37
|
-
default: false,
|
|
38
|
-
required: false,
|
|
39
|
-
},
|
|
40
25
|
},
|
|
41
26
|
query: {
|
|
42
27
|
create: {
|
|
@@ -91,16 +76,7 @@ const SCHEMA = {
|
|
|
91
76
|
class ElasticSearchIntegration {
|
|
92
77
|
constructor(config) {
|
|
93
78
|
this.config = config;
|
|
94
|
-
|
|
95
|
-
node: this.config.url,
|
|
96
|
-
};
|
|
97
|
-
if (this.config.ssl) {
|
|
98
|
-
clientConfig.ssl = {
|
|
99
|
-
rejectUnauthorized: this.config.rejectUnauthorized,
|
|
100
|
-
ca: this.config.ca || undefined,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
this.client = new elasticsearch_1.Client(clientConfig);
|
|
79
|
+
this.client = new Client({ node: config.url });
|
|
104
80
|
}
|
|
105
81
|
create(query) {
|
|
106
82
|
return __awaiter(this, void 0, void 0, function* () {
|
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.0.40
|
|
4
|
+
"version": "2.0.40",
|
|
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.0.40
|
|
81
|
-
"@budibase/client": "2.0.40
|
|
82
|
-
"@budibase/pro": "2.0.40
|
|
83
|
-
"@budibase/string-templates": "2.0.40
|
|
84
|
-
"@budibase/types": "2.0.40
|
|
80
|
+
"@budibase/backend-core": "^2.0.40",
|
|
81
|
+
"@budibase/client": "^2.0.40",
|
|
82
|
+
"@budibase/pro": "2.0.40",
|
|
83
|
+
"@budibase/string-templates": "^2.0.40",
|
|
84
|
+
"@budibase/types": "^2.0.40",
|
|
85
85
|
"@bull-board/api": "3.7.0",
|
|
86
86
|
"@bull-board/koa": "3.9.4",
|
|
87
87
|
"@elastic/elasticsearch": "7.10.0",
|