@budibase/server 1.0.98-alpha.3 → 1.0.99
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/builder/assets/index.44b5c19a.js +1291 -0
- package/builder/assets/{index.64ecb83d.css → index.7c8961b4.css} +1 -1
- package/builder/assets/{vendor.8e34a169.js → vendor.a7c6ad0a.js} +1 -1
- package/builder/index.html +3 -3
- package/coverage/clover.xml +282 -277
- package/coverage/coverage-final.json +13 -13
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/application.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +4 -4
- 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 +5 -5
- 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 +7 -7
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +2 -2
- 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 +10 -10
- package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +7 -19
- 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 +6 -6
- package/coverage/lcov-report/api/controllers/screen.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/table/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/utils.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/controllers/webhook.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 +3 -3
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/application.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.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/index.js.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/row.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/static.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +2 -2
- 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/api/routes/webhook.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/createRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.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/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/automations/utils.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/client.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 +10 -10
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +7 -7
- package/coverage/lcov-report/db/newid.js.html +2 -2
- package/coverage/lcov-report/db/utils.js.html +2 -2
- 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 +21 -21
- 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/authorized.js.html +75 -15
- 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 +15 -15
- 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/usageQuota.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1 -1
- package/coverage/lcov-report/threads/index.html +1 -1
- package/coverage/lcov-report/threads/index.js.html +1 -1
- package/coverage/lcov-report/threads/query.js.html +1 -1
- package/coverage/lcov-report/threads/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/bcrypt.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/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 +12 -12
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +8 -8
- 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/index.js.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 +459 -440
- package/dist/api/controllers/permission.js +3 -4
- package/dist/api/controllers/query/import/index.js +1 -2
- package/dist/api/controllers/query/import/sources/base/index.js +1 -12
- package/dist/api/controllers/query/import/sources/curl.js +2 -2
- package/dist/api/controllers/row/internal.js +1 -2
- package/dist/api/routes/analytics.js +2 -2
- package/dist/api/routes/table.js +1 -1
- package/dist/definitions/datasource.js +0 -1
- package/dist/integrations/base/sql.js +9 -16
- package/dist/integrations/dynamodb.js +1 -3
- package/dist/integrations/index.js +0 -3
- package/dist/integrations/rest.js +1 -2
- package/dist/middleware/authorized.js +24 -7
- package/dist/package.json +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -8
- package/scripts/dev/manage.js +1 -2
- package/specs/openapi.json +23 -3
- package/specs/openapi.yaml +20 -4
- package/specs/resources/query.js +27 -5
- package/src/api/controllers/permission.js +3 -3
- package/src/api/controllers/query/import/index.ts +1 -2
- package/src/api/controllers/query/import/sources/base/index.ts +2 -12
- package/src/api/controllers/query/import/sources/curl.ts +2 -2
- package/src/api/controllers/query/import/tests/index.spec.js +0 -43
- package/src/api/controllers/row/internal.js +1 -5
- package/src/api/routes/analytics.js +2 -2
- package/src/api/routes/table.js +1 -1
- package/src/api/routes/tests/misc.spec.js +2 -2
- package/src/definitions/datasource.ts +0 -1
- package/src/definitions/openapi.ts +483 -473
- package/src/integrations/base/sql.ts +9 -14
- package/src/integrations/dynamodb.ts +1 -3
- package/src/integrations/index.ts +0 -3
- package/src/integrations/rest.ts +1 -2
- package/src/integrations/tests/sql.spec.js +0 -51
- package/src/middleware/authorized.js +26 -6
- package/builder/assets/index.47d835a9.js +0 -1292
- package/dist/api/controllers/query/import/sources/openapi3.js +0 -174
- package/dist/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +0 -253
- package/dist/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +0 -1225
- package/dist/integrations/firebase.js +0 -192
- package/src/api/controllers/query/import/sources/openapi3.ts +0 -205
- package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +0 -253
- package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.yaml +0 -153
- package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +0 -1225
- package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.yaml +0 -804
- package/src/api/controllers/query/import/sources/tests/openapi3/openapi3.spec.js +0 -240
- package/src/integrations/firebase.ts +0 -205
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.99",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -68,13 +68,12 @@
|
|
|
68
68
|
"license": "GPL-3.0",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@apidevtools/swagger-parser": "^10.0.3",
|
|
71
|
-
"@budibase/backend-core": "^1.0.
|
|
72
|
-
"@budibase/client": "^1.0.
|
|
73
|
-
"@budibase/string-templates": "^1.0.
|
|
71
|
+
"@budibase/backend-core": "^1.0.99",
|
|
72
|
+
"@budibase/client": "^1.0.99",
|
|
73
|
+
"@budibase/string-templates": "^1.0.99",
|
|
74
74
|
"@bull-board/api": "^3.7.0",
|
|
75
75
|
"@bull-board/koa": "^3.7.0",
|
|
76
76
|
"@elastic/elasticsearch": "7.10.0",
|
|
77
|
-
"@google-cloud/firestore": "^5.0.2",
|
|
78
77
|
"@koa/router": "8.0.0",
|
|
79
78
|
"@sendgrid/mail": "7.1.1",
|
|
80
79
|
"@sentry/node": "^6.0.0",
|
|
@@ -146,7 +145,6 @@
|
|
|
146
145
|
"@types/jest": "^26.0.23",
|
|
147
146
|
"@types/koa": "^2.13.3",
|
|
148
147
|
"@types/koa-router": "^7.4.2",
|
|
149
|
-
"@types/lodash": "4.14.180",
|
|
150
148
|
"@types/node": "^15.12.4",
|
|
151
149
|
"@types/oracledb": "^5.2.1",
|
|
152
150
|
"@types/redis": "^4.0.11",
|
|
@@ -155,7 +153,6 @@
|
|
|
155
153
|
"copyfiles": "^2.4.1",
|
|
156
154
|
"docker-compose": "^0.23.6",
|
|
157
155
|
"eslint": "^6.8.0",
|
|
158
|
-
"is-wsl": "^2.2.0",
|
|
159
156
|
"jest": "^27.0.5",
|
|
160
157
|
"jest-openapi": "^0.14.2",
|
|
161
158
|
"nodemon": "^2.0.4",
|
|
@@ -174,5 +171,5 @@
|
|
|
174
171
|
"optionalDependencies": {
|
|
175
172
|
"oracledb": "^5.3.0"
|
|
176
173
|
},
|
|
177
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "c5880f9ec2a22c0a04388e3cd4727a19ad14bfd7"
|
|
178
175
|
}
|
package/scripts/dev/manage.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
const compose = require("docker-compose")
|
|
3
3
|
const path = require("path")
|
|
4
4
|
const fs = require("fs")
|
|
5
|
-
const isWsl = require("is-wsl")
|
|
6
5
|
const { processStringSync } = require("@budibase/string-templates")
|
|
7
6
|
|
|
8
7
|
function isLinux() {
|
|
9
|
-
return
|
|
8
|
+
return process.platform !== "darwin" && process.platform !== "win32"
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
// This script wraps docker-compose allowing you to manage your dev infrastructure with simple commands.
|
package/specs/openapi.json
CHANGED
|
@@ -1260,10 +1260,30 @@
|
|
|
1260
1260
|
]
|
|
1261
1261
|
},
|
|
1262
1262
|
"executeQuery": {
|
|
1263
|
-
"description": "The
|
|
1263
|
+
"description": "The parameters required for executing a query.",
|
|
1264
1264
|
"type": "object",
|
|
1265
|
-
"
|
|
1266
|
-
"
|
|
1265
|
+
"properties": {
|
|
1266
|
+
"parameters": {
|
|
1267
|
+
"type": "object",
|
|
1268
|
+
"description": "This contains the required parameters for the query, this depends on query type, setup and bindings.",
|
|
1269
|
+
"additionalProperties": {
|
|
1270
|
+
"description": "Key value properties of any type, depending on the query output schema."
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
"pagination": {
|
|
1274
|
+
"type": "object",
|
|
1275
|
+
"description": "For supported query types (currently on REST) pagination can be performed using these properties.",
|
|
1276
|
+
"properties": {
|
|
1277
|
+
"page": {
|
|
1278
|
+
"type": "string",
|
|
1279
|
+
"description": "The page which has been returned from a previous query."
|
|
1280
|
+
},
|
|
1281
|
+
"limit": {
|
|
1282
|
+
"type": "number",
|
|
1283
|
+
"description": "The number of rows to return per page."
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1267
1287
|
}
|
|
1268
1288
|
},
|
|
1269
1289
|
"executeQueryOutput": {
|
package/specs/openapi.yaml
CHANGED
|
@@ -951,11 +951,27 @@ components:
|
|
|
951
951
|
required:
|
|
952
952
|
- data
|
|
953
953
|
executeQuery:
|
|
954
|
-
description: The
|
|
955
|
-
this depends on query type, setup and bindings.
|
|
954
|
+
description: The parameters required for executing a query.
|
|
956
955
|
type: object
|
|
957
|
-
|
|
958
|
-
|
|
956
|
+
properties:
|
|
957
|
+
parameters:
|
|
958
|
+
type: object
|
|
959
|
+
description: This contains the required parameters for the query, this depends
|
|
960
|
+
on query type, setup and bindings.
|
|
961
|
+
additionalProperties:
|
|
962
|
+
description: Key value properties of any type, depending on the query output
|
|
963
|
+
schema.
|
|
964
|
+
pagination:
|
|
965
|
+
type: object
|
|
966
|
+
description: For supported query types (currently on REST) pagination can be
|
|
967
|
+
performed using these properties.
|
|
968
|
+
properties:
|
|
969
|
+
page:
|
|
970
|
+
type: string
|
|
971
|
+
description: The page which has been returned from a previous query.
|
|
972
|
+
limit:
|
|
973
|
+
type: number
|
|
974
|
+
description: The number of rows to return per page.
|
|
959
975
|
executeQueryOutput:
|
|
960
976
|
type: object
|
|
961
977
|
properties:
|
package/specs/resources/query.js
CHANGED
|
@@ -124,12 +124,34 @@ const querySchema = object(
|
|
|
124
124
|
)
|
|
125
125
|
|
|
126
126
|
const executeQuerySchema = {
|
|
127
|
-
description:
|
|
128
|
-
"The query body must contain the required parameters for the query, this depends on query type, setup and bindings.",
|
|
127
|
+
description: "The parameters required for executing a query.",
|
|
129
128
|
type: "object",
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
properties: {
|
|
130
|
+
parameters: {
|
|
131
|
+
type: "object",
|
|
132
|
+
description:
|
|
133
|
+
"This contains the required parameters for the query, this depends on query type, setup and bindings.",
|
|
134
|
+
additionalProperties: {
|
|
135
|
+
description:
|
|
136
|
+
"Key value properties of any type, depending on the query output schema.",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
pagination: {
|
|
140
|
+
type: "object",
|
|
141
|
+
description:
|
|
142
|
+
"For supported query types (currently on REST) pagination can be performed using these properties.",
|
|
143
|
+
properties: {
|
|
144
|
+
page: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description:
|
|
147
|
+
"The page which has been returned from a previous query.",
|
|
148
|
+
},
|
|
149
|
+
limit: {
|
|
150
|
+
type: "number",
|
|
151
|
+
description: "The number of rows to return per page.",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
133
155
|
},
|
|
134
156
|
}
|
|
135
157
|
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
getDBRoleID,
|
|
5
5
|
getExternalRoleID,
|
|
6
6
|
getBuiltinRoles,
|
|
7
|
+
checkForRoleResourceArray,
|
|
7
8
|
} = require("@budibase/backend-core/roles")
|
|
8
9
|
const { getRoleParams } = require("../../db/utils")
|
|
9
10
|
const {
|
|
@@ -144,12 +145,11 @@ exports.getResourcePerms = async function (ctx) {
|
|
|
144
145
|
for (let level of SUPPORTED_LEVELS) {
|
|
145
146
|
// update the various roleIds in the resource permissions
|
|
146
147
|
for (let role of roles) {
|
|
147
|
-
const rolePerms = role.permissions
|
|
148
|
+
const rolePerms = checkForRoleResourceArray(role.permissions, resourceId)
|
|
148
149
|
if (
|
|
149
150
|
rolePerms &&
|
|
150
151
|
rolePerms[resourceId] &&
|
|
151
|
-
|
|
152
|
-
rolePerms[resourceId].indexOf(level) !== -1)
|
|
152
|
+
rolePerms[resourceId].indexOf(level) !== -1
|
|
153
153
|
) {
|
|
154
154
|
permissions[level] = getExternalRoleID(role._id)
|
|
155
155
|
}
|
|
@@ -2,7 +2,6 @@ import { queryValidation } from "../validation"
|
|
|
2
2
|
import { generateQueryID } from "../../../../db/utils"
|
|
3
3
|
import { ImportInfo, ImportSource } from "./sources/base"
|
|
4
4
|
import { OpenAPI2 } from "./sources/openapi2"
|
|
5
|
-
import { OpenAPI3 } from "./sources/openapi3"
|
|
6
5
|
import { Query } from "./../../../../definitions/common"
|
|
7
6
|
import { Curl } from "./sources/curl"
|
|
8
7
|
// @ts-ignore
|
|
@@ -19,7 +18,7 @@ export class RestImporter {
|
|
|
19
18
|
|
|
20
19
|
constructor(data: string) {
|
|
21
20
|
this.data = data
|
|
22
|
-
this.sources = [new OpenAPI2(), new
|
|
21
|
+
this.sources = [new OpenAPI2(), new Curl()]
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
init = async () => {
|
|
@@ -23,7 +23,7 @@ export abstract class ImportSource {
|
|
|
23
23
|
name: string,
|
|
24
24
|
method: string,
|
|
25
25
|
path: string,
|
|
26
|
-
url: URL
|
|
26
|
+
url: URL,
|
|
27
27
|
queryString: string,
|
|
28
28
|
headers: object = {},
|
|
29
29
|
parameters: QueryParameter[] = [],
|
|
@@ -34,17 +34,7 @@ export abstract class ImportSource {
|
|
|
34
34
|
const transformer = "return data"
|
|
35
35
|
const schema = {}
|
|
36
36
|
path = this.processPath(path)
|
|
37
|
-
|
|
38
|
-
if (typeof url === "string") {
|
|
39
|
-
path = `${url}/${path}`
|
|
40
|
-
} else {
|
|
41
|
-
let href = url.href
|
|
42
|
-
if (href.endsWith("/")) {
|
|
43
|
-
href = href.slice(0, -1)
|
|
44
|
-
}
|
|
45
|
-
path = `${href}/${path}`
|
|
46
|
-
}
|
|
47
|
-
}
|
|
37
|
+
path = `${url.origin}/${path}`
|
|
48
38
|
queryString = this.processQuery(queryString)
|
|
49
39
|
const requestBody = JSON.stringify(body, null, 2)
|
|
50
40
|
|
|
@@ -74,7 +74,7 @@ export class Curl extends ImportSource {
|
|
|
74
74
|
getQueries = async (datasourceId: string): Promise<Query[]> => {
|
|
75
75
|
const url = this.getUrl()
|
|
76
76
|
const name = url.pathname
|
|
77
|
-
const path = url.
|
|
77
|
+
const path = url.pathname
|
|
78
78
|
const method = this.curl.method
|
|
79
79
|
const queryString = url.search
|
|
80
80
|
const headers = this.curl.headers
|
|
@@ -90,7 +90,7 @@ export class Curl extends ImportSource {
|
|
|
90
90
|
name,
|
|
91
91
|
method,
|
|
92
92
|
path,
|
|
93
|
-
|
|
93
|
+
url,
|
|
94
94
|
queryString,
|
|
95
95
|
headers,
|
|
96
96
|
[],
|
|
@@ -23,27 +23,14 @@ const oapi2CrudYaml = getData("openapi2/data/crud/crud.json")
|
|
|
23
23
|
const oapi2PetstoreJson = getData("openapi2/data/petstore/petstore.json")
|
|
24
24
|
const oapi2PetstoreYaml = getData("openapi2/data/petstore/petstore.json")
|
|
25
25
|
|
|
26
|
-
// openapi3
|
|
27
|
-
const oapi3CrudJson = getData("openapi3/data/crud/crud.json")
|
|
28
|
-
const oapi3CrudYaml = getData("openapi3/data/crud/crud.json")
|
|
29
|
-
const oapi3PetstoreJson = getData("openapi3/data/petstore/petstore.json")
|
|
30
|
-
const oapi3PetstoreYaml = getData("openapi3/data/petstore/petstore.json")
|
|
31
|
-
|
|
32
26
|
// curl
|
|
33
27
|
const curl = getData("curl/data/post.txt")
|
|
34
28
|
|
|
35
29
|
const datasets = {
|
|
36
|
-
// openapi2 (swagger)
|
|
37
30
|
oapi2CrudJson,
|
|
38
31
|
oapi2CrudYaml,
|
|
39
32
|
oapi2PetstoreJson,
|
|
40
33
|
oapi2PetstoreYaml,
|
|
41
|
-
// openapi3
|
|
42
|
-
oapi3CrudJson,
|
|
43
|
-
oapi3CrudYaml,
|
|
44
|
-
oapi3PetstoreJson,
|
|
45
|
-
oapi3PetstoreYaml,
|
|
46
|
-
// curl
|
|
47
34
|
curl
|
|
48
35
|
}
|
|
49
36
|
|
|
@@ -69,7 +56,6 @@ describe("Rest Importer", () => {
|
|
|
69
56
|
|
|
70
57
|
it("gets info", async () => {
|
|
71
58
|
const assertions = {
|
|
72
|
-
// openapi2 (swagger)
|
|
73
59
|
"oapi2CrudJson" : {
|
|
74
60
|
name: "CRUD",
|
|
75
61
|
},
|
|
@@ -82,20 +68,6 @@ describe("Rest Importer", () => {
|
|
|
82
68
|
"oapi2PetstoreYaml" :{
|
|
83
69
|
name: "Swagger Petstore",
|
|
84
70
|
},
|
|
85
|
-
// openapi3
|
|
86
|
-
"oapi3CrudJson" : {
|
|
87
|
-
name: "CRUD",
|
|
88
|
-
},
|
|
89
|
-
"oapi3CrudYaml" : {
|
|
90
|
-
name: "CRUD",
|
|
91
|
-
},
|
|
92
|
-
"oapi3PetstoreJson" : {
|
|
93
|
-
name: "Swagger Petstore - OpenAPI 3.0",
|
|
94
|
-
},
|
|
95
|
-
"oapi3PetstoreYaml" :{
|
|
96
|
-
name: "Swagger Petstore - OpenAPI 3.0",
|
|
97
|
-
},
|
|
98
|
-
// curl
|
|
99
71
|
"curl": {
|
|
100
72
|
name: "example.com",
|
|
101
73
|
}
|
|
@@ -117,7 +89,6 @@ describe("Rest Importer", () => {
|
|
|
117
89
|
// simple sanity assertions that the whole dataset
|
|
118
90
|
// makes it through the importer
|
|
119
91
|
const assertions = {
|
|
120
|
-
// openapi2 (swagger)
|
|
121
92
|
"oapi2CrudJson" : {
|
|
122
93
|
count: 6,
|
|
123
94
|
},
|
|
@@ -130,20 +101,6 @@ describe("Rest Importer", () => {
|
|
|
130
101
|
"oapi2PetstoreYaml" :{
|
|
131
102
|
count: 20,
|
|
132
103
|
},
|
|
133
|
-
// openapi3
|
|
134
|
-
"oapi3CrudJson" : {
|
|
135
|
-
count: 6,
|
|
136
|
-
},
|
|
137
|
-
"oapi3CrudYaml" :{
|
|
138
|
-
count: 6,
|
|
139
|
-
},
|
|
140
|
-
"oapi3PetstoreJson" : {
|
|
141
|
-
count: 19,
|
|
142
|
-
},
|
|
143
|
-
"oapi3PetstoreYaml" :{
|
|
144
|
-
count: 19,
|
|
145
|
-
},
|
|
146
|
-
// curl
|
|
147
104
|
"curl": {
|
|
148
105
|
count: 1
|
|
149
106
|
}
|
|
@@ -85,11 +85,7 @@ exports.patch = async ctx => {
|
|
|
85
85
|
const isUserTable = tableId === InternalTables.USER_METADATA
|
|
86
86
|
let oldRow
|
|
87
87
|
try {
|
|
88
|
-
|
|
89
|
-
oldRow = await outputProcessing(
|
|
90
|
-
dbTable,
|
|
91
|
-
await findRow(ctx, tableId, inputs._id)
|
|
92
|
-
)
|
|
88
|
+
oldRow = await db.get(inputs._id)
|
|
93
89
|
} catch (err) {
|
|
94
90
|
if (isUserTable) {
|
|
95
91
|
// don't include the rev, it'll be the global rev
|
|
@@ -4,7 +4,7 @@ const controller = require("../controllers/analytics")
|
|
|
4
4
|
const router = Router()
|
|
5
5
|
|
|
6
6
|
router
|
|
7
|
-
.get("/api/
|
|
8
|
-
.post("/api/
|
|
7
|
+
.get("/api/analytics", controller.isEnabled)
|
|
8
|
+
.post("/api/analytics/ping", controller.endUserPing)
|
|
9
9
|
|
|
10
10
|
module.exports = router
|
package/src/api/routes/table.js
CHANGED
|
@@ -11,10 +11,10 @@ describe("run misc tests", () => {
|
|
|
11
11
|
await config.init()
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
describe("/
|
|
14
|
+
describe("/analytics", () => {
|
|
15
15
|
it("check if analytics enabled", async () => {
|
|
16
16
|
const res = await request
|
|
17
|
-
.get(`/api/
|
|
17
|
+
.get(`/api/analytics`)
|
|
18
18
|
.set(config.defaultHeaders())
|
|
19
19
|
.expect("Content-Type", /json/)
|
|
20
20
|
.expect(200)
|