@io-maana/q-assistant-client v3.2.3
q-assistant-client
A lightweight JavaScript client for Maana-Q Assistant developers that wraps post-message communication between an embedded Maana-Q assistant and the Maana-Q UI.
Usage
This is intented to be used in a web application being leveraged as a Maana Q assistant (embedded as an iframe). This assistant client will facilitate communication between the assistant and the parent frame. The client provides a rich, asynchronous experience over what would otherwise be 'fire-and-forget'-style messaging via post-post message communication.
Requirements and Assumptions
@TODO Logan
Singleton Instance
The client is exported as a singleton to avoid duplicate registration on event listeners. You can import the instance like this:
import AssistantAPIClient from '@io-maana/q-assistant-client';
Interacting with the API
API Surface Area
Function Calls
Function calls can be made against the client like any other javascript object. They are all async.
const workspace = await AssistantAPIClient.getWorkspace();
console.log("Workspace:", workspace)
const functions = await workspace.getFunctions()
console.log("Functions:", functions)
Event Subscription
Only workspace selection events are currently supported. Subscriptions are added explictly by registering a callback:
AssistantAPIClient.addSelectionChangedListener((selection)=>{
console.log('Workspace selection changed:', selection)
})
These are removed on a per-callback basis with the 'removeSelectionChangedListener' call.
Dependencies
Post-Robot https://github.com/krakenjs/post-robot
Post-robot is used to provide a richer communication layer atop post-message.
Examples
@TODO Logan
API Documentation
@TODO Logan This will presumably link to Gitbook Maana Q Documentation that explicates the full K Portal API functionality.
1 year ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago