From c91c766b12f20e2f6e16581991540c10cbec6b89 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Mon, 11 Jul 2022 07:04:55 -0700 Subject: [PATCH] FlipperServer new plugin marketplace methods Summary: Expose two new methods as to be able to: - List plugins from marketplace - Install a plugin from marketplace Reviewed By: passy Differential Revision: D37749817 fbshipit-source-id: 82b78f7906c5664d5747289fa4f8eadebcde1d73 --- desktop/flipper-common/src/server-types.tsx | 5 +++++ desktop/flipper-server-core/src/FlipperServerImpl.tsx | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/desktop/flipper-common/src/server-types.tsx b/desktop/flipper-common/src/server-types.tsx index 53725bc93..04c63e689 100644 --- a/desktop/flipper-common/src/server-types.tsx +++ b/desktop/flipper-common/src/server-types.tsx @@ -14,6 +14,7 @@ import { DeviceType, DownloadablePluginDetails, InstalledPluginDetails, + MarketplacePluginDetails, OS as PluginOS, UpdatablePluginDetails, } from './PluginDetails'; @@ -252,6 +253,7 @@ export type FlipperServerCommands = { 'keychain-read': (service: string) => Promise; 'keychain-unset': (service: string) => Promise; 'plugins-load-dynamic-plugins': () => Promise; + 'plugins-load-marketplace-plugins': () => Promise; 'plugins-get-bundled-plugins': () => Promise; 'plugins-get-installed-plugins': () => Promise; 'plugins-get-updatable-plugins': ( @@ -261,6 +263,9 @@ export type FlipperServerCommands = { plugin: DownloadablePluginDetails, ) => Promise; 'plugin-source': (path: string) => Promise; + 'plugins-install-from-marketplace': ( + name: string, + ) => Promise; 'plugins-install-from-npm': (name: string) => Promise; 'plugins-install-from-file': ( path: string, diff --git a/desktop/flipper-server-core/src/FlipperServerImpl.tsx b/desktop/flipper-server-core/src/FlipperServerImpl.tsx index 09e810e45..b2a03761b 100644 --- a/desktop/flipper-server-core/src/FlipperServerImpl.tsx +++ b/desktop/flipper-server-core/src/FlipperServerImpl.tsx @@ -426,6 +426,8 @@ export class FlipperServerImpl implements FlipperServer { 'keychain-unset': (service) => this.keytarManager.unsetKeychain(service), 'plugins-load-dynamic-plugins': () => this.pluginManager.loadDynamicPlugins(), + 'plugins-load-marketplace-plugins': () => + this.pluginManager.loadMarketplacePlugins(), 'plugins-get-bundled-plugins': () => this.pluginManager.getBundledPlugins(), 'plugins-get-installed-plugins': () => this.pluginManager.getInstalledPlugins(), @@ -437,6 +439,8 @@ export class FlipperServerImpl implements FlipperServer { this.pluginManager.getUpdatablePlugins(query), 'plugins-install-from-file': (path) => this.pluginManager.installPluginFromFile(path), + 'plugins-install-from-marketplace': (name: string) => + this.pluginManager.installPluginForMarketplace(name), 'plugins-install-from-npm': (name) => this.pluginManager.installPluginFromNpm(name), 'plugin-source': (path) => this.pluginManager.loadSource(path),