From e1bc10471505fc5bafd867f16d7e81962385dfa3 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 10 Feb 2022 11:34:50 +0100 Subject: [PATCH] only show gsheets in self host --- packages/server/src/api/controllers/integration.js | 1 - packages/server/src/integrations/index.ts | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/integration.js b/packages/server/src/api/controllers/integration.js index f1aafe7e45..75fd9ce80e 100644 --- a/packages/server/src/api/controllers/integration.js +++ b/packages/server/src/api/controllers/integration.js @@ -1,7 +1,6 @@ const { definitions } = require("../../integrations") exports.fetch = async function (ctx) { - // TODO: fetch these from a github repo etc ctx.status = 200 ctx.body = definitions } diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 4679e658b6..00b00c25fb 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -11,6 +11,7 @@ const arangodb = require("./arangodb") const rest = require("./rest") const googlesheets = require("./googlesheets") const { SourceNames } = require("../definitions/datasource") +const environment = require("../environment") const DEFINITIONS = { [SourceNames.POSTGRES]: postgres.schema, @@ -24,7 +25,6 @@ const DEFINITIONS = { [SourceNames.MYSQL]: mysql.schema, [SourceNames.ARANGODB]: arangodb.schema, [SourceNames.REST]: rest.schema, - [SourceNames.GOOGLE_SHEETS]: googlesheets.schema, } const INTEGRATIONS = { @@ -39,7 +39,6 @@ const INTEGRATIONS = { [SourceNames.MYSQL]: mysql.integration, [SourceNames.ARANGODB]: arangodb.integration, [SourceNames.REST]: rest.integration, - [SourceNames.GOOGLE_SHEETS]: googlesheets.integration, } // optionally add oracle integration if the oracle binary can be installed @@ -49,6 +48,11 @@ if (!(process.arch === "arm64" && process.platform === "darwin")) { INTEGRATIONS[SourceNames.ORACLE] = oracle.integration } +if (environment.SELF_HOSTED) { + DEFINITIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.schema + INTEGRATIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.integration +} + module.exports = { definitions: DEFINITIONS, integrations: INTEGRATIONS,