2022-08-13 04:03:06 +12:00
|
|
|
const { getDefinitions } = require("../../integrations")
|
2022-08-12 00:50:05 +12:00
|
|
|
const { SourceName } = require("@budibase/types")
|
2022-03-29 04:44:33 +13:00
|
|
|
const googlesheets = require("../../integrations/googlesheets")
|
2022-05-05 20:59:10 +12:00
|
|
|
const { featureFlags } = require("@budibase/backend-core")
|
2020-11-27 03:43:56 +13:00
|
|
|
|
2021-05-03 19:31:09 +12:00
|
|
|
exports.fetch = async function (ctx) {
|
2020-11-27 03:43:56 +13:00
|
|
|
ctx.status = 200
|
2022-08-13 04:03:06 +12:00
|
|
|
const defs = await getDefinitions()
|
2022-03-29 04:44:33 +13:00
|
|
|
|
|
|
|
// for google sheets integration google verification
|
2022-05-05 20:59:10 +12:00
|
|
|
if (featureFlags.isEnabled(featureFlags.FeatureFlag.GOOGLE_SHEETS)) {
|
2022-08-12 00:50:05 +12:00
|
|
|
defs[SourceName.GOOGLE_SHEETS] = googlesheets.schema
|
2022-03-29 04:44:33 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
ctx.body = defs
|
2020-11-27 03:43:56 +13:00
|
|
|
}
|
2020-12-19 07:19:43 +13:00
|
|
|
|
2021-05-03 19:31:09 +12:00
|
|
|
exports.find = async function (ctx) {
|
2022-08-13 04:03:06 +12:00
|
|
|
const defs = await getDefinitions()
|
2020-12-19 07:19:43 +13:00
|
|
|
ctx.status = 200
|
2022-08-13 04:03:06 +12:00
|
|
|
ctx.body = defs[ctx.params.type]
|
2020-12-19 07:19:43 +13:00
|
|
|
}
|