diff --git a/desktop/flipper-common/src/server-types.tsx b/desktop/flipper-common/src/server-types.tsx index 3b3a914c9..7ce8e0d07 100644 --- a/desktop/flipper-common/src/server-types.tsx +++ b/desktop/flipper-common/src/server-types.tsx @@ -325,6 +325,7 @@ export type FlipperServerCommands = { 'intern-upload-scribe-logs': ( messages: {category: string; message: string}[], ) => Promise; + 'intern-cloud-upload': (path: string) => Promise; shutdown: () => Promise; 'is-logged-in': () => Promise; 'environment-info': () => Promise; diff --git a/desktop/flipper-server-core/src/FlipperServerImpl.tsx b/desktop/flipper-server-core/src/FlipperServerImpl.tsx index 33297f006..176c5ab3d 100644 --- a/desktop/flipper-server-core/src/FlipperServerImpl.tsx +++ b/desktop/flipper-server-core/src/FlipperServerImpl.tsx @@ -55,6 +55,7 @@ import {assertNotNull} from './comms/Utilities'; import {mkdirp} from 'fs-extra'; import {flipperDataFolder, flipperSettingsFolder} from './utils/paths'; import {DebuggableDevice} from './devices/DebuggableDevice'; +import {jfUpload} from './fb-stubs/jf'; const {access, copyFile, mkdir, unlink, stat, readlink, readFile, writeFile} = promises; @@ -535,6 +536,13 @@ export class FlipperServerImpl implements FlipperServer { return internGraphGETAPIRequest(endpoint, params, options, token); }, 'intern-upload-scribe-logs': sendScribeLogs, + 'intern-cloud-upload': async (path) => { + const uploadRes = await jfUpload(path); + if (!uploadRes) { + throw new Error('Upload failed'); + } + return uploadRes; + }, shutdown: async () => { process.exit(0); }, diff --git a/desktop/flipper-server-core/src/fb-stubs/jf.tsx b/desktop/flipper-server-core/src/fb-stubs/jf.tsx new file mode 100644 index 000000000..173b6d6d6 --- /dev/null +++ b/desktop/flipper-server-core/src/fb-stubs/jf.tsx @@ -0,0 +1,17 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +/** + * Upload a file at path to a temporary cloud storage + * + * @returns Download URL + */ +export const jfUpload = async (_path: string): Promise => { + throw new Error('jf upload is not implemented'); +};