1
0
Fork 0
mirror of synced 2024-06-17 09:55:09 +12:00

Merge pull request #7764 from Budibase/cloud-component-plugins

Allow component plugins in cloud
This commit is contained in:
Andrew Kingston 2022-09-14 10:42:10 +01:00 committed by GitHub
commit 7314790839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,10 +197,12 @@ export async function storePlugin(
}
export async function processPlugin(plugin: FileType, source?: string) {
if (!env.SELF_HOSTED) {
throw new Error("Plugins not supported outside of self-host.")
const { metadata, directory } = await fileUpload(plugin)
// Only allow components in cloud
if (!env.SELF_HOSTED && metadata?.schema?.type !== PluginType.COMPONENT) {
throw new Error("Only component plugins are supported outside of self-host")
}
const { metadata, directory } = await fileUpload(plugin)
return await storePlugin(metadata, directory, source)
}