@budibase/server 1.0.98-alpha.3 → 1.0.98-alpha.4
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.64ecb83d.css → index.d806d82f.css} +1 -1
- package/builder/assets/{index.47d835a9.js → index.e9a4893f.js} +156 -156
- package/builder/index.html +2 -2
- package/coverage/clover.xml +18 -7
- package/coverage/coverage-final.json +1 -1
- 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 +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 +16 -16
- package/coverage/lcov-report/api/controllers/integration.js.html +59 -11
- 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/index.js.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/index.js.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/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 +1 -1
- 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 +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/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 +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/authorized.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/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 +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/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 +23 -8
- package/dist/api/controllers/integration.js +15 -1
- package/dist/environment.js +2 -0
- package/dist/integrations/googlesheets.js +17 -1
- package/dist/integrations/index.js +1 -1
- package/dist/package.json +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/api/controllers/integration.js +17 -1
- package/src/environment.js +2 -0
- package/src/integrations/googlesheets.ts +16 -1
- package/src/integrations/index.ts +1 -1
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.98-alpha.
|
|
4
|
+
"version": "1.0.98-alpha.4",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"license": "GPL-3.0",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@apidevtools/swagger-parser": "^10.0.3",
|
|
71
|
-
"@budibase/backend-core": "^1.0.98-alpha.
|
|
72
|
-
"@budibase/client": "^1.0.98-alpha.
|
|
73
|
-
"@budibase/string-templates": "^1.0.98-alpha.
|
|
71
|
+
"@budibase/backend-core": "^1.0.98-alpha.4",
|
|
72
|
+
"@budibase/client": "^1.0.98-alpha.4",
|
|
73
|
+
"@budibase/string-templates": "^1.0.98-alpha.4",
|
|
74
74
|
"@bull-board/api": "^3.7.0",
|
|
75
75
|
"@bull-board/koa": "^3.7.0",
|
|
76
76
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"optionalDependencies": {
|
|
175
175
|
"oracledb": "^5.3.0"
|
|
176
176
|
},
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "a7ad4837b2dfdb27814978846e2b5dfc33b3c328"
|
|
178
178
|
}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
+
const { cloneDeep } = require("lodash")
|
|
1
2
|
const { definitions } = require("../../integrations")
|
|
3
|
+
const { getTenantId } = require("@budibase/backend-core/tenancy")
|
|
4
|
+
const { SourceNames } = require("../../definitions/datasource")
|
|
5
|
+
const googlesheets = require("../../integrations/googlesheets")
|
|
6
|
+
const env = require("../../environment")
|
|
2
7
|
|
|
3
8
|
exports.fetch = async function (ctx) {
|
|
4
9
|
ctx.status = 200
|
|
5
|
-
|
|
10
|
+
const defs = cloneDeep(definitions)
|
|
11
|
+
|
|
12
|
+
// for google sheets integration google verification
|
|
13
|
+
if (env.EXCLUDE_QUOTAS_TENANTS) {
|
|
14
|
+
const excludedTenants = env.EXCLUDE_QUOTAS_TENANTS.split(",")
|
|
15
|
+
const tenantId = getTenantId()
|
|
16
|
+
if (excludedTenants.includes(tenantId)) {
|
|
17
|
+
defs[SourceNames.GOOGLE_SHEETS] = googlesheets.schema
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ctx.body = defs
|
|
6
22
|
}
|
|
7
23
|
|
|
8
24
|
exports.find = async function (ctx) {
|
package/src/environment.js
CHANGED
|
@@ -46,6 +46,8 @@ module.exports = {
|
|
|
46
46
|
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
|
47
47
|
HTTP_MIGRATIONS: process.env.HTTP_MIGRATIONS,
|
|
48
48
|
API_REQ_LIMIT_PER_SEC: process.env.API_REQ_LIMIT_PER_SEC,
|
|
49
|
+
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
|
|
50
|
+
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
|
|
49
51
|
// environment
|
|
50
52
|
NODE_ENV: process.env.NODE_ENV,
|
|
51
53
|
JEST_WORKER_ID: process.env.JEST_WORKER_ID,
|
|
@@ -10,6 +10,7 @@ import { Table, TableSchema } from "../definitions/common"
|
|
|
10
10
|
import { buildExternalTableId } from "./utils"
|
|
11
11
|
import { DataSourceOperation, FieldTypes } from "../constants"
|
|
12
12
|
import { GoogleSpreadsheet } from "google-spreadsheet"
|
|
13
|
+
import env from "../environment"
|
|
13
14
|
|
|
14
15
|
module GoogleSheetsModule {
|
|
15
16
|
const { getGlobalDB } = require("@budibase/backend-core/tenancy")
|
|
@@ -138,13 +139,27 @@ module GoogleSheetsModule {
|
|
|
138
139
|
try {
|
|
139
140
|
// Initialise oAuth client
|
|
140
141
|
const db = getGlobalDB()
|
|
141
|
-
|
|
142
|
+
let googleConfig = await getScopedConfig(db, {
|
|
142
143
|
type: Configs.GOOGLE,
|
|
143
144
|
})
|
|
145
|
+
|
|
146
|
+
if (!googleConfig) {
|
|
147
|
+
googleConfig = {
|
|
148
|
+
clientID: env.GOOGLE_CLIENT_ID,
|
|
149
|
+
clientSecret: env.GOOGLE_CLIENT_SECRET,
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
const oauthClient = new OAuth2Client({
|
|
145
154
|
clientId: googleConfig.clientID,
|
|
146
155
|
clientSecret: googleConfig.clientSecret,
|
|
147
156
|
})
|
|
157
|
+
oauthClient.on("tokens", tokens => {
|
|
158
|
+
oauthClient.setCredentials({
|
|
159
|
+
refresh_token: googleConfig.refreshToken,
|
|
160
|
+
access_token: tokens.access_token,
|
|
161
|
+
})
|
|
162
|
+
})
|
|
148
163
|
oauthClient.credentials.access_token = this.config.auth.accessToken
|
|
149
164
|
oauthClient.credentials.refresh_token = this.config.auth.refreshToken
|
|
150
165
|
this.client.useOAuth2Client(oauthClient)
|
|
@@ -42,6 +42,7 @@ const INTEGRATIONS = {
|
|
|
42
42
|
[SourceNames.ARANGODB]: arangodb.integration,
|
|
43
43
|
[SourceNames.REST]: rest.integration,
|
|
44
44
|
[SourceNames.FIREBASE]: firebase.integration,
|
|
45
|
+
[SourceNames.GOOGLE_SHEETS]: googlesheets.integration,
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// optionally add oracle integration if the oracle binary can be installed
|
|
@@ -53,7 +54,6 @@ if (!(process.arch === "arm64" && process.platform === "darwin")) {
|
|
|
53
54
|
|
|
54
55
|
if (environment.SELF_HOSTED) {
|
|
55
56
|
DEFINITIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.schema
|
|
56
|
-
INTEGRATIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.integration
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
module.exports = {
|