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: {
|
environmentInfo: {
|
||||||
os: renderHost.serverConfig.environmentInfo.os,
|
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: {
|
remoteServerContext: {
|
||||||
childProcess: {
|
childProcess: {
|
||||||
exec: async (
|
exec: async (
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {
|
|||||||
fsConstants,
|
fsConstants,
|
||||||
EnvironmentInfo,
|
EnvironmentInfo,
|
||||||
FSStatsLike,
|
FSStatsLike,
|
||||||
|
FlipperServerCommands,
|
||||||
} from 'flipper-common';
|
} from 'flipper-common';
|
||||||
import {CreatePasteArgs, CreatePasteResult} from './Paste';
|
import {CreatePasteArgs, CreatePasteResult} from './Paste';
|
||||||
|
|
||||||
@@ -179,6 +180,12 @@ export interface FlipperLib {
|
|||||||
os: EnvironmentInfo['os'];
|
os: EnvironmentInfo['os'];
|
||||||
};
|
};
|
||||||
remoteServerContext: RemoteServerContext;
|
remoteServerContext: RemoteServerContext;
|
||||||
|
intern: InternAPI;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InternAPI {
|
||||||
|
graphGet: FlipperServerCommands['intern-graph-get'];
|
||||||
|
graphPost: FlipperServerCommands['intern-graph-post'];
|
||||||
}
|
}
|
||||||
|
|
||||||
export let flipperLibInstance: FlipperLib | undefined;
|
export let flipperLibInstance: FlipperLib | undefined;
|
||||||
|
|||||||
@@ -430,6 +430,10 @@ export function createMockFlipperLib(options?: StartPluginOptions): FlipperLib {
|
|||||||
platform: 'linux',
|
platform: 'linux',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
intern: {
|
||||||
|
graphGet: createStubFunction(),
|
||||||
|
graphPost: createStubFunction(),
|
||||||
|
},
|
||||||
remoteServerContext: {
|
remoteServerContext: {
|
||||||
childProcess: {
|
childProcess: {
|
||||||
exec: createStubFunction(),
|
exec: createStubFunction(),
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ export function initializeFlipperLibImplementation(
|
|||||||
environmentInfo: {
|
environmentInfo: {
|
||||||
os: renderHost.serverConfig.environmentInfo.os,
|
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: {
|
remoteServerContext: {
|
||||||
childProcess: {
|
childProcess: {
|
||||||
exec: async (
|
exec: async (
|
||||||
|
|||||||
Reference in New Issue
Block a user