@openfin/bloomberg
Advanced tools
Comparing version 1.2.0 to 2.0.0-beta.1
{ | ||
"name": "@openfin/bloomberg", | ||
"description": "Connect apps running in OpenFin with the Bloomberg Terminal.", | ||
"version": "1.2.0", | ||
"version": "2.0.0-beta.1", | ||
"author": "OpenFin Inc.", | ||
@@ -17,7 +17,2 @@ "homepage": "https://www.openfin.co/", | ||
"require": "./openfin.bloomberg.cjs" | ||
}, | ||
"./terminal": { | ||
"types": "./terminal/index.d.ts", | ||
"import": "./terminal/terminal.mjs", | ||
"require": "./terminal/terminal.cjs" | ||
} | ||
@@ -24,0 +19,0 @@ }, |
@@ -0,16 +1,12 @@ | ||
import type OpenFin from '@openfin/core'; | ||
import { DispatchChannelClientMessage } from '../adapter/adapter.types'; | ||
import { ApiError } from '../errors/errors'; | ||
import { IGroup } from '../terminal/bb-apps-terminal'; | ||
import { BloombergGroup, BloombergPanel } from './bloomberg.types'; | ||
import { TerminalConnectApiTypes as TC } from '../terminal-connect/terminal-connect.types'; | ||
import { BloombergPanel, TerminalConnectSubscription } from './bloomberg.types'; | ||
export declare const DEFAULT_TARGET: BloombergPanel; | ||
export declare const getBloombergGroupEventHandler: (bloombergGroup: BloombergGroup, onGroupEvent?: ((context: unknown) => void) | undefined, onError?: ((error: ApiError) => void) | undefined) => (group: IGroup, cookie: any) => Promise<void>; | ||
/** | ||
* Determines if the local Bloomberg Terminal service is ready for API calls. | ||
* | ||
* @returns true if a connection has been made to the Terminal , otherwise false. | ||
* | ||
* @throws {@link AppNotAuthorizedError} if the application is not authorized to connect to the Terminal. | ||
* @throws {@link ApiError} if any other error occurs. | ||
*/ | ||
export declare const isBloombergTerminalReady: () => Promise<boolean>; | ||
export declare const runFunctionInTerminal: (target: BloombergGroup | BloombergPanel, mnemonic: string, security1?: string, security2?: string, tails?: string) => Promise<void>; | ||
export declare const setGroupSecurity: (groupName: BloombergGroup, security: string) => Promise<void>; | ||
export declare const createGroupEventsSubscription: (dispatchAdapterMessage: DispatchChannelClientMessage, groupFilter: string, onContextChanged?: ((context: unknown) => void) | undefined, onError?: ((error: ApiError) => void) | undefined) => Promise<TerminalConnectSubscription>; | ||
export declare const unsubscribeGroupEvents: (dispatchAdapterMessage: DispatchChannelClientMessage, subscriptionId: string) => () => Promise<void>; | ||
export declare const getBloombergGroupEventListener: (onGroupEvent?: ((context: unknown) => void) | undefined, onError?: ((error: ApiError) => void) | undefined) => (context: OpenFin.Context) => Promise<void>; | ||
export declare const handleGroupEvent: (subscriptionId: string, data: TC.TerminalConnectGroupEvent) => Promise<void>; | ||
export declare const getGroupIdsFromFilter: (dispatchAdapterMessage: DispatchChannelClientMessage) => (groupFilter: string) => Promise<number[]>; | ||
export declare const updateGroupSecurity: (dispatchAdapterMessage: DispatchChannelClientMessage) => (groupFilter: string, security: string) => Promise<void>; |
@@ -0,6 +1,3 @@ | ||
import type OpenFin from '@openfin/core'; | ||
/** | ||
* Bloomberg Launchpad group name ('*' represents all groups). | ||
*/ | ||
export type BloombergGroup = '*' | string; | ||
/** | ||
* Bloomberg security market sector. | ||
@@ -11,3 +8,12 @@ */ | ||
* Bloomberg Terminal panel ID. | ||
* | ||
* @group Types | ||
*/ | ||
export type BloombergPanel = 1 | 2 | 3 | 4; | ||
export type BloombergPanel = 0 | 1 | 2 | 3; | ||
export type Subscription = { | ||
unsubscribe: () => void | Promise<void>; | ||
}; | ||
export type TerminalConnectSubscription = Subscription & { | ||
id: string; | ||
listener: (context: OpenFin.Context) => Promise<void>; | ||
}; |
@@ -0,1 +1,3 @@ | ||
import { DispatchChannelClientMessage } from '../adapter/adapter.types'; | ||
import { Subscription } from '../bloomberg/bloomberg.types'; | ||
import { BloombergConnection, BloombergConnectionConfig } from './connection.types'; | ||
@@ -12,5 +14,3 @@ /** | ||
*/ | ||
export declare const connect: (config?: BloombergConnectionConfig) => Promise<BloombergConnection>; | ||
export declare const getDisconnectHandler: (registrations?: Array<{ | ||
unsubscribe: () => void | Promise<void>; | ||
}>, groupSubscriptionId?: number) => () => Promise<void>; | ||
export declare const connect: (apiKey: string, config?: BloombergConnectionConfig) => Promise<BloombergConnection>; | ||
export declare const disconnect: (dispatchAdapterMessage: DispatchChannelClientMessage, subscriptions?: Subscription[]) => () => Promise<void>; |
@@ -1,2 +0,2 @@ | ||
import { BloombergGroup, BloombergPanel } from '../bloomberg/bloomberg.types'; | ||
import { BloombergPanel } from '../bloomberg/bloomberg.types'; | ||
import { ApiError } from '../errors/errors'; | ||
@@ -8,9 +8,13 @@ /** | ||
* | ||
* If the action is a {@link BloombergGroup | group name}, the group’s security will be updated when handling {@link https://fdc3.finos.org/docs/context/ref/Instrument | instrument} | ||
* If the action is a group name, the group’s security will be updated when handling {@link https://fdc3.finos.org/docs/context/ref/Instrument | instrument} | ||
* contexts. | ||
* | ||
* @group Types | ||
*/ | ||
export type BloombergAction = BloombergTerminalCommand | BloombergGroup; | ||
export type BloombergAction = BloombergTerminalCommand | string; | ||
/** | ||
* Configuration determining which {@link https://developers.openfin.co/of-docs/docs/interoperability-overview#context | context types} and | ||
* {@link https://developers.openfin.co/of-docs/docs/interoperability-overview#intent | intents} will be handled by the Bloomberg Terminal, and how. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -26,9 +30,15 @@ export type BloombergActionsConfig = { | ||
* with other OpenFin apps. | ||
* | ||
* @group Types | ||
*/ | ||
export type BloombergConnection = { | ||
apiKey: string; | ||
/** Closes the connection preventing context types and intents from being handled by the Bloomberg Terminal. */ | ||
disconnect: () => Promise<void>; | ||
executeApiRequest: <T = unknown>(query: string) => Promise<T>; | ||
}; | ||
/** | ||
* Configuration for a Bloomberg Connection. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -39,3 +49,3 @@ export type BloombergConnectionConfig = { | ||
/** Bloomberg Launchpad group that will set context whenever the group’s security changes. */ | ||
group?: BloombergGroup; | ||
group?: string; | ||
/** | ||
@@ -56,2 +66,4 @@ * Callback that will be triggered whenever context changes. | ||
* Command that will be handled by the Bloomberg Terminal. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -68,2 +80,4 @@ export type BloombergTerminalCommand = { | ||
* Map associating context types with their corresponding actions. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -73,2 +87,4 @@ export type ContextActionMap = Map<ContextType, BloombergAction | undefined>; | ||
* Type name of a {@link https://developers.openfin.co/of-docs/docs/interoperability-overview#context | context} object. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -78,2 +94,4 @@ export type ContextType = string; | ||
* Map associating intents with their corresponding context types and actions. | ||
* | ||
* @group Types | ||
*/ | ||
@@ -83,3 +101,5 @@ export type IntentActionMap = Map<IntentName, ContextActionMap | undefined>; | ||
* Name of an {@link https://developers.openfin.co/of-docs/docs/interoperability-overview#intent | intent}. | ||
* | ||
* @group Types | ||
*/ | ||
export type IntentName = string; |
/** | ||
* Gets the relevant API error for a given Terminal Connect API error. | ||
* @param error - Error generated by Terminal Connect API. | ||
* Base class for custom errors throw by the API. | ||
* | ||
* @internal | ||
* @group Errors | ||
*/ | ||
export declare const getApiErrorFromError: (error: Error) => ApiError; | ||
export declare class ApiError extends Error { | ||
data?: unknown; | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Base class for custom errors throw by the API. | ||
* Describes errors thrown by adapter. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class ApiError extends Error { | ||
/** Originating error (if present). */ | ||
innerError: any | undefined; | ||
constructor(message?: string, innerError?: any); | ||
export declare class AdapterError extends ApiError { | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Error class used when the calling app has not been registered with Bloomberg to use the Terminal Connect API. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class AppNotAuthorizedError extends ApiError { | ||
constructor(message?: string, innerError?: any); | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Describes errors thrown when initializing adapter. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class InitializationError extends ApiError { | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Error class used when an interop operation results in an error. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class InteropError extends ApiError { | ||
constructor(message?: string, innerError?: any); | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Describes errors thrown when invalid parameter values are provided to API functions. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class ParameterError extends ApiError { | ||
/** | ||
* @param message Description of the error. | ||
*/ | ||
constructor(message?: string); | ||
} | ||
/** | ||
* Error class used when Bloomberg Terminal returns an error when attempting to run a function. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class TerminalCommandError extends ApiError { | ||
constructor(message?: string, innerError?: any); | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Error class used when unable to communicate with the local Bloomberg Terminal instance. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class TerminalConnectionError extends ApiError { | ||
constructor(message?: string, innerError?: any); | ||
constructor(message?: string, data?: unknown); | ||
} | ||
/** | ||
* Error class used when a request to the Terminal Connect API fails. | ||
* | ||
* @group Errors | ||
*/ | ||
export declare class TerminalConnectRequestError extends ApiError { | ||
constructor(message?: string, data?: unknown); | ||
} |
@@ -1,3 +0,2 @@ | ||
export { isBloombergTerminalReady } from './bloomberg/bloomberg'; | ||
export { BloombergGroup, BloombergPanel } from './bloomberg/bloomberg.types'; | ||
export { BloombergPanel } from './bloomberg/bloomberg.types'; | ||
export { connect } from './connection/connection'; | ||
@@ -8,2 +7,3 @@ export { BloombergAction, BloombergActionsConfig, BloombergConnection, BloombergConnectionConfig, BloombergTerminalCommand, ContextActionMap, ContextType, IntentActionMap, IntentName, } from './connection/connection.types'; | ||
export { disableLogging, enableLogging } from './logger/logger'; | ||
export { TerminalConnectApiTypes } from './terminal-connect/terminal-connect.types'; | ||
export { isCusip, isEquity, isFigi, isIsin } from './utils/utils'; |
@@ -0,0 +0,0 @@ export declare const FDC3_CONTEXT_TYPE_CONTACT = "fdc3.contact"; |
@@ -0,7 +1,6 @@ | ||
import { DispatchChannelClientMessage } from '../adapter/adapter.types'; | ||
import { Subscription } from '../bloomberg/bloomberg.types'; | ||
import { BloombergActionsConfig } from '../connection/connection.types'; | ||
import { ApiError } from '../errors/errors'; | ||
/** @internal */ | ||
export declare const getDefaultActions: () => BloombergActionsConfig; | ||
export declare const getInteropRegistrations: (actions?: BloombergActionsConfig, onContextChanged?: ((context: unknown) => void) | undefined, onError?: ((error: ApiError) => void) | undefined) => Promise<Array<{ | ||
unsubscribe: () => void | Promise<void>; | ||
}>>; | ||
export declare const getInteropSubscriptions: (dispatchAdapterMessage: DispatchChannelClientMessage, actions?: BloombergActionsConfig, onContextChanged?: ((context: unknown) => void) | undefined, onError?: ((error: ApiError) => void) | undefined) => Promise<Subscription[]>; |
@@ -1,4 +0,4 @@ | ||
import type * as fdc3 from '@finos/fdc3'; | ||
export type BloombergApiContext = fdc3.Context & { | ||
import type OpenFin from '@openfin/core'; | ||
export type BloombergApiContext = OpenFin.Context & { | ||
openfinBbgApi: boolean; | ||
}; |
@@ -19,4 +19,4 @@ /** | ||
export declare const enableLogging: () => void; | ||
export declare const logError: (error: any, errorPrefix?: string) => void; | ||
export declare const logError: (error: unknown, errorPrefix?: string) => void; | ||
export declare const logInfo: (...args: any[]) => void; | ||
export declare const logWarning: (...args: any[]) => void; |
@@ -1,5 +0,6 @@ | ||
import type * as fdc3 from '@finos/fdc3'; | ||
import type OpenFin from '@openfin/core'; | ||
import { UsageFeatureName } from './utils.types'; | ||
export declare const getInstrumentContextFromSecurity: (security: string) => fdc3.Context; | ||
export declare const getSecurityFromInstrumentContext: (context: fdc3.Instrument) => string | undefined; | ||
export declare const getApiVersion: () => string; | ||
export declare const getInstrumentContextFromSecurity: (security: string) => OpenFin.Context; | ||
export declare const getSecurityFromInstrumentContext: (context: OpenFin.Context) => string | undefined; | ||
/** | ||
@@ -29,2 +30,6 @@ * Determines if the provided text is a {@link https://www.cusip.com/cusip/index.htm | CUSIP}. | ||
export declare const isIsin: (text: string) => boolean; | ||
/** | ||
* Polyfills `crypto.randomUUID` if running in a non-secure context. | ||
*/ | ||
export declare const randomUUID: () => string; | ||
export declare const registerUsage: (featureName: UsageFeatureName) => Promise<void>; |
@@ -0,0 +0,0 @@ export type UsageData = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
435
56923
1
1