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:
committed by
Facebook GitHub Bot
parent
d0ccf51af6
commit
ad76060614
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -430,6 +430,10 @@ export function createMockFlipperLib(options?: StartPluginOptions): FlipperLib {
|
||||
platform: 'linux',
|
||||
},
|
||||
},
|
||||
intern: {
|
||||
graphGet: createStubFunction(),
|
||||
graphPost: createStubFunction(),
|
||||
},
|
||||
remoteServerContext: {
|
||||
childProcess: {
|
||||
exec: createStubFunction(),
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user