@iebh/tera-fy 1.0.11 → 1.0.13
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/README.md +12 -0
- package/api.md +324 -222
- package/dist/plugin.vue2.es2019.js +15 -0
- package/dist/plugin.vue2.es2019.js.map +7 -0
- package/dist/terafy.es2019.js +16 -0
- package/dist/terafy.es2019.js.map +7 -0
- package/dist/terafy.js +2 -2
- package/dist/terafy.js.map +4 -4
- package/lib/terafy.client.js +47 -11
- package/lib/terafy.server.js +29 -60
- package/package.json +3 -1
- package/plugins/vue2.js +32 -9
- package/.storybook/main.js +0 -22
- package/.storybook/preview.js +0 -17
- package/docs/assets/anchor.js +0 -350
- package/docs/assets/bass-addons.css +0 -12
- package/docs/assets/bass.css +0 -544
- package/docs/assets/fonts/EOT/SourceCodePro-Bold.eot +0 -0
- package/docs/assets/fonts/EOT/SourceCodePro-Regular.eot +0 -0
- package/docs/assets/fonts/LICENSE.txt +0 -93
- package/docs/assets/fonts/OTF/SourceCodePro-Bold.otf +0 -0
- package/docs/assets/fonts/OTF/SourceCodePro-Regular.otf +0 -0
- package/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf +0 -0
- package/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf +0 -0
- package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff +0 -0
- package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff +0 -0
- package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff +0 -0
- package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff +0 -0
- package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 +0 -0
- package/docs/assets/fonts/source-code-pro.css +0 -23
- package/docs/assets/github.css +0 -123
- package/docs/assets/site.js +0 -168
- package/docs/assets/split.css +0 -15
- package/docs/assets/split.js +0 -782
- package/docs/assets/style.css +0 -147
- package/docs/index.html +0 -3636
- package/docs/playground.html +0 -342
package/docs/playground.html
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<title>Tera-Fy documentation</title>
|
|
4
|
-
|
|
5
|
-
<!-- 3rd party libraries -->
|
|
6
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.3.6/vue.global.min.js" integrity="sha512-y5PnNJyq3UHlylzZhPzDDyrYC2pmfjBjlcaJL5fhzjj5EcUAYKeELoeCUT0Jc+r5IWzRgNGDE1XVxDAtkpdRlw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
7
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" integrity="sha512-b2QcS5SsA8tZodcDtGRELiGv5SaKSk1vDHDaQRda0htPYWZ6046lr3kJ5bAAQdpV2mmA/4v0wQF9MyU6/pDIAg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
8
|
-
|
|
9
|
-
<style>
|
|
10
|
-
.list-group-item-action {
|
|
11
|
-
user-select: none;
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.list-group-item-action select.form-control {
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
max-width: 100%;
|
|
19
|
-
}
|
|
20
|
-
</style>
|
|
21
|
-
|
|
22
|
-
<script type="module">
|
|
23
|
-
import TeraFy from 'https://esm.run/@iebh/tera-fy';
|
|
24
|
-
|
|
25
|
-
Vue.createApp({
|
|
26
|
-
data() { return {
|
|
27
|
-
/**
|
|
28
|
-
* Actual TeraFy instance to use in testing
|
|
29
|
-
* @type {TeraFy}
|
|
30
|
-
*/
|
|
31
|
-
terafy: new TeraFy({
|
|
32
|
-
devMode: true,
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Last response from a method
|
|
37
|
-
* @type {String}
|
|
38
|
-
*/
|
|
39
|
-
response: '(Nothing)',
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Whether the last response was classed as an error
|
|
43
|
-
* @type {Boolean}
|
|
44
|
-
*/
|
|
45
|
-
isError: null,
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Last project list from getProjects()
|
|
49
|
-
* @type {Array<Object>}
|
|
50
|
-
*/
|
|
51
|
-
projects: null,
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Currently selected project
|
|
55
|
-
*/
|
|
56
|
-
project: null,
|
|
57
|
-
}},
|
|
58
|
-
methods: {
|
|
59
|
-
/**
|
|
60
|
-
* Run a named TERA-fy method within a safe context and display the result
|
|
61
|
-
* @param {String} method The method to run
|
|
62
|
-
* @param {*} [args...] Additional method arguments
|
|
63
|
-
*/
|
|
64
|
-
run(method, ...args) {
|
|
65
|
-
Promise.resolve()
|
|
66
|
-
.then(()=> this.terafy[method](...args))
|
|
67
|
-
.then(res => {
|
|
68
|
-
this.response = res === null ? '(null)'
|
|
69
|
-
: res === undefined ? '(undefined)'
|
|
70
|
-
: res;
|
|
71
|
-
|
|
72
|
-
this.isError = false;
|
|
73
|
-
})
|
|
74
|
-
.then(()=> { // Handle some API responses to populate local state {{{
|
|
75
|
-
switch (method) {
|
|
76
|
-
case 'getProjects':
|
|
77
|
-
this.projects = this.response;
|
|
78
|
-
break;
|
|
79
|
-
case 'getProject':
|
|
80
|
-
case 'requireProject':
|
|
81
|
-
case 'selectProject':
|
|
82
|
-
this.project = this.response;
|
|
83
|
-
}
|
|
84
|
-
}) // }}}
|
|
85
|
-
.catch(e => {
|
|
86
|
-
this.response = 'Error: ' + e.toString();
|
|
87
|
-
console.warn('TERA threw error', e);
|
|
88
|
-
this.isError = true;
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
mounted() {
|
|
93
|
-
return this.terafy.init();
|
|
94
|
-
},
|
|
95
|
-
}).mount('#app');
|
|
96
|
-
</script>
|
|
97
|
-
</head>
|
|
98
|
-
<body>
|
|
99
|
-
<div id="app">
|
|
100
|
-
<!-- Nav header {{{ -->
|
|
101
|
-
<nav class="navbar navbar-expand-lg navbar-light bg-light px-4">
|
|
102
|
-
<a href="https://github.com/IEBH/TERA-fy" class="navbar-brand">TERA-fy</a>
|
|
103
|
-
<button type="button" data-toggle="collapse" data-target="#navbarAreas" class="navbar-toggler">
|
|
104
|
-
<span class="navbar-toggler-icon"></span>
|
|
105
|
-
</button>
|
|
106
|
-
<div id="navbarAreas" class="collapse navbar-collapse">
|
|
107
|
-
<ul class="navbar-nav">
|
|
108
|
-
<li class="navbar-item me-1">
|
|
109
|
-
<a href="https://iebh.github.io/TERA-fy" class="btn btn-light">API docs</a>
|
|
110
|
-
</li>
|
|
111
|
-
<li class="navbar-item mr-1">
|
|
112
|
-
<a href="https://iebh.github.io/TERA-fy/playground.html" class="btn btn-primary text-white">Playground</a>
|
|
113
|
-
</li>
|
|
114
|
-
</ul>
|
|
115
|
-
</div>
|
|
116
|
-
<ul class="navbar-nav">
|
|
117
|
-
<li class="navbar-item">
|
|
118
|
-
<a href="https://github.com/IEBH/TERA-fy" class="btn btn-light">
|
|
119
|
-
GitHub
|
|
120
|
-
</a>
|
|
121
|
-
</li>
|
|
122
|
-
</ul>
|
|
123
|
-
</nav>
|
|
124
|
-
<!-- }}} -->
|
|
125
|
-
|
|
126
|
-
<div class="container pt-4">
|
|
127
|
-
<div class="row">
|
|
128
|
-
<div class="col-sm-12 col-md-6">
|
|
129
|
-
|
|
130
|
-
<!-- Client specifics {{{ -->
|
|
131
|
-
<div class="card mb-2">
|
|
132
|
-
<div class="card-header">Client Specifics</div>
|
|
133
|
-
<div class="card-body">
|
|
134
|
-
<div class="list-group">
|
|
135
|
-
<a
|
|
136
|
-
@click="run('toggleFocus')"
|
|
137
|
-
class="list-group-item list-group-item-action"
|
|
138
|
-
>
|
|
139
|
-
terafy.toggleFocus()
|
|
140
|
-
</a>
|
|
141
|
-
|
|
142
|
-
<a
|
|
143
|
-
@click="run('toggleDevMode')"
|
|
144
|
-
class="list-group-item list-group-item-action"
|
|
145
|
-
>
|
|
146
|
-
terafy.toggleDevMode()
|
|
147
|
-
</a>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
<!-- }}} -->
|
|
152
|
-
|
|
153
|
-
<!-- Basics {{{ -->
|
|
154
|
-
<div class="card mb-2">
|
|
155
|
-
<div class="card-header">Basic</div>
|
|
156
|
-
<div class="card-body">
|
|
157
|
-
<div class="list-group">
|
|
158
|
-
<a
|
|
159
|
-
@click="run('handshake')"
|
|
160
|
-
class="list-group-item list-group-item-action"
|
|
161
|
-
>
|
|
162
|
-
terafy.handshake()
|
|
163
|
-
</a>
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
<!-- }}} -->
|
|
168
|
-
|
|
169
|
-
<!-- Session {{{ -->
|
|
170
|
-
<div class="card mb-2">
|
|
171
|
-
<div class="card-header">Session / User</div>
|
|
172
|
-
<div class="card-body">
|
|
173
|
-
<div class="list-group">
|
|
174
|
-
<a
|
|
175
|
-
@click="run('getUser')"
|
|
176
|
-
class="list-group-item list-group-item-action"
|
|
177
|
-
>
|
|
178
|
-
terafy.getUser()
|
|
179
|
-
</a>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
<!-- }}} -->
|
|
184
|
-
|
|
185
|
-
<!-- Projects {{{ -->
|
|
186
|
-
<div class="card mb-2">
|
|
187
|
-
<div class="card-header">Projects</div>
|
|
188
|
-
<div class="card-body">
|
|
189
|
-
<div class="list-group">
|
|
190
|
-
<a
|
|
191
|
-
@click="run('getProject')"
|
|
192
|
-
class="list-group-item list-group-item-action"
|
|
193
|
-
>
|
|
194
|
-
terafy.getProject()
|
|
195
|
-
</a>
|
|
196
|
-
<a
|
|
197
|
-
@click="run('getProjects')"
|
|
198
|
-
class="list-group-item list-group-item-action"
|
|
199
|
-
>
|
|
200
|
-
terafy.getProjects()
|
|
201
|
-
</a>
|
|
202
|
-
<a
|
|
203
|
-
@click="run('setActiveProject', project)"
|
|
204
|
-
class="list-group-item list-group-item-action"
|
|
205
|
-
:class="!projects && 'disabled'"
|
|
206
|
-
>
|
|
207
|
-
<div>terafy.setActiveProject(</div>
|
|
208
|
-
<select
|
|
209
|
-
v-if="projects && projects.length > 0"
|
|
210
|
-
v-model="project"
|
|
211
|
-
class="form-control"
|
|
212
|
-
placeholder="Select project..."
|
|
213
|
-
>
|
|
214
|
-
<option
|
|
215
|
-
v-for="project in projects"
|
|
216
|
-
:key="project.id"
|
|
217
|
-
:value="project.id"
|
|
218
|
-
>
|
|
219
|
-
{{project.id}}
|
|
220
|
-
({{project.name}})
|
|
221
|
-
</option>
|
|
222
|
-
</select>
|
|
223
|
-
<div>)</div>
|
|
224
|
-
</a>
|
|
225
|
-
<a
|
|
226
|
-
@click="run('requireProject')"
|
|
227
|
-
class="list-group-item list-group-item-action"
|
|
228
|
-
>
|
|
229
|
-
terafy.requireProject()
|
|
230
|
-
</a>
|
|
231
|
-
<a
|
|
232
|
-
@click="run('selectProject')"
|
|
233
|
-
class="list-group-item list-group-item-action"
|
|
234
|
-
>
|
|
235
|
-
terafy.selectProject()
|
|
236
|
-
</a>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
<!-- }}} -->
|
|
241
|
-
|
|
242
|
-
<!-- Project State {{{ -->
|
|
243
|
-
<div class="card mb-2">
|
|
244
|
-
<div class="card-header">Project State</div>
|
|
245
|
-
<div class="card-body">
|
|
246
|
-
<div class="list-group">
|
|
247
|
-
<a
|
|
248
|
-
@click="run('getProjectState')"
|
|
249
|
-
class="list-group-item list-group-item-action"
|
|
250
|
-
>
|
|
251
|
-
terafy.getProjectState()
|
|
252
|
-
</a>
|
|
253
|
-
<a
|
|
254
|
-
@click="run('applyProjectStatePatch')"
|
|
255
|
-
class="list-group-item list-group-item-action disabled"
|
|
256
|
-
>
|
|
257
|
-
terafy.applyProjectStatePatch()
|
|
258
|
-
</a>
|
|
259
|
-
<a
|
|
260
|
-
@click="run('subscribeProjectState')"
|
|
261
|
-
class="list-group-item list-group-item-action disabled"
|
|
262
|
-
>
|
|
263
|
-
terafy.subscribeProjectState()
|
|
264
|
-
</a>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
</div>
|
|
268
|
-
<!-- }}} -->
|
|
269
|
-
|
|
270
|
-
<!-- Project Files {{{ -->
|
|
271
|
-
<div class="card mb-2">
|
|
272
|
-
<div class="card-header">Project Files</div>
|
|
273
|
-
<div class="card-body">
|
|
274
|
-
<div class="list-group">
|
|
275
|
-
<a
|
|
276
|
-
@click="run('getProjectFiles')"
|
|
277
|
-
class="list-group-item list-group-item-action"
|
|
278
|
-
>
|
|
279
|
-
terafy.getProjectFiles()
|
|
280
|
-
</a>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</div>
|
|
284
|
-
<!-- }}} -->
|
|
285
|
-
|
|
286
|
-
<!-- Project Libraries {{{ -->
|
|
287
|
-
<div class="card mb-2">
|
|
288
|
-
<div class="card-header">Project Libraries</div>
|
|
289
|
-
<div class="card-body">
|
|
290
|
-
<div class="list-group">
|
|
291
|
-
<a
|
|
292
|
-
@click="run('getProjectLibrary')"
|
|
293
|
-
class="list-group-item list-group-item-action"
|
|
294
|
-
>
|
|
295
|
-
terafy.getProjectLibrary({multiple: false})
|
|
296
|
-
</a>
|
|
297
|
-
<a
|
|
298
|
-
@click="run('getProjectLibrary', {multiple: true})"
|
|
299
|
-
class="list-group-item list-group-item-action"
|
|
300
|
-
>
|
|
301
|
-
terafy.getProjectLibrary({multiple: true})
|
|
302
|
-
</a>
|
|
303
|
-
<a
|
|
304
|
-
@click="run('setProjectLibrary')"
|
|
305
|
-
class="list-group-item list-group-item-action disabled"
|
|
306
|
-
>
|
|
307
|
-
terafy.setProjectLibrary()
|
|
308
|
-
</a>
|
|
309
|
-
</div>
|
|
310
|
-
</div>
|
|
311
|
-
</div>
|
|
312
|
-
<!-- }}} -->
|
|
313
|
-
|
|
314
|
-
</div>
|
|
315
|
-
<!-- Result area {{{ -->
|
|
316
|
-
<div class="col-sm-12 col-md-6">
|
|
317
|
-
<div class="card">
|
|
318
|
-
<div class="card-header d-flex justify-content-between align-items-center">
|
|
319
|
-
<div>Response</div>
|
|
320
|
-
<div>
|
|
321
|
-
<div v-if="isError" class="badge bg-danger">Error!</div>
|
|
322
|
-
<div v-else-if="isError !== null" class="badge bg-success">Success</div>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
<div class="card-body" :class="isError && 'bg-danger'">
|
|
326
|
-
<pre
|
|
327
|
-
class="bg-light border p-2 rounded m-0"
|
|
328
|
-
:class="
|
|
329
|
-
isError === true ? 'bg-danger'
|
|
330
|
-
: isError === false ? 'bg-success'
|
|
331
|
-
: 'bg-light'
|
|
332
|
-
"
|
|
333
|
-
>{{response}}</pre>
|
|
334
|
-
</div>
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
<!-- }}} -->
|
|
338
|
-
</div>
|
|
339
|
-
</div>
|
|
340
|
-
</div>
|
|
341
|
-
</body>
|
|
342
|
-
</html>
|