3.2.3 • Published 3 years ago

@io-maana/q-assistant-client v3.2.3

Weekly downloads
51
License
MIT
Repository
github
Last release
3 years ago

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.

3.3.0-beta.20

3 years ago

3.2.4-beta.40

3 years ago

3.3.0-beta.18

4 years ago

3.3.0-beta.17

4 years ago

3.3.0-beta.15

4 years ago

3.3.0-beta.16

4 years ago

3.3.0-beta.13

4 years ago

3.3.0-beta.11

4 years ago

3.3.0-beta.10

4 years ago

3.3.0-beta.9

4 years ago

3.3.0-beta.8

4 years ago

3.3.0-beta.7

4 years ago

3.3.0-beta.6

4 years ago

3.3.0-beta.5

5 years ago

3.3.0-beta.4

5 years ago

3.3.0-beta.2

5 years ago

3.2.4-beta.39

5 years ago

3.2.3-beta.38

5 years ago

3.2.3

5 years ago

3.2.3-beta.37

5 years ago

3.2.3-beta.36

5 years ago

3.2.3-beta.35

5 years ago

3.2.2

5 years ago

3.2.2-beta.34

5 years ago

3.2.2-beta.33

5 years ago

3.2.2-beta.32

5 years ago

3.2.2-beta.31

5 years ago

3.2.2-beta.30

5 years ago

3.2.2-beta.28

5 years ago

3.2.2-beta.29

5 years ago

3.2.2-beta.27

5 years ago

3.2.2-beta.26

5 years ago

3.2.2-beta.25

5 years ago

3.2.2-beta.24

5 years ago

3.2.2-beta.23

5 years ago

3.2.2-beta.22

5 years ago

3.2.2-beta.21

5 years ago

3.2.2-beta.20

5 years ago

3.2.2-beta.19

6 years ago

3.2.2-beta.18

6 years ago

3.2.2-beta.17

6 years ago

3.2.1

6 years ago

3.2.2-beta.16

6 years ago

3.2.1-beta.15

6 years ago

3.2.1-beta.14

6 years ago

3.2.1-beta.13

6 years ago

3.2.1-beta.12

6 years ago

3.2.1-beta.11

6 years ago

3.2.1-beta.10

6 years ago

3.2.1-beta.9

6 years ago

3.2.1-beta.8

6 years ago

3.2.1-beta.7

6 years ago

3.2.1-beta.6

6 years ago

3.2.1-beta.5

6 years ago

3.2.1-beta.4

6 years ago

3.2.1-beta.3

6 years ago

3.2.1-beta.2

6 years ago

3.2.1-beta.1

6 years ago