@iebh/tera-fy 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/terafy.js +14 -3
- package/dist/terafy.js.map +4 -4
- package/docs/terafy.client.md +114 -85
- package/docs/terafy.server.md +220 -98
- package/index.html +52 -4
- package/lib/terafy.client.js +54 -15
- package/lib/terafy.server.js +198 -51
- package/package.json +2 -1
package/docs/terafy.client.md
CHANGED
|
@@ -1,100 +1,93 @@
|
|
|
1
|
+
## Classes
|
|
2
|
+
|
|
3
|
+
<dl>
|
|
4
|
+
<dt><a href="#TeraFy">TeraFy</a></dt>
|
|
5
|
+
<dd></dd>
|
|
6
|
+
</dl>
|
|
7
|
+
|
|
8
|
+
## Functions
|
|
9
|
+
|
|
10
|
+
<dl>
|
|
11
|
+
<dt><a href="#send">send(message)</a> ⇒ <code>Promise.<*></code></dt>
|
|
12
|
+
<dd><p>Send a message + wait for a response object</p>
|
|
13
|
+
</dd>
|
|
14
|
+
<dt><a href="#sendRaw">sendRaw(message)</a></dt>
|
|
15
|
+
<dd><p>Send raw message content to the server
|
|
16
|
+
This function does not return or wait for a reply - use <code>send()</code> for that</p>
|
|
17
|
+
</dd>
|
|
18
|
+
<dt><a href="#rpc">rpc(method)</a> ⇒ <code>Promise.<*></code></dt>
|
|
19
|
+
<dd><p>Call an RPC function in the server instance</p>
|
|
20
|
+
</dd>
|
|
21
|
+
<dt><a href="#acceptMessage">acceptMessage(Raw)</a></dt>
|
|
22
|
+
<dd><p>Accept an incoming message</p>
|
|
23
|
+
</dd>
|
|
24
|
+
<dt><a href="#toggleDevMode">toggleDevMode([devModeEnabled])</a> ⇒ <code><a href="#TeraFy">TeraFy</a></code></dt>
|
|
25
|
+
<dd><p>Set or toggle devMode</p>
|
|
26
|
+
</dd>
|
|
27
|
+
<dt><a href="#init">init()</a></dt>
|
|
28
|
+
<dd><p>Initalize the TERA client singleton</p>
|
|
29
|
+
</dd>
|
|
30
|
+
<dt><a href="#injectMain">injectMain()</a></dt>
|
|
31
|
+
<dd><p>Find an existing active TERA server OR initalize one</p>
|
|
32
|
+
</dd>
|
|
33
|
+
<dt><a href="#injectStylesheet">injectStylesheet()</a></dt>
|
|
34
|
+
<dd><p>Inject a local stylesheet to handle TERA server functionality</p>
|
|
35
|
+
</dd>
|
|
36
|
+
<dt><a href="#injectMethods">injectMethods()</a></dt>
|
|
37
|
+
<dd><p>Inject all server methods defined in <code>methods</code> as local functions wrapped in the <code>rpc</code> function</p>
|
|
38
|
+
</dd>
|
|
39
|
+
<dt><a href="#debug">debug()</a></dt>
|
|
40
|
+
<dd><p>Debugging output function
|
|
41
|
+
This function will only act if <code>settings.devMode</code> is truthy</p>
|
|
42
|
+
</dd>
|
|
43
|
+
<dt><a href="#bindProjectState">bindProjectState([options], Paths)</a> ⇒ <code>Promies.<Reactive.<Object>></code></dt>
|
|
44
|
+
<dd><p>Return a Vue reactive object that can be read/written which whose changes will transparently be written back to the TERA server instance</p>
|
|
45
|
+
</dd>
|
|
46
|
+
<dt><a href="#toggleFocus">toggleFocus([isFocused])</a></dt>
|
|
47
|
+
<dd><p>Fit the nested TERA server to a full-screen
|
|
48
|
+
This is usually because the server component wants to perform some user activity like calling $prompt</p>
|
|
49
|
+
</dd>
|
|
50
|
+
</dl>
|
|
51
|
+
|
|
1
52
|
<a name="TeraFy"></a>
|
|
2
53
|
|
|
3
54
|
## TeraFy
|
|
4
55
|
**Kind**: global class
|
|
5
|
-
|
|
6
|
-
* [TeraFy](#TeraFy)
|
|
7
|
-
* [new TeraFy()](#new_TeraFy_new)
|
|
8
|
-
* [.settings](#TeraFy+settings) : <code>Object</code>
|
|
9
|
-
* [.dom](#TeraFy+dom) : <code>Object</code>
|
|
10
|
-
* [.methods](#TeraFy+methods) : <code>Array.<String></code>
|
|
11
|
-
* [.acceptPostboxes](#TeraFy+acceptPostboxes)
|
|
12
|
-
* [.send(message)](#TeraFy+send) ⇒ <code>Promise.<\*></code>
|
|
13
|
-
* [.sendRaw(message)](#TeraFy+sendRaw)
|
|
14
|
-
* [.rpc(method)](#TeraFy+rpc) ⇒ <code>Promise.<\*></code>
|
|
15
|
-
* [.acceptMessage(Raw)](#TeraFy+acceptMessage)
|
|
16
|
-
* [.init()](#TeraFy+init)
|
|
17
|
-
* [.injectMain()](#TeraFy+injectMain)
|
|
18
|
-
* [.injectStylesheet()](#TeraFy+injectStylesheet)
|
|
19
|
-
* [.injectMethods()](#TeraFy+injectMethods)
|
|
20
|
-
* [.bindProjectState([options], Paths)](#TeraFy+bindProjectState) ⇒ <code>Promies.<Reactive.<Object>></code>
|
|
21
|
-
|
|
22
56
|
<a name="new_TeraFy_new"></a>
|
|
23
57
|
|
|
24
58
|
### new TeraFy()
|
|
25
59
|
Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
26
60
|
|
|
27
|
-
<a name="
|
|
28
|
-
|
|
29
|
-
### teraFy.settings : <code>Object</code>
|
|
30
|
-
Various settings to configure behaviour
|
|
31
|
-
|
|
32
|
-
**Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
|
|
33
|
-
**Properties**
|
|
34
|
-
|
|
35
|
-
| Name | Type | Description |
|
|
36
|
-
| --- | --- | --- |
|
|
37
|
-
| devMode | <code>Boolean</code> | Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance |
|
|
38
|
-
| siteUrl | <code>String</code> | The TERA URL to connect to |
|
|
39
|
-
| restrictOrigin | <code>String</code> | URL to restrict communications to |
|
|
40
|
-
|
|
41
|
-
<a name="TeraFy+dom"></a>
|
|
42
|
-
|
|
43
|
-
### teraFy.dom : <code>Object</code>
|
|
44
|
-
DOMElements for this TeraFy instance
|
|
61
|
+
<a name="send"></a>
|
|
45
62
|
|
|
46
|
-
|
|
47
|
-
**Properties**
|
|
48
|
-
|
|
49
|
-
| Name | Type | Description |
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| el | <code>DOMElement</code> | The main tera-fy div wrapper |
|
|
52
|
-
| iframe | <code>DOMElement</code> | The internal iFrame element |
|
|
53
|
-
| stylesheet | <code>DOMElement</code> | The corresponding stylesheet |
|
|
54
|
-
|
|
55
|
-
<a name="TeraFy+methods"></a>
|
|
56
|
-
|
|
57
|
-
### teraFy.methods : <code>Array.<String></code>
|
|
58
|
-
List of function stubs mapped here from the server
|
|
59
|
-
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
60
|
-
|
|
61
|
-
**Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
|
|
62
|
-
<a name="TeraFy+acceptPostboxes"></a>
|
|
63
|
-
|
|
64
|
-
### teraFy.acceptPostboxes
|
|
65
|
-
Listening postboxes, these correspond to outgoing message IDs that expect a response
|
|
66
|
-
|
|
67
|
-
**Kind**: instance property of [<code>TeraFy</code>](#TeraFy)
|
|
68
|
-
<a name="TeraFy+send"></a>
|
|
69
|
-
|
|
70
|
-
### teraFy.send(message) ⇒ <code>Promise.<\*></code>
|
|
63
|
+
## send(message) ⇒ <code>Promise.<\*></code>
|
|
71
64
|
Send a message + wait for a response object
|
|
72
65
|
|
|
73
|
-
**Kind**:
|
|
66
|
+
**Kind**: global function
|
|
74
67
|
**Returns**: <code>Promise.<\*></code> - A promise which resolves when the operation has completed with the remote reply
|
|
75
68
|
|
|
76
69
|
| Param | Type | Description |
|
|
77
70
|
| --- | --- | --- |
|
|
78
71
|
| message | <code>Object</code> | Message object to send |
|
|
79
72
|
|
|
80
|
-
<a name="
|
|
73
|
+
<a name="sendRaw"></a>
|
|
81
74
|
|
|
82
|
-
|
|
75
|
+
## sendRaw(message)
|
|
83
76
|
Send raw message content to the server
|
|
84
77
|
This function does not return or wait for a reply - use `send()` for that
|
|
85
78
|
|
|
86
|
-
**Kind**:
|
|
79
|
+
**Kind**: global function
|
|
87
80
|
|
|
88
81
|
| Param | Type | Description |
|
|
89
82
|
| --- | --- | --- |
|
|
90
83
|
| message | <code>Object</code> | Message object to send |
|
|
91
84
|
|
|
92
|
-
<a name="
|
|
85
|
+
<a name="rpc"></a>
|
|
93
86
|
|
|
94
|
-
|
|
87
|
+
## rpc(method) ⇒ <code>Promise.<\*></code>
|
|
95
88
|
Call an RPC function in the server instance
|
|
96
89
|
|
|
97
|
-
**Kind**:
|
|
90
|
+
**Kind**: global function
|
|
98
91
|
**Returns**: <code>Promise.<\*></code> - The resolved output of the server function
|
|
99
92
|
|
|
100
93
|
| Param | Type | Description |
|
|
@@ -102,47 +95,71 @@ Call an RPC function in the server instance
|
|
|
102
95
|
| method | <code>String</code> | The method name to call |
|
|
103
96
|
| [...] | <code>\*</code> | Optional arguments to pass to the function |
|
|
104
97
|
|
|
105
|
-
<a name="
|
|
98
|
+
<a name="acceptMessage"></a>
|
|
106
99
|
|
|
107
|
-
|
|
100
|
+
## acceptMessage(Raw)
|
|
108
101
|
Accept an incoming message
|
|
109
102
|
|
|
110
|
-
**Kind**:
|
|
103
|
+
**Kind**: global function
|
|
111
104
|
|
|
112
105
|
| Param | Type | Description |
|
|
113
106
|
| --- | --- | --- |
|
|
114
107
|
| Raw | <code>MessageEvent</code> | message event to process |
|
|
115
108
|
|
|
116
|
-
<a name="
|
|
109
|
+
<a name="toggleDevMode"></a>
|
|
110
|
+
|
|
111
|
+
## toggleDevMode([devModeEnabled]) ⇒ [<code>TeraFy</code>](#TeraFy)
|
|
112
|
+
Set or toggle devMode
|
|
117
113
|
|
|
118
|
-
|
|
114
|
+
**Kind**: global function
|
|
115
|
+
**Returns**: [<code>TeraFy</code>](#TeraFy) - This chainable terafy instance
|
|
116
|
+
|
|
117
|
+
| Param | Type | Default | Description |
|
|
118
|
+
| --- | --- | --- | --- |
|
|
119
|
+
| [devModeEnabled] | <code>String</code> \| <code>Boolean</code> | <code>'toggle'</code> | Optional boolean to force dev mode |
|
|
120
|
+
|
|
121
|
+
<a name="init"></a>
|
|
122
|
+
|
|
123
|
+
## init()
|
|
119
124
|
Initalize the TERA client singleton
|
|
120
125
|
|
|
121
|
-
**Kind**:
|
|
122
|
-
<a name="
|
|
126
|
+
**Kind**: global function
|
|
127
|
+
<a name="injectMain"></a>
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
## injectMain()
|
|
125
130
|
Find an existing active TERA server OR initalize one
|
|
126
131
|
|
|
127
|
-
**Kind**:
|
|
128
|
-
<a name="
|
|
132
|
+
**Kind**: global function
|
|
133
|
+
<a name="injectStylesheet"></a>
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
## injectStylesheet()
|
|
131
136
|
Inject a local stylesheet to handle TERA server functionality
|
|
132
137
|
|
|
133
|
-
**Kind**:
|
|
134
|
-
<a name="
|
|
138
|
+
**Kind**: global function
|
|
139
|
+
<a name="injectMethods"></a>
|
|
135
140
|
|
|
136
|
-
|
|
141
|
+
## injectMethods()
|
|
137
142
|
Inject all server methods defined in `methods` as local functions wrapped in the `rpc` function
|
|
138
143
|
|
|
139
|
-
**Kind**:
|
|
140
|
-
<a name="
|
|
144
|
+
**Kind**: global function
|
|
145
|
+
<a name="debug"></a>
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
## debug()
|
|
148
|
+
Debugging output function
|
|
149
|
+
This function will only act if `settings.devMode` is truthy
|
|
150
|
+
|
|
151
|
+
**Kind**: global function
|
|
152
|
+
|
|
153
|
+
| Param | Type | Description |
|
|
154
|
+
| --- | --- | --- |
|
|
155
|
+
| [msg...] | <code>String</code> | Output to show |
|
|
156
|
+
|
|
157
|
+
<a name="bindProjectState"></a>
|
|
158
|
+
|
|
159
|
+
## bindProjectState([options], Paths) ⇒ <code>Promies.<Reactive.<Object>></code>
|
|
143
160
|
Return a Vue reactive object that can be read/written which whose changes will transparently be written back to the TERA server instance
|
|
144
161
|
|
|
145
|
-
**Kind**:
|
|
162
|
+
**Kind**: global function
|
|
146
163
|
**Returns**: <code>Promies.<Reactive.<Object>></code> - A reactive object representing the project state
|
|
147
164
|
|
|
148
165
|
| Param | Type | Default | Description |
|
|
@@ -152,3 +169,15 @@ Return a Vue reactive object that can be read/written which whose changes will t
|
|
|
152
169
|
| [options.write] | <code>Boolean</code> | <code>true</code> | Allow local reactivity to writes - send these to the server |
|
|
153
170
|
| Paths | <code>Array.<String></code> | | to subscribe to e.g. ['/users/'], |
|
|
154
171
|
|
|
172
|
+
<a name="toggleFocus"></a>
|
|
173
|
+
|
|
174
|
+
## toggleFocus([isFocused])
|
|
175
|
+
Fit the nested TERA server to a full-screen
|
|
176
|
+
This is usually because the server component wants to perform some user activity like calling $prompt
|
|
177
|
+
|
|
178
|
+
**Kind**: global function
|
|
179
|
+
|
|
180
|
+
| Param | Type | Default | Description |
|
|
181
|
+
| --- | --- | --- | --- |
|
|
182
|
+
| [isFocused] | <code>String</code> \| <code>Boolean</code> | <code>'toggle'</code> | Whether to fullscreen the embedded component |
|
|
183
|
+
|