Socket
Socket
Sign inDemoInstall

flipper-common

Package Overview
Dependencies
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flipper-common - npm Package Compare versions

Comparing version 0.212.0 to 0.259.0

lib/builtins.d.ts

3

lib/clientUtils.d.ts

@@ -9,2 +9,3 @@ /**

*/
import { ClientQuery, UninitializedClient } from './server-types';
export type ClientIdConstituents = {

@@ -31,2 +32,4 @@ app: string;

}): string;
export declare function buildGenericClientId(client: UninitializedClient): string;
export declare function buildGenericClientIdFromQuery(clientQuery: ClientQuery): string;
export declare function deconstructClientId(clientId: string): ClientIdConstituents;

@@ -33,0 +36,0 @@ export declare function deconstructPluginKey(pluginKey: string): PluginKeyConstituents;

@@ -11,3 +11,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.deconstructPluginKey = exports.deconstructClientId = exports.buildClientId = void 0;
exports.deconstructPluginKey = exports.deconstructClientId = exports.buildGenericClientIdFromQuery = exports.buildGenericClientId = exports.buildClientId = void 0;
function buildClientId(clientInfo) {

@@ -25,2 +25,12 @@ const escapedName = escape(clientInfo.app);

exports.buildClientId = buildClientId;
function buildGenericClientId(client) {
const escapedName = escape(client.appName);
return `${client.os}:${client.deviceName}:${escapedName}`.toLowerCase();
}
exports.buildGenericClientId = buildGenericClientId;
function buildGenericClientIdFromQuery(clientQuery) {
const escapedName = escape(clientQuery.app);
return `${clientQuery.os}:${clientQuery.device}:${escapedName}`.toLowerCase();
}
exports.buildGenericClientIdFromQuery = buildGenericClientIdFromQuery;
function deconstructClientId(clientId) {

@@ -62,3 +72,3 @@ if (!clientId || clientId.split('#').length !== 4) {

client: clientId,
pluginName: pluginName,
pluginName,
};

@@ -65,0 +75,0 @@ }

@@ -55,9 +55,22 @@ /**

};
type CliCommand = {
title: string;
command: string;
};
type HealthcheckRunSubcheck = {
status: 'ok' | 'fail';
title: string;
};
type HealthcheckRunResult = {
hasProblem: boolean;
message: string;
/** Indicates what sub checks were passed to better communicate the problem */
subchecks?: HealthcheckRunSubcheck[];
message: MessageIdWithParams;
};
type SubprocessHealtcheckRunResult = HealthcheckRunResult & {
stdout?: string;
};
type SubprocessHealtcheckRunResult = (HealthcheckRunResult & {
hasProblem: true;
}) | (HealthcheckRunResult & {
hasProblem: false;
stdout: string;
});
type CategoryResult = [

@@ -84,3 +97,4 @@ string,

isAcknowledged?: boolean;
message?: string;
message?: MessageIdWithParams;
subchecks?: HealthcheckRunSubcheck[];
};

@@ -109,4 +123,116 @@ type HealthcheckReportItem = {

};
isProduction: boolean;
};
/**
* key - message id
* value - params of message function
*/
type HealthcheckResultMessageMapping = {
'common.openssl--installed': [{
output: string;
}];
'common.openssl--not_installed': [{
output: string;
}];
'common.watchman--installed': [];
'common.watchman--not_installed': [];
'android.android-studio--installed': [];
'android.android-studio--not_installed': [{
platform: string;
}];
'android.sdk--no_ANDROID_HOME': [];
'android.sdk--invalid_ANDROID_HOME': [
{
androidHome: string;
existingAndroidHome: string | null;
}
];
'android.sdk--no_android_sdk': [{
platformToolsDir: string;
}];
'android.sdk--no_ANDROID_SDK_ROOT': [];
'android.sdk--unexisting_folder_ANDROID_SDK_ROOT': [];
'android.sdk--installed': [{
output: string;
}];
'android.sdk--not_installed': [{
output: string;
}];
'ios.xcode--installed': [{
version: string;
path: string;
}];
'ios.xcode--not_installed': [];
'ios.xcode-select--set': [{
selected: string;
}];
'ios.xcode-select--not_set': [
{
message: string;
availableXcode: string | null;
}
];
'ios.xcode-select--no_xcode_selected': [{
availableXcode: string | null;
}];
'ios.xcode-select--noop': [];
'ios.xcode-select--custom_path': [
{
selectedPath: string;
availableXcode: string | null;
}
];
'ios.xcode-select--old_version_selected': [
{
selectedVersion: string;
latestXCode: string;
}
];
'ios.xcode-select--nonexisting_selected': [
{
selected: string;
availableXcode: string | null;
}
];
'ios.sdk--installed': [{
platforms: string[];
}];
'ios.sdk--not_installed': [];
'ios.has-simulators--idb-failed': [{
message: string;
}];
'ios.has-simulators--no-devices': [];
'ios.has-simulators--ok': [{
count: number;
}];
'ios.xctrace--installed': [{
output: string;
}];
'ios.xctrace--not_installed': [{
message: string;
}];
'ios.idb--no_context': [];
'ios.idb--physical_device_disabled': [];
'ios.idb--not_installed_but_present': [
{
idbPath: string;
idbInPath: string;
}
];
'ios.idb--not_installed': [{
idbPath: string;
hasIdbCompanion: boolean;
}];
'ios.idb--installed': [];
'doctor-failed': [{
error: any;
}];
skipped: [{
reason: string;
}];
};
type MessageIdWithParams = {
[K in keyof HealthcheckResultMessageMapping]: HealthcheckResultMessageMapping[K][0] extends void ? [K] : [K, ...HealthcheckResultMessageMapping[K]];
}[keyof HealthcheckResultMessageMapping];
}
//# sourceMappingURL=doctor.d.ts.map

6

lib/index.d.ts

@@ -10,4 +10,5 @@ /**

export { Logger, LoggerExtractError, LoggerFormat, LoggerInfo, LoggerPerformanceEntry, LoggerTrackType, LoggerTypes, LoggerArgs, getLogger, setLoggerInstance, NoopLogger, } from './utils/Logger';
export * from './utils/LoggerTailer';
export * from './utils/ScribeLogger';
export * from './server-types';
export * from './companion-types';
export * from './ServerAddOn';

@@ -22,3 +23,3 @@ export * from './plugin-external-modules';

export { logPlatformSuccessRate, reportPlatformFailures, reportUsage, reportPluginFailures, tryCatchReportPluginFailuresAsync, tryCatchReportPlatformFailures, tryCatchReportPluginFailures, UnsupportedError, } from './utils/metrics';
export { ConnectivityError, CancelledPromiseError, UnableToExtractClientQueryError, UserUnauthorizedError, UserNotSignedInError, NoLongerConnectedToClientError, UserError, SystemError, isConnectivityOrAuthError, isError, isAuthError, getStringFromErrorLike, getErrorFromErrorLike, deserializeRemoteError, } from './utils/errors';
export { ConnectivityError, CancelledPromiseError, UnableToExtractClientQueryError, UserUnauthorizedError, UserNotSignedInError, NoLongerConnectedToClientError, UserError, SystemError, X2PAgentdError, isConnectivityOrAuthError, isError, isAuthError, FlipperServerDisconnectedError, FlipperServerTimeoutError, getStringFromErrorLike, getErrorFromErrorLike, deserializeRemoteError, } from './utils/errors';
export { createControlledPromise } from './utils/controlledPromise';

@@ -34,2 +35,3 @@ export * from './utils/typeUtils';

export * from './User';
export * from './builtins';
//# sourceMappingURL=index.d.ts.map

@@ -25,3 +25,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createControlledPromise = exports.deserializeRemoteError = exports.getErrorFromErrorLike = exports.getStringFromErrorLike = exports.isAuthError = exports.isError = exports.isConnectivityOrAuthError = exports.SystemError = exports.UserError = exports.NoLongerConnectedToClientError = exports.UserNotSignedInError = exports.UserUnauthorizedError = exports.UnableToExtractClientQueryError = exports.CancelledPromiseError = exports.ConnectivityError = exports.UnsupportedError = exports.tryCatchReportPluginFailures = exports.tryCatchReportPlatformFailures = exports.tryCatchReportPluginFailuresAsync = exports.reportPluginFailures = exports.reportUsage = exports.reportPlatformFailures = exports.logPlatformSuccessRate = exports.fsConstants = exports.assertNever = exports.isProduction = exports.isTest = exports.timeout = exports.sleep = exports.NoopLogger = exports.setLoggerInstance = exports.getLogger = exports.LoggerFormat = exports.LoggerExtractError = void 0;
exports.createControlledPromise = exports.deserializeRemoteError = exports.getErrorFromErrorLike = exports.getStringFromErrorLike = exports.FlipperServerTimeoutError = exports.FlipperServerDisconnectedError = exports.isAuthError = exports.isError = exports.isConnectivityOrAuthError = exports.X2PAgentdError = exports.SystemError = exports.UserError = exports.NoLongerConnectedToClientError = exports.UserNotSignedInError = exports.UserUnauthorizedError = exports.UnableToExtractClientQueryError = exports.CancelledPromiseError = exports.ConnectivityError = exports.UnsupportedError = exports.tryCatchReportPluginFailures = exports.tryCatchReportPlatformFailures = exports.tryCatchReportPluginFailuresAsync = exports.reportPluginFailures = exports.reportUsage = exports.reportPlatformFailures = exports.logPlatformSuccessRate = exports.fsConstants = exports.assertNever = exports.isProduction = exports.isTest = exports.timeout = exports.sleep = exports.NoopLogger = exports.setLoggerInstance = exports.getLogger = exports.LoggerFormat = exports.LoggerExtractError = void 0;
var Logger_1 = require("./utils/Logger");

@@ -33,4 +33,5 @@ Object.defineProperty(exports, "LoggerExtractError", { enumerable: true, get: function () { return Logger_1.LoggerExtractError; } });

Object.defineProperty(exports, "NoopLogger", { enumerable: true, get: function () { return Logger_1.NoopLogger; } });
__exportStar(require("./utils/LoggerTailer"), exports);
__exportStar(require("./utils/ScribeLogger"), exports);
__exportStar(require("./server-types"), exports);
__exportStar(require("./companion-types"), exports);
__exportStar(require("./ServerAddOn"), exports);

@@ -68,5 +69,8 @@ __exportStar(require("./plugin-external-modules"), exports);

Object.defineProperty(exports, "SystemError", { enumerable: true, get: function () { return errors_1.SystemError; } });
Object.defineProperty(exports, "X2PAgentdError", { enumerable: true, get: function () { return errors_1.X2PAgentdError; } });
Object.defineProperty(exports, "isConnectivityOrAuthError", { enumerable: true, get: function () { return errors_1.isConnectivityOrAuthError; } });
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return errors_1.isError; } });
Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return errors_1.isAuthError; } });
Object.defineProperty(exports, "FlipperServerDisconnectedError", { enumerable: true, get: function () { return errors_1.FlipperServerDisconnectedError; } });
Object.defineProperty(exports, "FlipperServerTimeoutError", { enumerable: true, get: function () { return errors_1.FlipperServerTimeoutError; } });
Object.defineProperty(exports, "getStringFromErrorLike", { enumerable: true, get: function () { return errors_1.getStringFromErrorLike; } });

@@ -86,2 +90,3 @@ Object.defineProperty(exports, "getErrorFromErrorLike", { enumerable: true, get: function () { return errors_1.getErrorFromErrorLike; } });

__exportStar(require("./User"), exports);
__exportStar(require("./builtins"), exports);
//# sourceMappingURL=index.js.map

@@ -12,3 +12,3 @@ "use strict";

exports.wrapRequire = exports.pluginExternalModules = void 0;
// This list should match `flipper-frontend-core/src/globalObject.tsx` and `builtInModules` in `desktop/.eslintrc.js`
// This list should match `flipper-ui/src/displatcher/plugins.tsx` and `builtInModules` in `desktop/.eslintrc.js`
exports.pluginExternalModules = {

@@ -15,0 +15,0 @@ flipper: 'Flipper',

@@ -9,2 +9,3 @@ /**

*/
import { DeviceType, OS } from './server-types';
export interface PluginDetails {

@@ -33,3 +34,2 @@ name: string;

pluginType?: PluginType;
headless?: boolean;
supportedDevices?: SupportedDevice[];

@@ -58,4 +58,2 @@ supportedApps?: SupportedApp[];

}
export type OS = 'iOS' | 'Android' | 'Metro' | 'Windows' | 'MacOS' | 'Browser' | 'Linux';
export type DeviceType = 'emulator' | 'physical' | 'dummy';
export type PluginType = 'client' | 'device';

@@ -75,3 +73,4 @@ export type DeviceSpec = 'KaiOS';

isActivatable: false;
downloadUrl: string;
buildId: string;
downloadUrls: string[];
lastUpdated: Date;

@@ -78,0 +77,0 @@ isEnabledByDefault: boolean;

@@ -30,3 +30,2 @@ "use strict";

function getPluginDetailsV1(packageJson) {
var _a;
return {

@@ -45,6 +44,6 @@ specVersion: 1,

bugs: packageJson.bugs,
flipperSDKVersion: (_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.peerDependencies) === null || _a === void 0 ? void 0 : _a['flipper-plugin'],
pluginType: packageJson === null || packageJson === void 0 ? void 0 : packageJson.pluginType,
supportedDevices: packageJson === null || packageJson === void 0 ? void 0 : packageJson.supportedDevices,
supportedApps: packageJson === null || packageJson === void 0 ? void 0 : packageJson.supportedApps,
flipperSDKVersion: packageJson?.peerDependencies?.['flipper-plugin'],
pluginType: packageJson?.pluginType,
supportedDevices: packageJson?.supportedDevices,
supportedApps: packageJson?.supportedApps,
engines: packageJson.engines,

@@ -56,3 +55,2 @@ deprecated: packageJson.deprecated,

function getPluginDetailsV2(packageJson) {
var _a;
return {

@@ -73,9 +71,8 @@ specVersion: 2,

bugs: packageJson.bugs,
flipperSDKVersion: (_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.peerDependencies) === null || _a === void 0 ? void 0 : _a['flipper-plugin'],
pluginType: packageJson === null || packageJson === void 0 ? void 0 : packageJson.pluginType,
supportedDevices: packageJson === null || packageJson === void 0 ? void 0 : packageJson.supportedDevices,
supportedApps: packageJson === null || packageJson === void 0 ? void 0 : packageJson.supportedApps,
flipperSDKVersion: packageJson?.peerDependencies?.['flipper-plugin'],
pluginType: packageJson?.pluginType,
supportedDevices: packageJson?.supportedDevices,
supportedApps: packageJson?.supportedApps,
engines: packageJson.engines,
publishedDocs: packageJson.publishedDocs,
headless: packageJson.headless,
deprecated: packageJson.deprecated,

@@ -92,6 +89,5 @@ };

function isPluginJson(packageJson) {
var _a;
return (_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.keywords) === null || _a === void 0 ? void 0 : _a.includes('flipper-plugin');
return packageJson?.keywords?.includes('flipper-plugin');
}
exports.isPluginJson = isPluginJson;
//# sourceMappingURL=PluginDetails.js.map

@@ -10,3 +10,3 @@ /**

import { FlipperDoctor } from './doctor';
import { DeviceSpec, DeviceType, DownloadablePluginDetails, InstalledPluginDetails, MarketplacePluginDetails, OS as PluginOS, UpdatablePluginDetails } from './PluginDetails';
import { DeviceSpec, DownloadablePluginDetails, InstalledPluginDetails, MarketplacePluginDetails, UpdatablePluginDetails } from './PluginDetails';
import { ServerAddOnStartDetails } from './ServerAddOn';

@@ -18,3 +18,3 @@ import { EnvironmentInfo, LauncherSettings, ProcessConfig, Settings } from './settings';

export type FlipperServerState = 'pending' | 'starting' | 'started' | 'error' | 'closed';
export type DeviceOS = PluginOS;
export type DeviceOS = OS;
export type DeviceDescription = {

@@ -68,2 +68,3 @@ readonly os: DeviceOS;

readonly app: string;
readonly app_id?: string;
readonly os: DeviceOS;

@@ -111,2 +112,3 @@ readonly device: string;

'device-disconnected': DeviceDescription;
'device-removed': DeviceDescription;
'device-log': {

@@ -121,2 +123,15 @@ serial: string;

'client-setup': UninitializedClient;
'client-setup-secret-exchange': {
client: UninitializedClient;
secret: string;
};
'client-setup-error': {
client: UninitializedClient;
type: 'error' | 'warning';
message: string;
};
'client-setup-step': {
client: UninitializedClient;
step: string;
};
'client-connected': ClientDescription;

@@ -131,17 +146,15 @@ 'client-disconnected': {

'connectivity-troubleshoot-cmd': CommandRecordEntry;
'connectivity-troubleshoot-log': ConnectionRecordEntry;
'connectivity-troubleshoot-notification': {
type: 'error' | 'warning';
title: string;
description: string;
};
'connectivity-troubleshoot-log': ConnectionRecordEntry[];
'plugins-server-add-on-message': ExecuteMessage;
'download-file-update': DownloadFileUpdate;
'server-log': LoggerInfo;
'browser-connection-created': {};
};
export type IOSDeviceParams = {
export type OS = 'iOS' | 'Android' | 'Metro' | 'Windows' | 'MacOS' | 'Browser' | 'Linux';
export type DeviceType = 'physical' | 'emulator' | 'dummy';
export type DeviceTarget = {
udid: string;
type: DeviceType;
name: string;
deviceTypeIdentifier?: string;
osVersion?: string;
state?: string;

@@ -215,5 +228,7 @@ };

'device-start-screencapture': (serial: string, destination: string) => Promise<void>;
'log-connectivity-event': (level: 'info' | 'warning' | 'error', query: ClientQuery | null, ...message: any) => Promise<void>;
'device-stop-screencapture': (serial: string) => Promise<string>;
'device-shell-exec': (serial: string, command: string) => Promise<string>;
'device-install-app': (serial: string, appBundlePath: string) => Promise<void>;
'device-open-app': (serial: string, name: string) => Promise<void>;
'device-forward-port': (serial: string, local: string, remote: string) => Promise<boolean>;

@@ -231,4 +246,5 @@ 'device-clear-logs': (serial: string) => Promise<void>;

'android-adb-kill': () => Promise<void>;
'ios-get-simulators': (bootedOnly: boolean) => Promise<IOSDeviceParams[]>;
'ios-get-simulators': (bootedOnly: boolean) => Promise<DeviceTarget[]>;
'ios-launch-simulator': (udid: string) => Promise<void>;
'ios-launch-app': (udid: string, appName: string) => Promise<void>;
'ios-idb-kill': () => Promise<void>;

@@ -259,2 +275,4 @@ 'persist-settings': (settings: Settings) => Promise<void>;

internGraphUrl?: string;
headers?: Record<string, string | number | boolean>;
vpnMode?: 'vpn' | 'vpnless';
}) => Promise<GraphResponse>;

@@ -264,2 +282,4 @@ 'intern-graph-get': (endpoint: string, params: Record<string, any>, options: {

internGraphUrl?: string;
headers?: Record<string, string | number | boolean>;
vpnMode?: 'vpn' | 'vpnless';
}) => Promise<GraphResponse>;

@@ -272,4 +292,7 @@ 'intern-upload-scribe-logs': (messages: {

shutdown: () => Promise<void>;
restart: () => Promise<void>;
'is-logged-in': () => Promise<boolean>;
'environment-info': () => Promise<EnvironmentInfo>;
'move-pwa': () => Promise<void>;
'fetch-new-version': (version: string) => Promise<void>;
};

@@ -391,2 +414,3 @@ export type GraphResponse = {

type?: FlipperServerType;
sessionId: string;
};

@@ -477,3 +501,13 @@ export interface FlipperServerExecOptions {

medium: number | undefined;
timestamp?: number;
logs?: string[];
};
export type SignCertificateAckMessage = {
method: 'signCertificateAck';
isError: boolean;
medium: number | undefined;
hasRequiredFiles: boolean;
config: any;
logs?: string[];
};
export type GetPluginsMessage = {

@@ -480,0 +514,0 @@ id: number;

@@ -30,9 +30,2 @@ /**

idbPath: string;
reactNative: {
shortcuts: {
enabled: boolean;
reload: string;
openDevMenu: string;
};
};
darkMode: 'dark' | 'light' | 'system';

@@ -70,3 +63,3 @@ showWelcomeAtStartup: boolean;

}
/** Launcher settings only apply to Electron, and aren't managed or relevant for flipper-server-core */
/** Launcher settings only appllied to Electron, and aren't managed or relevant for flipper-server */
export type LauncherSettings = {

@@ -94,3 +87,2 @@ releaseChannel: ReleaseChannel;

isProduction: boolean;
isHeadlessBuild: boolean;
releaseChannel: ReleaseChannel;

@@ -105,3 +97,2 @@ flipperReleaseRevision?: string;

versions: {
electron?: string;
node: string;

@@ -108,0 +99,0 @@ platform: string;

@@ -17,3 +17,3 @@ "use strict";

Tristate[Tristate["Unset"] = 2] = "Unset";
})(Tristate = exports.Tristate || (exports.Tristate = {}));
})(Tristate || (exports.Tristate = Tristate = {}));
var ReleaseChannel;

@@ -24,3 +24,3 @@ (function (ReleaseChannel) {

ReleaseChannel["INSIDERS"] = "insiders";
})(ReleaseChannel = exports.ReleaseChannel || (exports.ReleaseChannel = {}));
})(ReleaseChannel || (exports.ReleaseChannel = ReleaseChannel = {}));
//# sourceMappingURL=settings.js.map

@@ -9,3 +9,2 @@ /**

*/
import { FlipperCompanionEvents } from './companion-types';
import { FlipperServerCommands, FlipperServerEvents } from './server-types';

@@ -40,10 +39,4 @@ export type GenericWebSocketMessage<E = string, T = unknown> = {

}[keyof FlipperServerEvents]>;
export type CompanionEventWebSocketMessage = GenericWebSocketMessage<'companion-event', {
[K in keyof FlipperCompanionEvents]: {
event: K;
data: FlipperCompanionEvents[K];
};
}[keyof FlipperCompanionEvents]>;
export type ClientWebSocketMessage = ExecWebSocketMessage;
export type ServerWebSocketMessage = ExecResponseWebSocketMessage | ExecResponseErrorWebSocketMessage | ServerEventWebSocketMessage;
//# sourceMappingURL=transport.d.ts.map

@@ -11,3 +11,3 @@ /**

export declare function isAuthError(err: any): err is UserNotSignedInError | UserUnauthorizedError;
export declare function isConnectivityOrAuthError(err: any): err is ConnectivityError | UserNotSignedInError | UserUnauthorizedError;
export declare function isConnectivityOrAuthError(err: any): err is ConnectivityError | UserNotSignedInError | UserUnauthorizedError | X2PAgentdError;
export declare class SystemError extends Error {

@@ -39,2 +39,6 @@ name: string;

}
export declare class X2PAgentdError extends Error {
constructor(msg: string);
name: 'X2PAgentdError';
}
export declare class UserNotSignedInError extends Error {

@@ -48,2 +52,9 @@ constructor(msg?: string);

}
export declare class FlipperServerDisconnectedError extends Error {
readonly reason: 'ws-close';
constructor(reason: 'ws-close');
}
export declare class FlipperServerTimeoutError extends Error {
constructor(msg: string);
}
declare global {

@@ -50,0 +61,0 @@ interface Error {

@@ -11,3 +11,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
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;
exports.deserializeRemoteError = exports.getStringFromErrorLike = exports.getErrorFromErrorLike = exports.isError = exports.FlipperServerTimeoutError = exports.FlipperServerDisconnectedError = exports.NoLongerConnectedToClientError = exports.UserNotSignedInError = exports.X2PAgentdError = exports.UserUnauthorizedError = exports.ConnectivityError = exports.CancelledPromiseError = exports.UnableToExtractClientQueryError = exports.UserError = exports.SystemError = exports.isConnectivityOrAuthError = exports.isAuthError = void 0;
function isAuthError(err) {

@@ -19,2 +19,3 @@ return (err instanceof UserNotSignedInError || err instanceof UserUnauthorizedError);

return (err instanceof ConnectivityError ||
err instanceof X2PAgentdError ||
isAuthError(err) ||

@@ -71,2 +72,9 @@ String(err).startsWith('Failed to fetch') ||

exports.UserUnauthorizedError = UserUnauthorizedError;
class X2PAgentdError extends Error {
constructor(msg) {
super(msg);
this.name = 'X2PAgentdError';
}
}
exports.X2PAgentdError = X2PAgentdError;
class UserNotSignedInError extends Error {

@@ -86,2 +94,15 @@ constructor(msg = 'User not signed in.') {

exports.NoLongerConnectedToClientError = NoLongerConnectedToClientError;
class FlipperServerDisconnectedError extends Error {
constructor(reason) {
super(`Flipper Server disconnected. Reason: ${reason}`);
this.reason = reason;
}
}
exports.FlipperServerDisconnectedError = FlipperServerDisconnectedError;
class FlipperServerTimeoutError extends Error {
constructor(msg) {
super(`Flipper Server timeout. Reason: ${msg}`);
}
}
exports.FlipperServerTimeoutError = FlipperServerTimeoutError;
function isError(obj) {

@@ -127,3 +148,3 @@ return (obj instanceof Error ||

// Last resort: toString it.
return '' + e;
return `${e}`;
}

@@ -130,0 +151,0 @@ }

@@ -45,5 +45,4 @@ "use strict";

function LoggerExtractError(...data) {
var _a;
const message = (0, errors_1.getStringFromErrorLike)(data);
const error = (_a = (0, errors_1.getErrorFromErrorLike)(data)) !== null && _a !== void 0 ? _a : new Error(message);
const error = (0, errors_1.getErrorFromErrorLike)(data) ?? new Error(message);
return {

@@ -50,0 +49,0 @@ message,

@@ -60,4 +60,5 @@ "use strict";

function reportPluginFailures(promise, name, plugin) {
const start = performance.now();
return promise.then((fulfilledValue) => {
logPluginSuccessRate(name, plugin, { kind: 'success' });
logPluginSuccessRate(name, plugin, { kind: 'success' }, performance.now() - start);
return fulfilledValue;

@@ -68,3 +69,3 @@ }, (rejectionReason) => {

kind: 'cancelled',
});
}, performance.now() - start);
}

@@ -76,3 +77,3 @@ else {

error: rejectionReason,
});
}, performance.now() - start);
}

@@ -168,8 +169,8 @@ return Promise.reject(rejectionReason);

exports.logPlatformSuccessRate = logPlatformSuccessRate;
function logPluginSuccessRate(name, plugin, result) {
function logPluginSuccessRate(name, plugin, result, durationMs) {
if (result.kind === 'success') {
(0, Logger_1.getLogger)().track('success-rate', name, { value: 1 }, plugin);
(0, Logger_1.getLogger)().track('success-rate', name, { value: 1, durationMs }, plugin);
}
else if (result.kind === 'cancelled') {
(0, Logger_1.getLogger)().track('operation-cancelled', name, undefined, plugin);
(0, Logger_1.getLogger)().track('operation-cancelled', name, { durationMs }, plugin);
}

@@ -179,2 +180,3 @@ else {

value: 0,
durationMs,
supportedOperation: result.supportedOperation ? 1 : 0,

@@ -181,0 +183,0 @@ error: extractMessage(result.error),

{
"name": "flipper-common",
"version": "0.212.0",
"version": "0.259.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc