Expose intern graphQL reuqests to plugins

Summary: Some intern plugins use it, an dit is currently missing in FlipperLib

Reviewed By: timur-valiev

Differential Revision: D36313032

fbshipit-source-id: 5ea8e250f1d0bc8831727abd883d953286a022d4
This commit is contained in:
Andrey Goncharov
2022-05-11 06:48:05 -07:00
committed by Facebook GitHub Bot
parent d0ccf51af6
commit ad76060614
4 changed files with 23 additions and 0 deletions

View File

@@ -45,6 +45,12 @@ export function baseFlipperLibImplementation(
environmentInfo: {
os: renderHost.serverConfig.environmentInfo.os,
},
intern: {
graphGet: (...args) =>
renderHost.flipperServer.exec('intern-graph-get', ...args),
graphPost: (...args) =>
renderHost.flipperServer.exec('intern-graph-post', ...args),
},
remoteServerContext: {
childProcess: {
exec: async (

View File

@@ -25,6 +25,7 @@ import {
fsConstants,
EnvironmentInfo,
FSStatsLike,
FlipperServerCommands,
} from 'flipper-common';
import {CreatePasteArgs, CreatePasteResult} from './Paste';
@@ -179,6 +180,12 @@ export interface FlipperLib {
os: EnvironmentInfo['os'];
};
remoteServerContext: RemoteServerContext;
intern: InternAPI;
}
interface InternAPI {
graphGet: FlipperServerCommands['intern-graph-get'];
graphPost: FlipperServerCommands['intern-graph-post'];
}
export let flipperLibInstance: FlipperLib | undefined;

View File

@@ -430,6 +430,10 @@ export function createMockFlipperLib(options?: StartPluginOptions): FlipperLib {
platform: 'linux',
},
},
intern: {
graphGet: createStubFunction(),
graphPost: createStubFunction(),
},
remoteServerContext: {
childProcess: {
exec: createStubFunction(),

View File

@@ -80,6 +80,12 @@ export function initializeFlipperLibImplementation(
environmentInfo: {
os: renderHost.serverConfig.environmentInfo.os,
},
intern: {
graphGet: (...args) =>
renderHost.flipperServer.exec('intern-graph-get', ...args),
graphPost: (...args) =>
renderHost.flipperServer.exec('intern-graph-post', ...args),
},
remoteServerContext: {
childProcess: {
exec: async (