@plexus-interop/common-api-impl
v0.19.1
Published
Common API implementation
Downloads
21
Readme
Implementation for Common API Draft Proposal
Partial implementation for Common Interop API.
Metadata Setup
Plexus Interop based on Metadata, so each application interracting via Common API should still be defined in metatada.
- All Methods/Streams/Messages must be defined as regular Plexus Messages and Services
- Method/Stream names, used from client code, should refer to aliases of provided actions. E.g. method, used like below:
peer.invoke('close-market-order', { orderId });
should be defined in metadata by action provider as following:
application ProviderApplication {
provides OrderService {
CloseMarketOrder [(provided_method_alias) = "close-market-order" ];
}
}
- All apps should be also marked with aliases in metadata to be discovered by Common API, e.g.: application connecting to Plexus using
const peer = await window.platform.connect('web-trader-client');
should be mapped via custom option like this:
application WebTraderClient {
option (app_alias) = "web-trader-client";
}
Implemented features
API is implemented partially, all other methods raise Method not implemented
error. Available features can be checked via feature flags API. Here is the list of supported functionality:
InvokeMethod
SubscribeStream
RegisterMethodOnConnect
RegisterStreamOnConnect
DiscoverMethods
DiscoverStreams