@iebh/tera-fy 1.7.3 → 1.8.0
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/CHANGELOG.md +24 -0
- package/README.md +48 -0
- package/api.md +333 -299
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +2 -2
- package/lib/projectFile.js +20 -9
- package/lib/terafy.client.js +88 -23
- package/lib/terafy.proxy.js +81 -0
- package/lib/terafy.server.js +79 -4
- package/package.json +4 -2
- package/plugins/vite.js +18 -0
- package/plugins/vue2.js +1 -1
- package/plugins/vue3.js +1 -1
package/api.md
CHANGED
|
@@ -30,59 +30,59 @@
|
|
|
30
30
|
* [serialize][26]
|
|
31
31
|
* [deserialize][27]
|
|
32
32
|
* [Parameters][28]
|
|
33
|
-
* [
|
|
34
|
-
* [
|
|
35
|
-
* [
|
|
36
|
-
* [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* [
|
|
40
|
-
|
|
41
|
-
* [
|
|
42
|
-
|
|
43
|
-
* [
|
|
33
|
+
* [TeraFy][29]
|
|
34
|
+
* [settings][30]
|
|
35
|
+
* [Properties][31]
|
|
36
|
+
* [events][32]
|
|
37
|
+
* [dom][33]
|
|
38
|
+
* [Properties][34]
|
|
39
|
+
* [methods][35]
|
|
40
|
+
* [plugins][36]
|
|
41
|
+
* [send][37]
|
|
42
|
+
* [Parameters][38]
|
|
43
|
+
* [sendRaw][39]
|
|
44
44
|
* [Parameters][40]
|
|
45
|
-
* [
|
|
45
|
+
* [rpc][41]
|
|
46
46
|
* [Parameters][42]
|
|
47
|
-
* [
|
|
47
|
+
* [acceptMessage][43]
|
|
48
48
|
* [Parameters][44]
|
|
49
|
-
* [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* [
|
|
49
|
+
* [acceptPostboxes][45]
|
|
50
|
+
* [createProjectStatePatch][46]
|
|
51
|
+
* [Parameters][47]
|
|
52
|
+
* [applyProjectStatePatchLocal][48]
|
|
53
53
|
* [Parameters][49]
|
|
54
|
-
* [
|
|
54
|
+
* [init][50]
|
|
55
55
|
* [Parameters][51]
|
|
56
|
-
* [
|
|
57
|
-
|
|
58
|
-
* [
|
|
59
|
-
* [
|
|
60
|
-
* [
|
|
61
|
-
|
|
62
|
-
* [
|
|
56
|
+
* [detectMode][52]
|
|
57
|
+
* [injectComms][53]
|
|
58
|
+
* [injectStylesheet][54]
|
|
59
|
+
* [injectMethods][55]
|
|
60
|
+
* [debug][56]
|
|
61
|
+
* [Parameters][57]
|
|
62
|
+
* [set][58]
|
|
63
63
|
* [Parameters][59]
|
|
64
|
-
* [
|
|
64
|
+
* [setIfDev][60]
|
|
65
65
|
* [Parameters][61]
|
|
66
|
-
* [
|
|
66
|
+
* [use][62]
|
|
67
67
|
* [Parameters][63]
|
|
68
|
-
* [
|
|
68
|
+
* [mixin][64]
|
|
69
69
|
* [Parameters][65]
|
|
70
|
-
* [
|
|
70
|
+
* [toggleDevMode][66]
|
|
71
71
|
* [Parameters][67]
|
|
72
|
-
* [
|
|
72
|
+
* [toggleFocus][68]
|
|
73
73
|
* [Parameters][69]
|
|
74
|
-
* [
|
|
74
|
+
* [selectProjectFile][70]
|
|
75
75
|
* [Parameters][71]
|
|
76
|
-
* [
|
|
76
|
+
* [getProjectFiles][72]
|
|
77
77
|
* [Parameters][73]
|
|
78
|
-
* [
|
|
78
|
+
* [getProjectFile][74]
|
|
79
79
|
* [Parameters][75]
|
|
80
|
-
* [
|
|
80
|
+
* [createProjectFile][76]
|
|
81
81
|
* [Parameters][77]
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* [
|
|
85
|
-
* [
|
|
82
|
+
* [handshake][78]
|
|
83
|
+
* [Properties][79]
|
|
84
|
+
* [setServerVerbosity][80]
|
|
85
|
+
* [Parameters][81]
|
|
86
86
|
* [User][82]
|
|
87
87
|
* [Properties][83]
|
|
88
88
|
* [getUser][84]
|
|
@@ -133,10 +133,12 @@
|
|
|
133
133
|
* [Parameters][129]
|
|
134
134
|
* [uiAlert][130]
|
|
135
135
|
* [Parameters][131]
|
|
136
|
-
* [
|
|
136
|
+
* [uiProgress][132]
|
|
137
137
|
* [Parameters][133]
|
|
138
138
|
* [uiWindow][134]
|
|
139
139
|
* [Parameters][135]
|
|
140
|
+
* [uiSplat][136]
|
|
141
|
+
* [Parameters][137]
|
|
140
142
|
|
|
141
143
|
## ProjectFile
|
|
142
144
|
|
|
@@ -146,113 +148,113 @@ A project file fetched from TERA
|
|
|
146
148
|
|
|
147
149
|
A UUID string representing the unique ID of the file
|
|
148
150
|
|
|
149
|
-
Type: [String][
|
|
151
|
+
Type: [String][138]
|
|
150
152
|
|
|
151
153
|
### name
|
|
152
154
|
|
|
153
155
|
Relative name path (can contain prefix directories) for the human readable file name
|
|
154
156
|
|
|
155
|
-
Type: [String][
|
|
157
|
+
Type: [String][138]
|
|
156
158
|
|
|
157
159
|
### icon
|
|
158
160
|
|
|
159
161
|
CSS class to use as the file icon
|
|
160
162
|
|
|
161
|
-
Type: [String][
|
|
163
|
+
Type: [String][138]
|
|
162
164
|
|
|
163
165
|
### path
|
|
164
166
|
|
|
165
167
|
Full path to the file
|
|
166
168
|
This is also used as the unique identifier within the project
|
|
167
169
|
|
|
168
|
-
Type: [String][
|
|
170
|
+
Type: [String][138]
|
|
169
171
|
|
|
170
172
|
### url
|
|
171
173
|
|
|
172
174
|
Fully qualified URL to view / access / download the file from TERA
|
|
173
175
|
This will usually open an edit UI within the TERA site
|
|
174
176
|
|
|
175
|
-
Type: [String][
|
|
177
|
+
Type: [String][138]
|
|
176
178
|
|
|
177
179
|
### teraUrl
|
|
178
180
|
|
|
179
181
|
Rewrite of the URL where the absolute URL has been removed in place of a relative path, assuming the owner project is active
|
|
180
182
|
This is used to direct to the edit/view/download UI when the files project is active and is usually used in place of URL for TERA related operations
|
|
181
183
|
|
|
182
|
-
Type: [String][
|
|
184
|
+
Type: [String][138]
|
|
183
185
|
|
|
184
186
|
### parsedName
|
|
185
187
|
|
|
186
188
|
An object representing meta file parts of a file name
|
|
187
189
|
|
|
188
|
-
Type: [Object][
|
|
190
|
+
Type: [Object][139]
|
|
189
191
|
|
|
190
192
|
#### Properties
|
|
191
193
|
|
|
192
|
-
* `basename` **[String][
|
|
193
|
-
* `filename` **[String][
|
|
194
|
-
* `ext` **[String][
|
|
195
|
-
* `dirName` **[String][
|
|
194
|
+
* `basename` **[String][138]** The filename + extention (i.e. everything without directory name)
|
|
195
|
+
* `filename` **[String][138]** The file portion of the name (basename without the extension)
|
|
196
|
+
* `ext` **[String][138]** The extension portion of the name (always lower case)
|
|
197
|
+
* `dirName` **[String][138]** The directory path portion of the name
|
|
196
198
|
|
|
197
199
|
### created
|
|
198
200
|
|
|
199
201
|
A date representing when the file was created
|
|
200
202
|
|
|
201
|
-
Type: [Date][
|
|
203
|
+
Type: [Date][140]
|
|
202
204
|
|
|
203
205
|
### createdFormatted
|
|
204
206
|
|
|
205
207
|
A human readable, formatted version of "created"
|
|
206
208
|
|
|
207
|
-
Type: [String][
|
|
209
|
+
Type: [String][138]
|
|
208
210
|
|
|
209
211
|
### modified
|
|
210
212
|
|
|
211
213
|
A date representing when the file was created
|
|
212
214
|
|
|
213
|
-
Type: [Date][
|
|
215
|
+
Type: [Date][140]
|
|
214
216
|
|
|
215
217
|
### modifiedFormatted
|
|
216
218
|
|
|
217
219
|
A human readable, formatted version of "modified"
|
|
218
220
|
|
|
219
|
-
Type: [String][
|
|
221
|
+
Type: [String][138]
|
|
220
222
|
|
|
221
223
|
### accessed
|
|
222
224
|
|
|
223
225
|
A date representing when the file was last accessed
|
|
224
226
|
|
|
225
|
-
Type: [Date][
|
|
227
|
+
Type: [Date][140]
|
|
226
228
|
|
|
227
229
|
### accessedFormatted
|
|
228
230
|
|
|
229
231
|
A human readable, formatted version of "accessed"
|
|
230
232
|
|
|
231
|
-
Type: [String][
|
|
233
|
+
Type: [String][138]
|
|
232
234
|
|
|
233
235
|
### size
|
|
234
236
|
|
|
235
237
|
Size, in bytes, of the file
|
|
236
238
|
|
|
237
|
-
Type: [Number][
|
|
239
|
+
Type: [Number][141]
|
|
238
240
|
|
|
239
241
|
### sizeFormatted
|
|
240
242
|
|
|
241
243
|
A human readable, formatted version of the file size
|
|
242
244
|
|
|
243
|
-
Type: [String][
|
|
245
|
+
Type: [String][138]
|
|
244
246
|
|
|
245
247
|
### mime
|
|
246
248
|
|
|
247
249
|
The associated mime type for the file
|
|
248
250
|
|
|
249
|
-
Type: [String][
|
|
251
|
+
Type: [String][138]
|
|
250
252
|
|
|
251
253
|
### meta
|
|
252
254
|
|
|
253
255
|
Additional meta information for the file
|
|
254
256
|
|
|
255
|
-
Type: [Object][
|
|
257
|
+
Type: [Object][139]
|
|
256
258
|
|
|
257
259
|
### getContents
|
|
258
260
|
|
|
@@ -270,9 +272,9 @@ Overwrite the contents of a file with new content
|
|
|
270
272
|
|
|
271
273
|
#### Parameters
|
|
272
274
|
|
|
273
|
-
* `contents` **(File | [Blob][
|
|
275
|
+
* `contents` **(File | [Blob][142] | [FormData][143] | [Object][139] | [Array][144])** The new file contents
|
|
274
276
|
|
|
275
|
-
Returns **[Promise][
|
|
277
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
276
278
|
|
|
277
279
|
### getRefs
|
|
278
280
|
|
|
@@ -280,7 +282,7 @@ Returns **[Promise][143]** A promise which resolves when the operation has compl
|
|
|
280
282
|
|
|
281
283
|
Fetch the file contents as an array of Reflib refs
|
|
282
284
|
|
|
283
|
-
Returns **[Promise][
|
|
285
|
+
Returns **[Promise][145]<[Array][144]\<Ref>>** An eventual array of RefLib references
|
|
284
286
|
|
|
285
287
|
### setRefs
|
|
286
288
|
|
|
@@ -291,18 +293,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
|
|
|
291
293
|
#### Parameters
|
|
292
294
|
|
|
293
295
|
* `refs`  
|
|
294
|
-
* `Collection` **[Array][
|
|
296
|
+
* `Collection` **[Array][144]\<RefLibRef>** of references for the selected library
|
|
295
297
|
|
|
296
|
-
Returns **[Promise][
|
|
298
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
297
299
|
|
|
298
300
|
### serialize
|
|
299
301
|
|
|
300
|
-
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][
|
|
302
|
+
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][146]
|
|
301
303
|
|
|
302
304
|
Compress a file state down into a serializable entity
|
|
303
305
|
By default this computes a Structured Clone which can be stringified
|
|
304
306
|
|
|
305
|
-
Returns **[Object][
|
|
307
|
+
Returns **[Object][139]** A Structured Clone compatible representation of this ProjectFile instance
|
|
306
308
|
|
|
307
309
|
### deserialize
|
|
308
310
|
|
|
@@ -310,18 +312,10 @@ Restore an entity created with serialize
|
|
|
310
312
|
|
|
311
313
|
#### Parameters
|
|
312
314
|
|
|
313
|
-
* `data` **[Object][
|
|
315
|
+
* `data` **[Object][139]** An input object created via `ProjectFiles.serialize()`
|
|
314
316
|
|
|
315
317
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
316
318
|
|
|
317
|
-
## tera
|
|
318
|
-
|
|
319
|
-
Parent TeraClient instance used by all helper functions
|
|
320
|
-
|
|
321
|
-
### Parameters
|
|
322
|
-
|
|
323
|
-
* `TeraClient`  
|
|
324
|
-
|
|
325
319
|
## TeraFy
|
|
326
320
|
|
|
327
321
|
Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
@@ -330,19 +324,19 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
330
324
|
|
|
331
325
|
Various settings to configure behaviour
|
|
332
326
|
|
|
333
|
-
Type: [Object][
|
|
327
|
+
Type: [Object][139]
|
|
334
328
|
|
|
335
329
|
#### Properties
|
|
336
330
|
|
|
337
|
-
* `devMode` **[Boolean][
|
|
338
|
-
* `verbosity` **[Number][
|
|
331
|
+
* `devMode` **[Boolean][147]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
|
|
332
|
+
* `verbosity` **[Number][141]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
|
|
339
333
|
* `mode` **(`"detect"` | `"parent"` | `"child"` | `"popup"`)** How to communicate with TERA. 'parent' assumes that the parent of the current document is TERA, 'child' spawns an iFrame and uses TERA there, 'detect' tries parent and switches to `modeFallback` if communication fails
|
|
340
|
-
* `modeFallback` **[String][
|
|
341
|
-
* `modeTimeout` **[Number][
|
|
342
|
-
* `siteUrl` **[String][
|
|
343
|
-
* `restrictOrigin` **[String][
|
|
344
|
-
* `List` **[Array][
|
|
345
|
-
* `handshakeInterval` **[Number][
|
|
334
|
+
* `modeFallback` **[String][138]** Method to use when all method detection fails
|
|
335
|
+
* `modeTimeout` **[Number][141]** How long entities have in 'detect' mode to identify themselves
|
|
336
|
+
* `siteUrl` **[String][138]** The TERA URL to connect to
|
|
337
|
+
* `restrictOrigin` **[String][138]** URL to restrict communications to
|
|
338
|
+
* `List` **[Array][144]<[String][138]>** of sandbox allowables for the embedded if in embed mode
|
|
339
|
+
* `handshakeInterval` **[Number][141]** Interval in milliseconds when sanning for a handshake
|
|
346
340
|
|
|
347
341
|
### events
|
|
348
342
|
|
|
@@ -354,13 +348,13 @@ Type: Mitt
|
|
|
354
348
|
|
|
355
349
|
DOMElements for this TeraFy instance
|
|
356
350
|
|
|
357
|
-
Type: [Object][
|
|
351
|
+
Type: [Object][139]
|
|
358
352
|
|
|
359
353
|
#### Properties
|
|
360
354
|
|
|
361
355
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
362
356
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
363
|
-
* `popup` **[Window][
|
|
357
|
+
* `popup` **[Window][148]** The popup window context (if `settings.mode == 'popup'`)
|
|
364
358
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
365
359
|
|
|
366
360
|
### methods
|
|
@@ -368,13 +362,13 @@ Type: [Object][137]
|
|
|
368
362
|
List of function stubs mapped from the server to here
|
|
369
363
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
370
364
|
|
|
371
|
-
Type: [Array][
|
|
365
|
+
Type: [Array][144]<[String][138]>
|
|
372
366
|
|
|
373
367
|
### plugins
|
|
374
368
|
|
|
375
369
|
Loaded plugins via Use()
|
|
376
370
|
|
|
377
|
-
Type: [Array][
|
|
371
|
+
Type: [Array][144]\<TeraFyPlugin>
|
|
378
372
|
|
|
379
373
|
### send
|
|
380
374
|
|
|
@@ -382,9 +376,9 @@ Send a message + wait for a response object
|
|
|
382
376
|
|
|
383
377
|
#### Parameters
|
|
384
378
|
|
|
385
|
-
* `message` **[Object][
|
|
379
|
+
* `message` **[Object][139]** Message object to send
|
|
386
380
|
|
|
387
|
-
Returns **[Promise][
|
|
381
|
+
Returns **[Promise][145]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
388
382
|
|
|
389
383
|
### sendRaw
|
|
390
384
|
|
|
@@ -393,7 +387,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
393
387
|
|
|
394
388
|
#### Parameters
|
|
395
389
|
|
|
396
|
-
* `message` **[Object][
|
|
390
|
+
* `message` **[Object][139]** Message object to send
|
|
397
391
|
|
|
398
392
|
### rpc
|
|
399
393
|
|
|
@@ -401,10 +395,10 @@ Call an RPC function in the server instance
|
|
|
401
395
|
|
|
402
396
|
#### Parameters
|
|
403
397
|
|
|
404
|
-
* `method` **[String][
|
|
398
|
+
* `method` **[String][138]** The method name to call
|
|
405
399
|
* `args` **...any** 
|
|
406
400
|
|
|
407
|
-
Returns **[Promise][
|
|
401
|
+
Returns **[Promise][145]\<any>** The resolved output of the server function
|
|
408
402
|
|
|
409
403
|
### acceptMessage
|
|
410
404
|
|
|
@@ -413,7 +407,7 @@ Accept an incoming message
|
|
|
413
407
|
#### Parameters
|
|
414
408
|
|
|
415
409
|
* `rawMessage`  
|
|
416
|
-
* `Raw` **[MessageEvent][
|
|
410
|
+
* `Raw` **[MessageEvent][149]** message event to process
|
|
417
411
|
|
|
418
412
|
### acceptPostboxes
|
|
419
413
|
|
|
@@ -422,27 +416,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
|
|
|
422
416
|
### createProjectStatePatch
|
|
423
417
|
|
|
424
418
|
Create + transmit a new project state patch base on the current and previous states
|
|
425
|
-
The transmitted patch follows the [JSPatch][
|
|
419
|
+
The transmitted patch follows the [JSPatch][150] standard
|
|
426
420
|
This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
|
|
427
421
|
|
|
428
422
|
#### Parameters
|
|
429
423
|
|
|
430
|
-
* `newState` **[Object][
|
|
431
|
-
* `oldState` **[Object][
|
|
424
|
+
* `newState` **[Object][139]** The local projectState to accept
|
|
425
|
+
* `oldState` **[Object][139]** The previous projectState to examine against
|
|
432
426
|
|
|
433
|
-
Returns **[Promise][
|
|
427
|
+
Returns **[Promise][145]** A promise which will resolve when the operation has completed
|
|
434
428
|
|
|
435
429
|
### applyProjectStatePatchLocal
|
|
436
430
|
|
|
437
431
|
Client function which accepts a patch from the server and applies it to local project state
|
|
438
|
-
The patch should follow the [JSPatch][
|
|
432
|
+
The patch should follow the [JSPatch][150] standard
|
|
439
433
|
This function is expected to be sub-classed by a plugin
|
|
440
434
|
|
|
441
435
|
#### Parameters
|
|
442
436
|
|
|
443
|
-
* `patch` **[Array][
|
|
437
|
+
* `patch` **[Array][144]** A JSPatch patch to apply
|
|
444
438
|
|
|
445
|
-
Returns **[Promise][
|
|
439
|
+
Returns **[Promise][145]** A promise which will resolve when the operation has completed
|
|
446
440
|
|
|
447
441
|
### init
|
|
448
442
|
|
|
@@ -451,28 +445,28 @@ This function can only be called once and will return the existing init() worker
|
|
|
451
445
|
|
|
452
446
|
#### Parameters
|
|
453
447
|
|
|
454
|
-
* `options` **[Object][
|
|
448
|
+
* `options` **[Object][139]?** Additional options to merge into `settings` via `set`
|
|
455
449
|
|
|
456
|
-
Returns **[Promise][
|
|
450
|
+
Returns **[Promise][145]<[TeraFy][29]>** An eventual promise which will resovle with this terafy instance
|
|
457
451
|
|
|
458
452
|
### detectMode
|
|
459
453
|
|
|
460
454
|
Populate `settings.mode`
|
|
461
455
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
462
456
|
|
|
463
|
-
Returns **[Promise][
|
|
457
|
+
Returns **[Promise][145]<[String][138]>** A promise which will resolve with the detected mode to use
|
|
464
458
|
|
|
465
459
|
### injectComms
|
|
466
460
|
|
|
467
461
|
Find an existing active TERA server OR initalize one
|
|
468
462
|
|
|
469
|
-
Returns **[Promise][
|
|
463
|
+
Returns **[Promise][145]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
470
464
|
|
|
471
465
|
### injectStylesheet
|
|
472
466
|
|
|
473
467
|
Inject a local stylesheet to handle TERA server functionality
|
|
474
468
|
|
|
475
|
-
Returns **[Promise][
|
|
469
|
+
Returns **[Promise][145]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
476
470
|
|
|
477
471
|
### injectMethods
|
|
478
472
|
|
|
@@ -487,7 +481,7 @@ This function will only act if `settings.devMode` is truthy
|
|
|
487
481
|
|
|
488
482
|
* `msg` **...any** 
|
|
489
483
|
* `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
|
|
490
|
-
* `verboseLevel` **[Number][
|
|
484
|
+
* `verboseLevel` **[Number][141]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
|
|
491
485
|
|
|
492
486
|
### set
|
|
493
487
|
|
|
@@ -496,10 +490,13 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
496
490
|
|
|
497
491
|
#### Parameters
|
|
498
492
|
|
|
499
|
-
* `key` **([String][
|
|
493
|
+
* `key` **([String][138] | [Object][139])** Either a single setting key to set or an object to merge
|
|
500
494
|
* `value` **any** The value to set if `key` is a string
|
|
495
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
496
|
+
|
|
497
|
+
* `options.ignoreNullish` **[Boolean][147]** If falsy, this forces the setting of undefined or null values rather than ignoring them when specifying values by string (optional, default `true`)
|
|
501
498
|
|
|
502
|
-
Returns **[TeraFy][
|
|
499
|
+
Returns **[TeraFy][29]** This chainable terafy instance
|
|
503
500
|
|
|
504
501
|
### setIfDev
|
|
505
502
|
|
|
@@ -509,10 +506,11 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
509
506
|
|
|
510
507
|
#### Parameters
|
|
511
508
|
|
|
512
|
-
* `key` **([String][
|
|
509
|
+
* `key` **([String][138] | [Object][139])** Either a single setting key to set or an object to merge
|
|
513
510
|
* `value` **any** The value to set if `key` is a string
|
|
511
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
514
512
|
|
|
515
|
-
Returns **[TeraFy][
|
|
513
|
+
Returns **[TeraFy][29]** This chainable terafy instance
|
|
516
514
|
|
|
517
515
|
### use
|
|
518
516
|
|
|
@@ -521,10 +519,10 @@ Include a TeraFy client plugin
|
|
|
521
519
|
#### Parameters
|
|
522
520
|
|
|
523
521
|
* `mod`  
|
|
524
|
-
* `options` **[Object][
|
|
525
|
-
* `The` **[Object][
|
|
522
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
|
|
523
|
+
* `The` **[Object][139]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
|
|
526
524
|
|
|
527
|
-
Returns **[TeraFy][
|
|
525
|
+
Returns **[TeraFy][29]** This chainable terafy instance
|
|
528
526
|
|
|
529
527
|
### mixin
|
|
530
528
|
|
|
@@ -532,18 +530,22 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
532
530
|
|
|
533
531
|
#### Parameters
|
|
534
532
|
|
|
535
|
-
* `target` **[Object][
|
|
536
|
-
* `source` **[Object][
|
|
533
|
+
* `target` **[Object][139]** Initalied class instance to extend
|
|
534
|
+
* `source` **[Object][139]** Initalized source object to extend from
|
|
537
535
|
|
|
538
536
|
### toggleDevMode
|
|
539
537
|
|
|
540
538
|
Set or toggle devMode
|
|
539
|
+
This function also accepts meta values:
|
|
540
|
+
|
|
541
|
+
'toggle' - Set dev mode to whatever the opposing value of the current mode
|
|
542
|
+
'proxy' - Optimize for using a loopback proxy
|
|
541
543
|
|
|
542
544
|
#### Parameters
|
|
543
545
|
|
|
544
|
-
* `devModeEnabled` **(
|
|
546
|
+
* `devModeEnabled` **(`"toggle"` | `"proxy"` | [Boolean][147])** Optional boolean to force dev mode or specify other behaviour (optional, default `'toggle'`)
|
|
545
547
|
|
|
546
|
-
Returns **[TeraFy][
|
|
548
|
+
Returns **[TeraFy][29]** This chainable terafy instance
|
|
547
549
|
|
|
548
550
|
### toggleFocus
|
|
549
551
|
|
|
@@ -552,7 +554,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
552
554
|
|
|
553
555
|
#### Parameters
|
|
554
556
|
|
|
555
|
-
* `isFocused` **([String][
|
|
557
|
+
* `isFocused` **([String][138] | [Boolean][147])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
556
558
|
|
|
557
559
|
### selectProjectFile
|
|
558
560
|
|
|
@@ -564,7 +566,7 @@ This is an pre-requisite step for requireProject()
|
|
|
564
566
|
|
|
565
567
|
* `options`  
|
|
566
568
|
|
|
567
|
-
Returns **[Promise][
|
|
569
|
+
Returns **[Promise][145]** A promise which will resolve if the there is a user and they are logged in
|
|
568
570
|
|
|
569
571
|
### getProjectFiles
|
|
570
572
|
|
|
@@ -572,12 +574,13 @@ Fetch the files associated with a given project
|
|
|
572
574
|
|
|
573
575
|
#### Parameters
|
|
574
576
|
|
|
575
|
-
* `options` **[Object][
|
|
577
|
+
* `options` **[Object][139]** Options which mutate behaviour
|
|
576
578
|
|
|
577
|
-
* `options.autoRequire` **[Boolean][
|
|
578
|
-
* `options.
|
|
579
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
580
|
+
* `options.lazy` **[Boolean][147]** If true, use the fastest method to retrieve the file list such as the cache. If false, force a refresh each time (optional, default `true`)
|
|
581
|
+
* `options.meta` **[Boolean][147]** Pull meta information for each file entity (optional, default `true`)
|
|
579
582
|
|
|
580
|
-
Returns **[Promise][
|
|
583
|
+
Returns **[Promise][145]<[Array][144]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
581
584
|
|
|
582
585
|
### getProjectFile
|
|
583
586
|
|
|
@@ -586,13 +589,13 @@ Fetch a project file by its name
|
|
|
586
589
|
#### Parameters
|
|
587
590
|
|
|
588
591
|
* `id`  
|
|
589
|
-
* `name` **[String][
|
|
590
|
-
* `options` **([Object][
|
|
592
|
+
* `name` **[String][138]** The name + relative directory path component
|
|
593
|
+
* `options` **([Object][139] | [String][138])?** Additional options to mutate behaviour, if a string is given `options.subkey` is assumed
|
|
591
594
|
|
|
592
|
-
* `options.subkey` **[String][
|
|
593
|
-
* `options.cache` **[Boolean][
|
|
595
|
+
* `options.subkey` **[String][138]?** If specified only the extracted subkey is returned rather than the full object
|
|
596
|
+
* `options.cache` **[Boolean][147]** Use the existing file cache if possible, set to false to force a refresh of files from the server first (optional, default `true`)
|
|
594
597
|
|
|
595
|
-
Returns **[Promise][
|
|
598
|
+
Returns **[Promise][145]<[ProjectFile][1]>** The eventual fetched ProjectFile (or requested subkey)
|
|
596
599
|
|
|
597
600
|
### createProjectFile
|
|
598
601
|
|
|
@@ -601,9 +604,9 @@ This creates an empty file which can then be written to
|
|
|
601
604
|
|
|
602
605
|
#### Parameters
|
|
603
606
|
|
|
604
|
-
* `name` **[String][
|
|
607
|
+
* `name` **[String][138]** The name + relative directory path component
|
|
605
608
|
|
|
606
|
-
Returns **[Promise][
|
|
609
|
+
Returns **[Promise][145]<[ProjectFile][1]>** The eventual ProjectFile created
|
|
607
610
|
|
|
608
611
|
## handshake
|
|
609
612
|
|
|
@@ -611,9 +614,17 @@ Return basic server information as a form of validation
|
|
|
611
614
|
|
|
612
615
|
### Properties
|
|
613
616
|
|
|
614
|
-
* `date` **[Date][
|
|
617
|
+
* `date` **[Date][140]** Server date
|
|
615
618
|
|
|
616
|
-
Returns **[Promise][
|
|
619
|
+
Returns **[Promise][145]<[Object][139]>** Basic promise result
|
|
620
|
+
|
|
621
|
+
## setServerVerbosity
|
|
622
|
+
|
|
623
|
+
RPC callback to set the server verbostiy level
|
|
624
|
+
|
|
625
|
+
### Parameters
|
|
626
|
+
|
|
627
|
+
* `verbosity` **[Number][141]** The desired server verbosity level
|
|
617
628
|
|
|
618
629
|
## User
|
|
619
630
|
|
|
@@ -621,16 +632,16 @@ User / active session within TERA
|
|
|
621
632
|
|
|
622
633
|
### Properties
|
|
623
634
|
|
|
624
|
-
* `id` **[String][
|
|
625
|
-
* `email` **[String][
|
|
626
|
-
* `name` **[String][
|
|
627
|
-
* `isSubscribed` **[Boolean][
|
|
635
|
+
* `id` **[String][138]** Unique identifier of the user
|
|
636
|
+
* `email` **[String][138]** The email address of the current user
|
|
637
|
+
* `name` **[String][138]** The provided full name of the user
|
|
638
|
+
* `isSubscribed` **[Boolean][147]** Whether the active user has a TERA subscription
|
|
628
639
|
|
|
629
640
|
## getUser
|
|
630
641
|
|
|
631
642
|
Fetch the current session user
|
|
632
643
|
|
|
633
|
-
Returns **[Promise][
|
|
644
|
+
Returns **[Promise][145]<[User][82]>** The current logged in user or null if none
|
|
634
645
|
|
|
635
646
|
## requireUser
|
|
636
647
|
|
|
@@ -640,11 +651,11 @@ This is an pre-requisite step for requireProject()
|
|
|
640
651
|
|
|
641
652
|
### Parameters
|
|
642
653
|
|
|
643
|
-
* `options` **[Object][
|
|
654
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
644
655
|
|
|
645
|
-
* `options.forceRetry` **[Boolean][
|
|
656
|
+
* `options.forceRetry` **[Boolean][147]** Forcabily try to refresh the user state (optional, default `false`)
|
|
646
657
|
|
|
647
|
-
Returns **[Promise][
|
|
658
|
+
Returns **[Promise][145]<[User][82]>** The current logged in user or null if none
|
|
648
659
|
|
|
649
660
|
## Project
|
|
650
661
|
|
|
@@ -654,13 +665,13 @@ Project entry within TERA
|
|
|
654
665
|
|
|
655
666
|
Get the currently active project, if any
|
|
656
667
|
|
|
657
|
-
Returns **[Promise][
|
|
668
|
+
Returns **[Promise][145]<([Project][87] | null)>** The currently active project, if any
|
|
658
669
|
|
|
659
670
|
## getProjects
|
|
660
671
|
|
|
661
672
|
Get a list of projects the current session user has access to
|
|
662
673
|
|
|
663
|
-
Returns **[Promise][
|
|
674
|
+
Returns **[Promise][145]<[Array][144]<[Project][87]>>** Collection of projects the user has access to
|
|
664
675
|
|
|
665
676
|
## setActiveProject
|
|
666
677
|
|
|
@@ -668,7 +679,7 @@ Set the currently active project within TERA
|
|
|
668
679
|
|
|
669
680
|
### Parameters
|
|
670
681
|
|
|
671
|
-
* `project` **([Object][
|
|
682
|
+
* `project` **([Object][139] | [String][138])** The project to set as active - either the full Project object or its ID
|
|
672
683
|
|
|
673
684
|
## requireProject
|
|
674
685
|
|
|
@@ -677,14 +688,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
677
688
|
|
|
678
689
|
### Parameters
|
|
679
690
|
|
|
680
|
-
* `options` **[Object][
|
|
691
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
681
692
|
|
|
682
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
683
|
-
* `options.title` **[String][
|
|
684
|
-
* `options.noSelectTitle` **[String][
|
|
685
|
-
* `options.noSelectBody` **[String][
|
|
693
|
+
* `options.autoSetActiveProject` **[Boolean][147]** After selecting a project set that project as active in TERA (optional, default `true`)
|
|
694
|
+
* `options.title` **[String][138]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
695
|
+
* `options.noSelectTitle` **[String][138]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
|
|
696
|
+
* `options.noSelectBody` **[String][138]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
|
|
686
697
|
|
|
687
|
-
Returns **[Promise][
|
|
698
|
+
Returns **[Promise][145]<[Project][87]>** The active project
|
|
688
699
|
|
|
689
700
|
## selectProject
|
|
690
701
|
|
|
@@ -692,13 +703,13 @@ Prompt the user to select a project from those available
|
|
|
692
703
|
|
|
693
704
|
### Parameters
|
|
694
705
|
|
|
695
|
-
* `options` **[Object][
|
|
706
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
696
707
|
|
|
697
|
-
* `options.title` **[String][
|
|
698
|
-
* `options.allowCancel` **[Boolean][
|
|
699
|
-
* `options.setActive` **[Boolean][
|
|
708
|
+
* `options.title` **[String][138]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
709
|
+
* `options.allowCancel` **[Boolean][147]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
|
|
710
|
+
* `options.setActive` **[Boolean][147]** Also set the project as active when selected (optional, default `false`)
|
|
700
711
|
|
|
701
|
-
Returns **[Promise][
|
|
712
|
+
Returns **[Promise][145]<[Project][87]>** The active project
|
|
702
713
|
|
|
703
714
|
## getProjectState
|
|
704
715
|
|
|
@@ -706,12 +717,12 @@ Return the current, full snapshot state of the active project
|
|
|
706
717
|
|
|
707
718
|
### Parameters
|
|
708
719
|
|
|
709
|
-
* `options` **[Object][
|
|
720
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
710
721
|
|
|
711
|
-
* `options.autoRequire` **[Boolean][
|
|
712
|
-
* `Paths` **[Array][
|
|
722
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
723
|
+
* `Paths` **[Array][144]<[String][138]>** to subscribe to e.g. \['/users/'],
|
|
713
724
|
|
|
714
|
-
Returns **[Promise][
|
|
725
|
+
Returns **[Promise][145]<[Object][139]>** The current project state snapshot
|
|
715
726
|
|
|
716
727
|
## setProjectState
|
|
717
728
|
|
|
@@ -723,13 +734,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
723
734
|
|
|
724
735
|
### Parameters
|
|
725
736
|
|
|
726
|
-
* `path` **([String][
|
|
737
|
+
* `path` **([String][138] | [Array][144]<[String][138]>)** The sub-path within the project state to set
|
|
727
738
|
* `value` **any** The value to set
|
|
728
|
-
* `options` **[Object][
|
|
739
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
729
740
|
|
|
730
|
-
* `options.save` **[Boolean][
|
|
741
|
+
* `options.save` **[Boolean][147]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
731
742
|
|
|
732
|
-
Returns **[Promise][
|
|
743
|
+
Returns **[Promise][145]** A promise which resolves when the operation has been dispatched to the server
|
|
733
744
|
|
|
734
745
|
## setProjectStateDefaults
|
|
735
746
|
|
|
@@ -739,31 +750,31 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
739
750
|
|
|
740
751
|
### Parameters
|
|
741
752
|
|
|
742
|
-
* `path` **([String][
|
|
753
|
+
* `path` **([String][138] | [Array][144]<[String][138]>)** The sub-path within the project state to set
|
|
743
754
|
* `value` **any** The value to set
|
|
744
|
-
* `options` **[Object][
|
|
755
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
745
756
|
|
|
746
|
-
Returns **[Promise][
|
|
757
|
+
Returns **[Promise][145]<[Boolean][147]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
|
|
747
758
|
|
|
748
759
|
## setProjectStateFlush
|
|
749
760
|
|
|
750
761
|
Force copying local changes to the server
|
|
751
762
|
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
752
763
|
|
|
753
|
-
Returns **[Promise][
|
|
764
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
754
765
|
|
|
755
766
|
## setProjectStateRefresh
|
|
756
767
|
|
|
757
768
|
Force refetching the remote project state into local
|
|
758
769
|
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
759
770
|
|
|
760
|
-
Returns **[Promise][
|
|
771
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
761
772
|
|
|
762
773
|
## saveProjectState
|
|
763
774
|
|
|
764
775
|
Force-Save the currently active project state
|
|
765
776
|
|
|
766
|
-
Returns **[Promise][
|
|
777
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
767
778
|
|
|
768
779
|
## replaceProjectState
|
|
769
780
|
|
|
@@ -774,9 +785,9 @@ You almost never want to use this function directly, see `setProjectState(path,
|
|
|
774
785
|
|
|
775
786
|
### Parameters
|
|
776
787
|
|
|
777
|
-
* `newState` **[Object][
|
|
788
|
+
* `newState` **[Object][139]** The new state to replace the current state with
|
|
778
789
|
|
|
779
|
-
Returns **[Promise][
|
|
790
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
780
791
|
|
|
781
792
|
## applyProjectStatePatch
|
|
782
793
|
|
|
@@ -784,9 +795,9 @@ Apply a computed `just-diff` patch to the current project state
|
|
|
784
795
|
|
|
785
796
|
### Parameters
|
|
786
797
|
|
|
787
|
-
* `Patch` **[Object][
|
|
798
|
+
* `Patch` **[Object][139]** to apply
|
|
788
799
|
|
|
789
|
-
Returns **[Promise][
|
|
800
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
790
801
|
|
|
791
802
|
## subscribeProjectState
|
|
792
803
|
|
|
@@ -794,7 +805,7 @@ Subscribe to project state changes
|
|
|
794
805
|
This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
|
|
795
806
|
If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
|
|
796
807
|
|
|
797
|
-
Returns **[Promise][
|
|
808
|
+
Returns **[Promise][145]<[Function][151]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
|
|
798
809
|
|
|
799
810
|
## FileFilters
|
|
800
811
|
|
|
@@ -802,10 +813,10 @@ Data structure for a file filter
|
|
|
802
813
|
|
|
803
814
|
### Properties
|
|
804
815
|
|
|
805
|
-
* `library` **[Boolean][
|
|
806
|
-
* `filename` **[String][
|
|
807
|
-
* `basename` **[String][
|
|
808
|
-
* `ext` **[String][
|
|
816
|
+
* `library` **[Boolean][147]?** Restrict to library files only
|
|
817
|
+
* `filename` **[String][138]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
|
|
818
|
+
* `basename` **[String][138]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
|
|
819
|
+
* `ext` **[String][138]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
|
|
809
820
|
|
|
810
821
|
## selectProjectFile
|
|
811
822
|
|
|
@@ -813,20 +824,20 @@ Prompt the user to select a library to operate on
|
|
|
813
824
|
|
|
814
825
|
### Parameters
|
|
815
826
|
|
|
816
|
-
* `options` **[Object][
|
|
827
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
817
828
|
|
|
818
|
-
* `options.title` **[String][
|
|
819
|
-
* `options.hint` **([String][
|
|
820
|
-
* `options.save` **[Boolean][
|
|
829
|
+
* `options.title` **[String][138]** The title of the dialog to display (optional, default `"Select a file"`)
|
|
830
|
+
* `options.hint` **([String][138] | [Array][144]<[String][138]>)?** Hints to identify the file to select in array order of preference
|
|
831
|
+
* `options.save` **[Boolean][147]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
|
|
821
832
|
* `options.filters` **[FileFilters][110]?** Optional file filters
|
|
822
|
-
* `options.allowUpload` **[Boolean][
|
|
823
|
-
* `options.allowRefresh` **[Boolean][
|
|
824
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
825
|
-
* `options.allowCancel` **[Boolean][
|
|
826
|
-
* `options.autoRequire` **[Boolean][
|
|
833
|
+
* `options.allowUpload` **[Boolean][147]** Allow uploading new files (optional, default `true`)
|
|
834
|
+
* `options.allowRefresh` **[Boolean][147]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
835
|
+
* `options.allowDownloadZip` **[Boolean][147]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
836
|
+
* `options.allowCancel` **[Boolean][147]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
837
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
827
838
|
* `options.filter` **[FileFilters][110]?** Optional file filters
|
|
828
839
|
|
|
829
|
-
Returns **[Promise][
|
|
840
|
+
Returns **[Promise][145]<[ProjectFile][1]>** The eventually selected file, if in save mode new files are created as stubs
|
|
830
841
|
|
|
831
842
|
## deleteProjectFile
|
|
832
843
|
|
|
@@ -834,9 +845,9 @@ Remove a project file by its ID
|
|
|
834
845
|
|
|
835
846
|
### Parameters
|
|
836
847
|
|
|
837
|
-
* `id` **[String][
|
|
848
|
+
* `id` **[String][138]** The File ID to remove
|
|
838
849
|
|
|
839
|
-
Returns **[Promise][
|
|
850
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
840
851
|
|
|
841
852
|
## setProjectFile
|
|
842
853
|
|
|
@@ -844,10 +855,10 @@ Replace a project files contents
|
|
|
844
855
|
|
|
845
856
|
### Parameters
|
|
846
857
|
|
|
847
|
-
* `id` **[String][
|
|
848
|
-
* `contents` **(File | [Blob][
|
|
858
|
+
* `id` **[String][138]** File to overwrite
|
|
859
|
+
* `contents` **(File | [Blob][142] | [FormData][143] | [Object][139] | [Array][144])** The new file contents
|
|
849
860
|
|
|
850
|
-
Returns **[Promise][
|
|
861
|
+
Returns **[Promise][145]** A promise which will resolve when the write operation has completed
|
|
851
862
|
|
|
852
863
|
## selectProjectLibrary
|
|
853
864
|
|
|
@@ -855,18 +866,18 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
855
866
|
|
|
856
867
|
### Parameters
|
|
857
868
|
|
|
858
|
-
* `options` **[Object][
|
|
869
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
859
870
|
|
|
860
|
-
* `options.title` **[String][
|
|
861
|
-
* `options.hint` **([String][
|
|
862
|
-
* `options.allowUpload` **[Boolean][
|
|
863
|
-
* `options.allowRefresh` **[Boolean][
|
|
864
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
865
|
-
* `options.allowCancel` **[Boolean][
|
|
866
|
-
* `options.autoRequire` **[Boolean][
|
|
871
|
+
* `options.title` **[String][138]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
872
|
+
* `options.hint` **([String][138] | [Array][144]<[String][138]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
|
|
873
|
+
* `options.allowUpload` **[Boolean][147]** Allow uploading new files (optional, default `true`)
|
|
874
|
+
* `options.allowRefresh` **[Boolean][147]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
875
|
+
* `options.allowDownloadZip` **[Boolean][147]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
876
|
+
* `options.allowCancel` **[Boolean][147]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
877
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
867
878
|
* `options.filters` **[FileFilters][110]?** Optional file filters, defaults to citation library selection only
|
|
868
879
|
|
|
869
|
-
Returns **[Promise][
|
|
880
|
+
Returns **[Promise][145]<[Array][144]\<Ref>>** A collection of references from the selected file
|
|
870
881
|
|
|
871
882
|
## getProjectLibrary
|
|
872
883
|
|
|
@@ -874,15 +885,15 @@ Fetch + convert a project file into a library of citations
|
|
|
874
885
|
|
|
875
886
|
### Parameters
|
|
876
887
|
|
|
877
|
-
* `id` **[String][
|
|
878
|
-
* `options` **[Object][
|
|
888
|
+
* `id` **[String][138]** File ID to read
|
|
889
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
879
890
|
|
|
880
|
-
* `options.format` **[String][
|
|
881
|
-
* `options.autoRequire` **[Boolean][
|
|
882
|
-
* `options.filter` **[Function][
|
|
883
|
-
* `options.find` **[Function][
|
|
891
|
+
* `options.format` **[String][138]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
892
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
893
|
+
* `options.filter` **[Function][151]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
894
|
+
* `options.find` **[Function][151]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
884
895
|
|
|
885
|
-
Returns **([Promise][
|
|
896
|
+
Returns **([Promise][145]<[Array][144]\<Ref>> | [Promise][145]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
886
897
|
|
|
887
898
|
## setProjectLibrary
|
|
888
899
|
|
|
@@ -890,33 +901,33 @@ Save back a citation library from some input
|
|
|
890
901
|
|
|
891
902
|
### Parameters
|
|
892
903
|
|
|
893
|
-
* `id` **[String][
|
|
894
|
-
* `refs` **([Array][
|
|
895
|
-
* `options` **[Object][
|
|
904
|
+
* `id` **[String][138]?** File ID to save back to, if omitted a file will be prompted for
|
|
905
|
+
* `refs` **([Array][144]\<RefLibRef> | [Blob][142] | File)?** Collection of references for the selected library or the raw Blob/File
|
|
906
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
896
907
|
|
|
897
|
-
* `options.id` **[String][
|
|
898
|
-
* `options.refs` **([Array][
|
|
899
|
-
* `options.format` **[String][
|
|
900
|
-
* `options.autoRequire` **[Boolean][
|
|
901
|
-
* `options.hint` **[String][
|
|
902
|
-
* `options.filename` **[String][
|
|
903
|
-
* `options.title` **[String][
|
|
904
|
-
* `options.overwrite` **[Boolean][
|
|
905
|
-
* `options.meta` **[Object][
|
|
908
|
+
* `options.id` **[String][138]?** Alternate method to specify the file ID to save as, if omitted one will be prompted for
|
|
909
|
+
* `options.refs` **([Array][144]\<RefLibRef> | [Blob][142] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
910
|
+
* `options.format` **[String][138]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
911
|
+
* `options.autoRequire` **[Boolean][147]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
912
|
+
* `options.hint` **[String][138]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
913
|
+
* `options.filename` **[String][138]?** Suggested filename if `id` is unspecified
|
|
914
|
+
* `options.title` **[String][138]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
|
|
915
|
+
* `options.overwrite` **[Boolean][147]** Allow existing file upsert (optional, default `true`)
|
|
916
|
+
* `options.meta` **[Object][139]?** Optional meta data to merge into the file data
|
|
906
917
|
|
|
907
|
-
Returns **[Promise][
|
|
918
|
+
Returns **[Promise][145]** A promise which resolves when the save operation has completed
|
|
908
919
|
|
|
909
920
|
## projectLog
|
|
910
921
|
|
|
911
922
|
Create a log entry for the currently active project
|
|
912
923
|
|
|
913
|
-
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][
|
|
924
|
+
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][152] for the full list
|
|
914
925
|
|
|
915
926
|
### Parameters
|
|
916
927
|
|
|
917
|
-
* `log` **[Object][
|
|
928
|
+
* `log` **[Object][139]** The log entry to create
|
|
918
929
|
|
|
919
|
-
Returns **[Promise][
|
|
930
|
+
Returns **[Promise][145]** A promise which resolves when the operation has completed
|
|
920
931
|
|
|
921
932
|
## setPageUrl
|
|
922
933
|
|
|
@@ -925,7 +936,7 @@ This only really makes a difference to tools within the tera-tools.com site wher
|
|
|
925
936
|
|
|
926
937
|
### Parameters
|
|
927
938
|
|
|
928
|
-
* `url` **[String][
|
|
939
|
+
* `url` **[String][138]** The URL to restore on next refresh
|
|
929
940
|
|
|
930
941
|
## setPageTitle
|
|
931
942
|
|
|
@@ -934,7 +945,7 @@ This is usually called by a tool nested within the tera-tools.com embed
|
|
|
934
945
|
|
|
935
946
|
### Parameters
|
|
936
947
|
|
|
937
|
-
* `title` **[String][
|
|
948
|
+
* `title` **[String][138]** The current page title
|
|
938
949
|
|
|
939
950
|
## uiAlert
|
|
940
951
|
|
|
@@ -942,25 +953,32 @@ Display simple text within TERA
|
|
|
942
953
|
|
|
943
954
|
### Parameters
|
|
944
955
|
|
|
945
|
-
* `text` **[String][
|
|
946
|
-
* `options` **[Object][
|
|
956
|
+
* `text` **[String][138]** The text to display
|
|
957
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
947
958
|
|
|
948
|
-
* `options.title` **[String][
|
|
949
|
-
* `options.isHtml` **[Boolean][
|
|
959
|
+
* `options.title` **[String][138]** The title of the alert box (optional, default `'TERA'`)
|
|
960
|
+
* `options.isHtml` **[Boolean][147]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
950
961
|
|
|
951
|
-
Returns **[Promise][
|
|
962
|
+
Returns **[Promise][145]** A promise which resolves when the alert has been dismissed
|
|
952
963
|
|
|
953
|
-
##
|
|
964
|
+
## uiProgress
|
|
954
965
|
|
|
955
|
-
Display
|
|
956
|
-
|
|
966
|
+
Display, update or dispose of windows for long running tasks
|
|
967
|
+
All options are cumulative - i.e. they are merged with other options previously provided
|
|
957
968
|
|
|
958
969
|
### Parameters
|
|
959
970
|
|
|
960
|
-
* `
|
|
961
|
-
|
|
971
|
+
* `options` **([Object][139] | [Boolean][147])?** Additional options to mutate behaviour, if boolean false `{close: true}` is assumed
|
|
972
|
+
|
|
973
|
+
* `options.title` **[String][138]** Window title, can only be set on the initial call (optional, default `'TERA'`)
|
|
974
|
+
* `options.body` **[String][138]** Window body text, can only be set on the initial call (optional, default `''`)
|
|
975
|
+
* `options.bodyHtml` **[Boolean][147]** Treat body text as HTML (optional, default `false`)
|
|
976
|
+
* `options.close` **[Boolean][147]** Close the existing dialog, if true the dialog is disposed and options reset (optional, default `false`)
|
|
977
|
+
* `options.text` **[String][138]?** The text of the task being conducted
|
|
978
|
+
* `options.progress` **[Number][141]?** The current progress of the task being conducted, this is assumed to be a value less than `maxProgress`
|
|
979
|
+
* `options.maxProgress` **[Number][141]?** The maximum value that the progress can be
|
|
962
980
|
|
|
963
|
-
|
|
981
|
+
Returns **[Promise][145]** A promise which resolves when the dialog has been updated
|
|
964
982
|
|
|
965
983
|
## uiWindow
|
|
966
984
|
|
|
@@ -968,16 +986,28 @@ Open a popup window containing a new site
|
|
|
968
986
|
|
|
969
987
|
### Parameters
|
|
970
988
|
|
|
971
|
-
* `url` **[String][
|
|
972
|
-
* `options` **[Object][
|
|
989
|
+
* `url` **[String][138]** The URL to open
|
|
990
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
973
991
|
|
|
974
|
-
* `options.width` **[Number][
|
|
975
|
-
* `options.height` **[Number][
|
|
976
|
-
* `options.center` **[Boolean][
|
|
977
|
-
* `options.permissions` **[Object][
|
|
992
|
+
* `options.width` **[Number][141]** The desired width of the window (optional, default `500`)
|
|
993
|
+
* `options.height` **[Number][141]** The desired height of the window (optional, default `600`)
|
|
994
|
+
* `options.center` **[Boolean][147]** Attempt to center the window on the screen (optional, default `true`)
|
|
995
|
+
* `options.permissions` **[Object][139]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
|
|
978
996
|
|
|
979
997
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
980
998
|
|
|
999
|
+
## uiSplat
|
|
1000
|
+
|
|
1001
|
+
Display HTML content full-screen within TERA
|
|
1002
|
+
This function is ideally called within a requestFocus() wrapper
|
|
1003
|
+
|
|
1004
|
+
### Parameters
|
|
1005
|
+
|
|
1006
|
+
* `content` **(DOMElement | [String][138] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
|
|
1007
|
+
* `options` **[Object][139]?** Additional options to mutate behaviour
|
|
1008
|
+
|
|
1009
|
+
* `options.logo` **([Boolean][147] | [String][138])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
|
|
1010
|
+
|
|
981
1011
|
[1]: #projectfile
|
|
982
1012
|
|
|
983
1013
|
[2]: #id
|
|
@@ -1034,111 +1064,111 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1034
1064
|
|
|
1035
1065
|
[28]: #parameters-2
|
|
1036
1066
|
|
|
1037
|
-
[29]: #
|
|
1067
|
+
[29]: #terafy
|
|
1038
1068
|
|
|
1039
|
-
[30]: #
|
|
1069
|
+
[30]: #settings
|
|
1040
1070
|
|
|
1041
|
-
[31]: #
|
|
1071
|
+
[31]: #properties-1
|
|
1042
1072
|
|
|
1043
|
-
[32]: #
|
|
1073
|
+
[32]: #events
|
|
1044
1074
|
|
|
1045
|
-
[33]: #
|
|
1075
|
+
[33]: #dom
|
|
1046
1076
|
|
|
1047
|
-
[34]: #
|
|
1077
|
+
[34]: #properties-2
|
|
1048
1078
|
|
|
1049
|
-
[35]: #
|
|
1079
|
+
[35]: #methods
|
|
1050
1080
|
|
|
1051
|
-
[36]: #
|
|
1081
|
+
[36]: #plugins
|
|
1052
1082
|
|
|
1053
|
-
[37]: #
|
|
1083
|
+
[37]: #send
|
|
1054
1084
|
|
|
1055
|
-
[38]: #
|
|
1085
|
+
[38]: #parameters-3
|
|
1056
1086
|
|
|
1057
|
-
[39]: #
|
|
1087
|
+
[39]: #sendraw
|
|
1058
1088
|
|
|
1059
1089
|
[40]: #parameters-4
|
|
1060
1090
|
|
|
1061
|
-
[41]: #
|
|
1091
|
+
[41]: #rpc
|
|
1062
1092
|
|
|
1063
1093
|
[42]: #parameters-5
|
|
1064
1094
|
|
|
1065
|
-
[43]: #
|
|
1095
|
+
[43]: #acceptmessage
|
|
1066
1096
|
|
|
1067
1097
|
[44]: #parameters-6
|
|
1068
1098
|
|
|
1069
|
-
[45]: #
|
|
1099
|
+
[45]: #acceptpostboxes
|
|
1070
1100
|
|
|
1071
|
-
[46]: #
|
|
1101
|
+
[46]: #createprojectstatepatch
|
|
1072
1102
|
|
|
1073
|
-
[47]: #
|
|
1103
|
+
[47]: #parameters-7
|
|
1074
1104
|
|
|
1075
|
-
[48]: #
|
|
1105
|
+
[48]: #applyprojectstatepatchlocal
|
|
1076
1106
|
|
|
1077
1107
|
[49]: #parameters-8
|
|
1078
1108
|
|
|
1079
|
-
[50]: #
|
|
1109
|
+
[50]: #init
|
|
1080
1110
|
|
|
1081
1111
|
[51]: #parameters-9
|
|
1082
1112
|
|
|
1083
|
-
[52]: #
|
|
1113
|
+
[52]: #detectmode
|
|
1084
1114
|
|
|
1085
|
-
[53]: #
|
|
1115
|
+
[53]: #injectcomms
|
|
1086
1116
|
|
|
1087
|
-
[54]: #
|
|
1117
|
+
[54]: #injectstylesheet
|
|
1088
1118
|
|
|
1089
|
-
[55]: #
|
|
1119
|
+
[55]: #injectmethods
|
|
1090
1120
|
|
|
1091
|
-
[56]: #
|
|
1121
|
+
[56]: #debug
|
|
1092
1122
|
|
|
1093
|
-
[57]: #
|
|
1123
|
+
[57]: #parameters-10
|
|
1094
1124
|
|
|
1095
|
-
[58]: #
|
|
1125
|
+
[58]: #set
|
|
1096
1126
|
|
|
1097
1127
|
[59]: #parameters-11
|
|
1098
1128
|
|
|
1099
|
-
[60]: #
|
|
1129
|
+
[60]: #setifdev
|
|
1100
1130
|
|
|
1101
1131
|
[61]: #parameters-12
|
|
1102
1132
|
|
|
1103
|
-
[62]: #
|
|
1133
|
+
[62]: #use
|
|
1104
1134
|
|
|
1105
1135
|
[63]: #parameters-13
|
|
1106
1136
|
|
|
1107
|
-
[64]: #
|
|
1137
|
+
[64]: #mixin
|
|
1108
1138
|
|
|
1109
1139
|
[65]: #parameters-14
|
|
1110
1140
|
|
|
1111
|
-
[66]: #
|
|
1141
|
+
[66]: #toggledevmode
|
|
1112
1142
|
|
|
1113
1143
|
[67]: #parameters-15
|
|
1114
1144
|
|
|
1115
|
-
[68]: #
|
|
1145
|
+
[68]: #togglefocus
|
|
1116
1146
|
|
|
1117
1147
|
[69]: #parameters-16
|
|
1118
1148
|
|
|
1119
|
-
[70]: #
|
|
1149
|
+
[70]: #selectprojectfile
|
|
1120
1150
|
|
|
1121
1151
|
[71]: #parameters-17
|
|
1122
1152
|
|
|
1123
|
-
[72]: #
|
|
1153
|
+
[72]: #getprojectfiles
|
|
1124
1154
|
|
|
1125
1155
|
[73]: #parameters-18
|
|
1126
1156
|
|
|
1127
|
-
[74]: #
|
|
1157
|
+
[74]: #getprojectfile
|
|
1128
1158
|
|
|
1129
1159
|
[75]: #parameters-19
|
|
1130
1160
|
|
|
1131
|
-
[76]: #
|
|
1161
|
+
[76]: #createprojectfile
|
|
1132
1162
|
|
|
1133
1163
|
[77]: #parameters-20
|
|
1134
1164
|
|
|
1135
|
-
[78]: #
|
|
1165
|
+
[78]: #handshake
|
|
1136
1166
|
|
|
1137
|
-
[79]: #
|
|
1167
|
+
[79]: #properties-3
|
|
1138
1168
|
|
|
1139
|
-
[80]: #
|
|
1169
|
+
[80]: #setserververbosity
|
|
1140
1170
|
|
|
1141
|
-
[81]: #
|
|
1171
|
+
[81]: #parameters-21
|
|
1142
1172
|
|
|
1143
1173
|
[82]: #user
|
|
1144
1174
|
|
|
@@ -1240,7 +1270,7 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1240
1270
|
|
|
1241
1271
|
[131]: #parameters-40
|
|
1242
1272
|
|
|
1243
|
-
[132]: #
|
|
1273
|
+
[132]: #uiprogress
|
|
1244
1274
|
|
|
1245
1275
|
[133]: #parameters-41
|
|
1246
1276
|
|
|
@@ -1248,32 +1278,36 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1248
1278
|
|
|
1249
1279
|
[135]: #parameters-42
|
|
1250
1280
|
|
|
1251
|
-
[136]:
|
|
1281
|
+
[136]: #uisplat
|
|
1282
|
+
|
|
1283
|
+
[137]: #parameters-43
|
|
1284
|
+
|
|
1285
|
+
[138]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1252
1286
|
|
|
1253
|
-
[
|
|
1287
|
+
[139]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1254
1288
|
|
|
1255
|
-
[
|
|
1289
|
+
[140]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1256
1290
|
|
|
1257
|
-
[
|
|
1291
|
+
[141]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1258
1292
|
|
|
1259
|
-
[
|
|
1293
|
+
[142]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1260
1294
|
|
|
1261
|
-
[
|
|
1295
|
+
[143]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1262
1296
|
|
|
1263
|
-
[
|
|
1297
|
+
[144]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1264
1298
|
|
|
1265
|
-
[
|
|
1299
|
+
[145]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1266
1300
|
|
|
1267
|
-
[
|
|
1301
|
+
[146]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1268
1302
|
|
|
1269
|
-
[
|
|
1303
|
+
[147]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1270
1304
|
|
|
1271
|
-
[
|
|
1305
|
+
[148]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1272
1306
|
|
|
1273
|
-
[
|
|
1307
|
+
[149]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1274
1308
|
|
|
1275
|
-
[
|
|
1309
|
+
[150]: http://jsonpatch.com
|
|
1276
1310
|
|
|
1277
|
-
[
|
|
1311
|
+
[151]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1278
1312
|
|
|
1279
|
-
[
|
|
1313
|
+
[152]: https://tera-tools.com/api/logs.json
|