flipper-common
Advanced tools
Comparing version 0.187.1 to 0.188.0
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare type ClientIdConstituents = { | ||
@@ -2,0 +10,0 @@ app: string; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -7,2 +15,3 @@ exports.deconstructPluginKey = exports.deconstructClientId = exports.buildClientId = void 0; | ||
const result = `${escapedName}#${clientInfo.os}#${clientInfo.device}#${clientInfo.device_id}`; | ||
// N.B.: device_id can be empty, which designates the host device | ||
for (const key of ['app', 'os', 'device']) { | ||
@@ -33,2 +42,3 @@ if (!clientInfo[key]) { | ||
if (parts.length === 2) { | ||
// Device plugin | ||
return { | ||
@@ -41,2 +51,3 @@ type: 'device', | ||
else { | ||
// Client plugin | ||
const lastHashIndex = pluginKey.lastIndexOf('#'); | ||
@@ -43,0 +54,0 @@ const clientId = pluginKey.slice(0, lastHashIndex); |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
declare type SerializableFnArg = null | boolean | number | string | { | ||
@@ -6,2 +14,7 @@ [prop: string]: SerializableFnArg | SerializableFnArg[]; | ||
pluginId: string; | ||
/** | ||
* `active` if a plugin is connected and running (accepting messages) | ||
* `ready` if a plugin can be started: bundled or found on a file system. | ||
* `unavailable` if plugin is supported by a device, but it cannot be loaded by Flipper (not bundled, not found on a file system, does not support a headless mode) | ||
*/ | ||
state: 'unavailable' | 'ready' | 'active'; | ||
@@ -11,10 +24,34 @@ } | ||
'companion-plugin-list': (clientId: string) => Promise<FlipperCompanionAvailablePlugin[]>; | ||
/** | ||
* Start a plugin for a client. It triggers 'onConnect' and 'onActivate' listeners for the plugin. | ||
*/ | ||
'companion-plugin-start': (clientId: string, pluginId: string) => Promise<void>; | ||
/** | ||
* Stops and destroys a plugin for a client. It triggers 'onDeactivate', 'onDisconnect', and 'onDestroy' listeners for the plugin. | ||
*/ | ||
'companion-plugin-stop': (clientId: string, pluginId: string) => Promise<void>; | ||
/** | ||
* Execute a command exposed via `export const API = () => ...` in a plugin. | ||
*/ | ||
'companion-plugin-exec': (clientId: string, pluginId: string, api: string, params?: SerializableFnArg[]) => Promise<any>; | ||
/** | ||
* Subscribe to state updates via `export const API = () => ...` in a plugin. Returns the current state. | ||
*/ | ||
'companion-plugin-subscribe': (clientId: string, pluginId: string, api: string) => Promise<any>; | ||
'companion-device-plugin-list': (deviceSerial: string) => Promise<FlipperCompanionAvailablePlugin[]>; | ||
/** | ||
* Start a device plugin for a device. It triggers 'onActivate' listener for the plugin. | ||
*/ | ||
'companion-device-plugin-start': (deviceSerial: string, pluginId: string) => Promise<void>; | ||
/** | ||
* Stops and destroys a device plugin for a device. It triggers 'onDeactivate' and 'onDestroy' listeners for the plugin. | ||
*/ | ||
'companion-device-plugin-stop': (deviceSerial: string, pluginId: string) => Promise<void>; | ||
/** | ||
* Execute a command exposed via `export const api = () => ...` in a plugin. | ||
*/ | ||
'companion-device-plugin-exec': (deviceSerial: string, pluginId: string, api: string, params?: SerializableFnArg[]) => Promise<any>; | ||
/** | ||
* Subscribe to state updates via `export const API = () => ...` in a plugin. Returns the current state. | ||
*/ | ||
'companion-device-plugin-subscribe': (clientId: string, pluginId: string, api: string) => Promise<any>; | ||
@@ -21,0 +58,0 @@ }; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=companion-types.js.map |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare namespace FlipperDoctor { | ||
@@ -2,0 +10,0 @@ type EnvironmentInfo = { |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=doctor.js.map |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export { Logger, LoggerExtractError, LoggerFormat, LoggerInfo, LoggerPerformanceEntry, LoggerTrackType, LoggerTypes, LoggerArgs, getLogger, setLoggerInstance, NoopLogger, } from './utils/Logger'; | ||
@@ -2,0 +10,0 @@ export * from './server-types'; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -3,0 +11,0 @@ if (k2 === undefined) k2 = k; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare const pluginExternalModules: { | ||
@@ -2,0 +10,0 @@ flipper: string; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.wrapRequire = exports.pluginExternalModules = void 0; | ||
// This list should match `flipper-frontend-core/src/globalObject.tsx` and `builtInModules` in `desktop/.eslintrc.js` | ||
exports.pluginExternalModules = { | ||
@@ -16,2 +25,3 @@ flipper: 'Flipper', | ||
'@ant-design/icons': 'antdesign_icons', | ||
// Used by "bloks-logger" (see its bundle's content) | ||
'react/jsx-runtime': 'ReactJsxRuntime', | ||
@@ -18,0 +28,0 @@ }; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export interface PluginDetails { | ||
@@ -31,2 +39,6 @@ name: string; | ||
}; | ||
/** | ||
* Provided by NPM. Allows developers to deprecated packages. Its value is the deprecation reason. | ||
* Alternatively, might be a part of the plugin's package JSON. In this case, the plugin is excluded from bundling. | ||
*/ | ||
deprecated?: string; | ||
@@ -33,0 +45,0 @@ } |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -20,2 +28,3 @@ exports.isPluginJson = exports.getPluginDetails = void 0; | ||
exports.getPluginDetails = getPluginDetails; | ||
// Plugins packaged using V1 are distributed as sources and compiled in run-time. | ||
function getPluginDetailsV1(packageJson) { | ||
@@ -44,2 +53,3 @@ var _a; | ||
} | ||
// Plugins packaged using V2 are pre-bundled, so compilation in run-time is not required for them. | ||
function getPluginDetailsV2(packageJson) { | ||
@@ -46,0 +56,0 @@ var _a; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
import { FlipperDoctor } from './doctor'; | ||
@@ -158,2 +166,5 @@ import { DeviceSpec, DeviceType, DownloadablePluginDetails, InstalledPluginDetails, MarketplacePluginDetails, OS as PluginOS, UpdatablePluginDetails } from './PluginDetails'; | ||
'node-api-fs-writefile-binary': (path: string, base64contents: string) => Promise<void>; | ||
/** | ||
* @throws ExecError | ||
*/ | ||
'node-api-exec': (command: string, options?: ExecOptions & { | ||
@@ -233,2 +244,5 @@ encoding?: BufferEncoding; | ||
}; | ||
/** | ||
* White listed environment variables that can be used in Flipper UI / plugins | ||
*/ | ||
declare const environmentVariables: { | ||
@@ -250,2 +264,5 @@ readonly NODE_ENV: 1; | ||
export declare type ENVIRONMENT_VARIABLES = keyof typeof environmentVariables; | ||
/** | ||
* Grab all environment variables from a process.env object, without leaking variables which usage isn't declared in ENVIRONMENT_VARIABLES | ||
*/ | ||
export declare function parseEnvironmentVariables(baseEnv: any): Partial<Record<ENVIRONMENT_VARIABLES, string>>; | ||
@@ -288,2 +305,5 @@ declare type ENVIRONMENT_PATHS = 'appPath' | 'homePath' | 'execPath' | 'staticPath' | 'tempPath' | 'desktopPath'; | ||
downloaded: number; | ||
/** | ||
* Set to 0 if unknown | ||
*/ | ||
totalSize: number; | ||
@@ -300,6 +320,21 @@ } & ({ | ||
export interface DownloadFileStartResponse { | ||
/** | ||
* Download ID | ||
*/ | ||
id: string; | ||
/** | ||
* Response status | ||
*/ | ||
status: number; | ||
/** | ||
* Response status text | ||
*/ | ||
statusText: string; | ||
/** | ||
* Response headers | ||
*/ | ||
headers: Record<string, string>; | ||
/** | ||
* Size of the file, being downloaded, in bytes. Inferred from the "Content-Length" header. Set to 0 if unknown. | ||
*/ | ||
totalSize: number; | ||
@@ -337,2 +372,8 @@ } | ||
export declare type MetroGlobalCacheDisabledReason = 'too_many_errors' | 'too_many_misses'; | ||
/** | ||
* A tagged union of all the actions that may happen and we may want to | ||
* report to the tool user. | ||
* | ||
* Based on xplat/js/metro/packages/metro/src/lib/TerminalReporter.js | ||
*/ | ||
export declare type MetroReportableEvent = { | ||
@@ -339,0 +380,0 @@ port: number; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseEnvironmentVariables = void 0; | ||
/** | ||
* White listed environment variables that can be used in Flipper UI / plugins | ||
*/ | ||
const environmentVariables = { | ||
@@ -19,2 +30,5 @@ NODE_ENV: 1, | ||
}; | ||
/** | ||
* Grab all environment variables from a process.env object, without leaking variables which usage isn't declared in ENVIRONMENT_VARIABLES | ||
*/ | ||
function parseEnvironmentVariables(baseEnv) { | ||
@@ -21,0 +35,0 @@ const result = {}; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
import { FlipperServer, FlipperServerCommands, FlipperServerEvents } from './server-types'; | ||
@@ -2,0 +10,0 @@ export declare type ServerAddOnStartDetails = { |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=ServerAddOn.js.map |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare enum Tristate { | ||
@@ -6,2 +14,6 @@ True = 0, | ||
} | ||
/** Settings used by both Server and UI. | ||
* TODO: some settings might be flipper environment specific, | ||
* and should ideally bemoved to local storage, like 'darkMode' | ||
*/ | ||
export declare type Settings = { | ||
@@ -12,2 +24,7 @@ androidHome: string; | ||
enablePhysicalIOS: boolean; | ||
/** | ||
* If unset, this will assume the value of the GK setting. | ||
* Note that this setting has no effect in the open source version | ||
* of Flipper. | ||
*/ | ||
enablePrefetching: Tristate; | ||
@@ -26,5 +43,17 @@ idbPath: string; | ||
persistDeviceData: boolean; | ||
/** | ||
* Plugin marketplace - allow internal plugin distribution | ||
*/ | ||
enablePluginMarketplace: boolean; | ||
marketplaceURL: string; | ||
enablePluginMarketplaceAutoUpdate: boolean; | ||
/** | ||
* Adbkit settings are needed because localhost can resolve to | ||
* 127.0.0.1 or [::1] depending on the machine (IPV4 or IPV6) | ||
* this unknown behaviour of which address will be used by the | ||
* adbkit may cause it not to connect to the correct address where the | ||
* adb server is running. Notice that using the env variable ADB_SERVER_SOCKET | ||
* set to tcp:127.0.0.1:5037 would make the adb start-server fail and so | ||
* cannot be used as a solution. | ||
*/ | ||
adbKitSettings?: { | ||
@@ -43,2 +72,3 @@ host?: string; | ||
} | ||
/** Launcher settings only apply to Electron, and aren't managed or relevant for flipper-server-core */ | ||
export declare type LauncherSettings = { | ||
@@ -45,0 +75,0 @@ releaseChannel: ReleaseChannel; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.ReleaseChannel = exports.Tristate = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
import { FlipperCompanionEvents } from './companion-types'; | ||
@@ -2,0 +10,0 @@ import { FlipperServerCommands, FlipperServerEvents } from './server-types'; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=transport.js.map |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare type User = { | ||
@@ -2,0 +10,0 @@ id?: string; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=User.js.map |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare const assertNever: (val: never) => asserts val; | ||
//# sourceMappingURL=assertNever.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.assertNever = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
declare type Res<T> = { | ||
@@ -2,0 +10,0 @@ promise: Promise<T>; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.createControlledPromise = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
import { ClientErrorType } from '../server-types'; | ||
@@ -2,0 +10,0 @@ export declare function isAuthError(err: any): err is UserNotSignedInError | UserUnauthorizedError; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -12,2 +20,4 @@ exports.deserializeRemoteError = exports.getStringFromErrorLike = exports.getErrorFromErrorLike = exports.isError = exports.NoLongerConnectedToClientError = exports.UserNotSignedInError = exports.UserUnauthorizedError = exports.ConnectivityError = exports.CancelledPromiseError = exports.UnableToExtractClientQueryError = exports.UserError = exports.SystemError = exports.isConnectivityOrAuthError = exports.isAuthError = void 0; | ||
String(err).startsWith('Failed to fetch') || | ||
// In cases where the error message is wrapped but the | ||
// underlying core issue is still a fetch failure. | ||
String(err).endsWith('Failed to fetch')); | ||
@@ -112,2 +122,4 @@ } | ||
catch (e) { | ||
// Stringify might fail on arbitrary structures | ||
// Last resort: toString it. | ||
return '' + e; | ||
@@ -114,0 +126,0 @@ } |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare const fsConstants: { | ||
@@ -2,0 +10,0 @@ UV_FS_SYMLINK_DIR: number; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fsConstants = void 0; | ||
// https://github.com/nodejs/node/blob/b66a75a3a4361614dde9bc1a52d7e9021b4efc26/typings/internalBinding/constants.d.ts | ||
exports.fsConstants = { | ||
@@ -5,0 +14,0 @@ UV_FS_SYMLINK_DIR: 1, |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare function isProduction(): boolean; | ||
//# sourceMappingURL=isProduction.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isProduction = void 0; | ||
// TODO: there are currently two definitions of isProduction active, | ||
// this one, and one provided by the RenderHostConfig. Ideally they should be unified | ||
function isProduction() { | ||
@@ -5,0 +15,0 @@ return (typeof process === 'undefined' || process.env.NODE_ENV === 'production'); |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare function isTest(): boolean; | ||
//# sourceMappingURL=isTest.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.isTest = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare type LoggerTypes = 'error' | 'warn' | 'info' | 'debug'; | ||
@@ -29,2 +37,5 @@ export declare type LoggerTrackType = 'duration' | 'usage' | 'performance' | 'success-rate' | 'operation-cancelled'; | ||
export declare function setLoggerInstance(logger: Logger): void; | ||
/** | ||
* A logger that doesn't log anything, used in tests and public Flipper builds | ||
*/ | ||
export declare class NoopLogger implements Logger { | ||
@@ -31,0 +42,0 @@ constructor(); |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -18,2 +26,3 @@ exports.LoggerFormat = exports.LoggerExtractError = exports.NoopLogger = exports.setLoggerInstance = exports.getLogger = void 0; | ||
exports.getLogger = getLogger; | ||
// only for testing | ||
function setLoggerInstance(logger) { | ||
@@ -23,2 +32,5 @@ instance = logger; | ||
exports.setLoggerInstance = setLoggerInstance; | ||
/** | ||
* A logger that doesn't log anything, used in tests and public Flipper builds | ||
*/ | ||
class NoopLogger { | ||
@@ -25,0 +37,0 @@ constructor() { } |
@@ -0,1 +1,9 @@ | ||
/** | ||
* 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 | ||
*/ | ||
declare type Result = { | ||
@@ -18,2 +26,7 @@ kind: 'success'; | ||
export declare function tryCatchReportPluginFailuresAsync<T>(closure: () => Promise<T>, name: string, plugin: string): Promise<T>; | ||
/** | ||
* Track usage of a feature. | ||
* @param action Unique name for the action performed. E.g. captureScreenshot | ||
* @param data Optional additional metadata attached to the event. | ||
*/ | ||
export declare function reportUsage(action: string, data?: { | ||
@@ -20,0 +33,0 @@ [key: string]: string; |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -12,2 +20,9 @@ exports.logPlatformSuccessRate = exports.reportUsage = exports.tryCatchReportPluginFailuresAsync = exports.tryCatchReportPluginFailures = exports.tryCatchReportPlatformFailures = exports.reportPluginFailures = exports.reportPlatformFailures = exports.UnsupportedError = void 0; | ||
exports.UnsupportedError = UnsupportedError; | ||
/* | ||
* Wraps a Promise, preserving it's functionality but logging the success or | ||
failure state of it, with a given name, based on whether it's fulfilled or | ||
rejected. | ||
Use this variant to report failures in core platform (Flipper) code. | ||
*/ | ||
function reportPlatformFailures(promise, name) { | ||
@@ -38,2 +53,9 @@ return new Promise((resolve, reject) => { | ||
exports.reportPlatformFailures = reportPlatformFailures; | ||
/* | ||
* Wraps a Promise, preserving it's functionality but logging the success or | ||
failure state of it, with a given name, based on whether it's fulfilled or | ||
rejected. | ||
Use this variant to report failures in plugin code. | ||
*/ | ||
function reportPluginFailures(promise, name, plugin) { | ||
@@ -60,2 +82,6 @@ return promise.then((fulfilledValue) => { | ||
exports.reportPluginFailures = reportPluginFailures; | ||
/* | ||
* Wraps a closure, preserving it's functionality but logging the success or | ||
failure state of it. | ||
*/ | ||
function tryCatchReportPlatformFailures(closure, name) { | ||
@@ -77,2 +103,6 @@ try { | ||
exports.tryCatchReportPlatformFailures = tryCatchReportPlatformFailures; | ||
/* | ||
* Wraps a closure, preserving it's functionality but logging the success or | ||
failure state of it. | ||
*/ | ||
function tryCatchReportPluginFailures(closure, name, plugin) { | ||
@@ -94,2 +124,6 @@ try { | ||
exports.tryCatchReportPluginFailures = tryCatchReportPluginFailures; | ||
/* | ||
* Wraps a closure, preserving it's functionality but logging the success or | ||
failure state of it. | ||
*/ | ||
async function tryCatchReportPluginFailuresAsync(closure, name, plugin) { | ||
@@ -111,2 +145,7 @@ try { | ||
exports.tryCatchReportPluginFailuresAsync = tryCatchReportPluginFailuresAsync; | ||
/** | ||
* Track usage of a feature. | ||
* @param action Unique name for the action performed. E.g. captureScreenshot | ||
* @param data Optional additional metadata attached to the event. | ||
*/ | ||
function reportUsage(action, data, plugin) { | ||
@@ -113,0 +152,0 @@ (0, Logger_1.getLogger)().track('usage', action, data, plugin); |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare function sleep(ms: number): Promise<void>; | ||
//# sourceMappingURL=sleep.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.sleep = void 0; |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare function timeout<T>(ms: number, promise: Promise<T>, timeoutMessage?: string): Promise<T>; | ||
//# sourceMappingURL=timeout.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.timeout = void 0; |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export declare function notNull<T>(x: T | null | undefined): x is T; | ||
//# sourceMappingURL=typeUtils.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.notNull = void 0; | ||
// Typescript doesn't know Array.filter(Boolean) won't contain nulls. | ||
// So use Array.filter(notNull) instead. | ||
function notNull(x) { | ||
@@ -5,0 +15,0 @@ return x !== null && x !== undefined; |
@@ -0,2 +1,10 @@ | ||
/** | ||
* 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 | ||
*/ | ||
export { v4 as uuid } from 'uuid'; | ||
//# sourceMappingURL=uuid.d.ts.map |
"use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.uuid = void 0; |
{ | ||
"name": "flipper-common", | ||
"version": "0.187.1", | ||
"version": "0.188.0", | ||
"description": "Server & UI shared Flipper utilities", | ||
@@ -5,0 +5,0 @@ "repository": "facebook/flipper", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143559
2349