@iebh/tera-fy 1.3.2 → 1.4.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 +13 -0
- package/api.md +274 -254
- package/dist/plugin.vue2.es2019.js +1 -1
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +1 -1
- package/lib/projectFile.js +8 -5
- package/lib/terafy.client.js +11 -0
- package/lib/terafy.server.js +14 -0
- package/package.json +2 -2
- package/plugins/vue2.js +1 -1
package/api.md
CHANGED
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
### Table of Contents
|
|
4
4
|
|
|
5
5
|
* [ProjectFile][1]
|
|
6
|
-
* [
|
|
7
|
-
|
|
8
|
-
* [
|
|
9
|
-
* [
|
|
10
|
-
* [
|
|
11
|
-
|
|
12
|
-
* [
|
|
13
|
-
|
|
14
|
-
* [
|
|
15
|
-
* [
|
|
16
|
-
* [
|
|
17
|
-
* [
|
|
18
|
-
* [
|
|
19
|
-
* [
|
|
20
|
-
* [
|
|
21
|
-
* [
|
|
22
|
-
* [
|
|
23
|
-
* [
|
|
24
|
-
|
|
25
|
-
* [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
* [id][2]
|
|
7
|
+
* [name][3]
|
|
8
|
+
* [icon][4]
|
|
9
|
+
* [path][5]
|
|
10
|
+
* [parsedName][6]
|
|
11
|
+
* [Properties][7]
|
|
12
|
+
* [created][8]
|
|
13
|
+
* [createdFormatted][9]
|
|
14
|
+
* [modified][10]
|
|
15
|
+
* [modifiedFormatted][11]
|
|
16
|
+
* [accessed][12]
|
|
17
|
+
* [accessedFormatted][13]
|
|
18
|
+
* [size][14]
|
|
19
|
+
* [sizeFormatted][15]
|
|
20
|
+
* [mime][16]
|
|
21
|
+
* [meta][17]
|
|
22
|
+
* [getContents][18]
|
|
23
|
+
* [setContents][19]
|
|
24
|
+
* [Parameters][20]
|
|
25
|
+
* [getRefs][21]
|
|
26
|
+
* [setRefs][22]
|
|
27
|
+
* [Parameters][23]
|
|
28
|
+
* [serialize][24]
|
|
29
|
+
* [deserialize][25]
|
|
30
|
+
* [Parameters][26]
|
|
31
|
+
* [tera][27]
|
|
32
|
+
* [Parameters][28]
|
|
33
33
|
* [TeraFy][29]
|
|
34
34
|
* [settings][30]
|
|
35
35
|
* [Properties][31]
|
|
@@ -117,122 +117,116 @@
|
|
|
117
117
|
* [Parameters][113]
|
|
118
118
|
* [setProjectLibrary][114]
|
|
119
119
|
* [Parameters][115]
|
|
120
|
-
* [
|
|
120
|
+
* [projectLog][116]
|
|
121
121
|
* [Parameters][117]
|
|
122
|
-
* [
|
|
122
|
+
* [uiAlert][118]
|
|
123
123
|
* [Parameters][119]
|
|
124
|
-
* [
|
|
124
|
+
* [uiSplat][120]
|
|
125
125
|
* [Parameters][121]
|
|
126
|
+
* [uiWindow][122]
|
|
127
|
+
* [Parameters][123]
|
|
126
128
|
|
|
127
129
|
## ProjectFile
|
|
128
130
|
|
|
129
131
|
A project file fetched from TERA
|
|
130
132
|
|
|
131
|
-
### tera
|
|
132
|
-
|
|
133
|
-
Parent TeraClient instance used by all helper functions
|
|
134
|
-
|
|
135
|
-
#### Parameters
|
|
136
|
-
|
|
137
|
-
* `TeraClient`  
|
|
138
|
-
|
|
139
133
|
### id
|
|
140
134
|
|
|
141
135
|
A UUID string representing the unique ID of the file
|
|
142
136
|
|
|
143
|
-
Type: [String][
|
|
137
|
+
Type: [String][124]
|
|
144
138
|
|
|
145
139
|
### name
|
|
146
140
|
|
|
147
141
|
Relative name path (can contain prefix directories) for the human readable file name
|
|
148
142
|
|
|
149
|
-
Type: [String][
|
|
143
|
+
Type: [String][124]
|
|
150
144
|
|
|
151
145
|
### icon
|
|
152
146
|
|
|
153
147
|
CSS class to use as the file icon
|
|
154
148
|
|
|
155
|
-
Type: [String][
|
|
149
|
+
Type: [String][124]
|
|
156
150
|
|
|
157
151
|
### path
|
|
158
152
|
|
|
159
153
|
Full path to the file
|
|
160
154
|
This is also used as the unique identifier within the project
|
|
161
155
|
|
|
162
|
-
Type: [String][
|
|
156
|
+
Type: [String][124]
|
|
163
157
|
|
|
164
158
|
### parsedName
|
|
165
159
|
|
|
166
160
|
An object representing meta file parts of a file name
|
|
167
161
|
|
|
168
|
-
Type: [Object][
|
|
162
|
+
Type: [Object][125]
|
|
169
163
|
|
|
170
164
|
#### Properties
|
|
171
165
|
|
|
172
|
-
* `basename` **[String][
|
|
173
|
-
* `filename` **[String][
|
|
174
|
-
* `ext` **[String][
|
|
175
|
-
* `dirName` **[String][
|
|
166
|
+
* `basename` **[String][124]** The filename + extention (i.e. everything without directory name)
|
|
167
|
+
* `filename` **[String][124]** The file portion of the name (basename without the extension)
|
|
168
|
+
* `ext` **[String][124]** The extension portion of the name (always lower case)
|
|
169
|
+
* `dirName` **[String][124]** The directory path portion of the name
|
|
176
170
|
|
|
177
171
|
### created
|
|
178
172
|
|
|
179
173
|
A date representing when the file was created
|
|
180
174
|
|
|
181
|
-
Type: [Date][
|
|
175
|
+
Type: [Date][126]
|
|
182
176
|
|
|
183
177
|
### createdFormatted
|
|
184
178
|
|
|
185
179
|
A human readable, formatted version of "created"
|
|
186
180
|
|
|
187
|
-
Type: [String][
|
|
181
|
+
Type: [String][124]
|
|
188
182
|
|
|
189
183
|
### modified
|
|
190
184
|
|
|
191
185
|
A date representing when the file was created
|
|
192
186
|
|
|
193
|
-
Type: [Date][
|
|
187
|
+
Type: [Date][126]
|
|
194
188
|
|
|
195
189
|
### modifiedFormatted
|
|
196
190
|
|
|
197
191
|
A human readable, formatted version of "modified"
|
|
198
192
|
|
|
199
|
-
Type: [String][
|
|
193
|
+
Type: [String][124]
|
|
200
194
|
|
|
201
195
|
### accessed
|
|
202
196
|
|
|
203
197
|
A date representing when the file was last accessed
|
|
204
198
|
|
|
205
|
-
Type: [Date][
|
|
199
|
+
Type: [Date][126]
|
|
206
200
|
|
|
207
201
|
### accessedFormatted
|
|
208
202
|
|
|
209
203
|
A human readable, formatted version of "accessed"
|
|
210
204
|
|
|
211
|
-
Type: [String][
|
|
205
|
+
Type: [String][124]
|
|
212
206
|
|
|
213
207
|
### size
|
|
214
208
|
|
|
215
209
|
Size, in bytes, of the file
|
|
216
210
|
|
|
217
|
-
Type: [Number][
|
|
211
|
+
Type: [Number][127]
|
|
218
212
|
|
|
219
213
|
### sizeFormatted
|
|
220
214
|
|
|
221
215
|
A human readable, formatted version of the file size
|
|
222
216
|
|
|
223
|
-
Type: [String][
|
|
217
|
+
Type: [String][124]
|
|
224
218
|
|
|
225
219
|
### mime
|
|
226
220
|
|
|
227
221
|
The associated mime type for the file
|
|
228
222
|
|
|
229
|
-
Type: [String][
|
|
223
|
+
Type: [String][124]
|
|
230
224
|
|
|
231
225
|
### meta
|
|
232
226
|
|
|
233
227
|
Additional meta information for the file
|
|
234
228
|
|
|
235
|
-
Type: [Object][
|
|
229
|
+
Type: [Object][125]
|
|
236
230
|
|
|
237
231
|
### getContents
|
|
238
232
|
|
|
@@ -250,9 +244,9 @@ Overwrite the contents of a file with new content
|
|
|
250
244
|
|
|
251
245
|
#### Parameters
|
|
252
246
|
|
|
253
|
-
* `contents` **(File | [Blob][
|
|
247
|
+
* `contents` **(File | [Blob][128] | [FormData][129] | [Object][125] | [Array][130])** The new file contents
|
|
254
248
|
|
|
255
|
-
Returns **[Promise][
|
|
249
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
256
250
|
|
|
257
251
|
### getRefs
|
|
258
252
|
|
|
@@ -260,7 +254,7 @@ Returns **[Promise][129]** A promise which resolves when the operation has compl
|
|
|
260
254
|
|
|
261
255
|
Fetch the file contents as an array of Reflib refs
|
|
262
256
|
|
|
263
|
-
Returns **[Promise][
|
|
257
|
+
Returns **[Promise][131]<[Array][130]\<Ref>>** An eventual array of RefLib references
|
|
264
258
|
|
|
265
259
|
### setRefs
|
|
266
260
|
|
|
@@ -271,18 +265,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
|
|
|
271
265
|
#### Parameters
|
|
272
266
|
|
|
273
267
|
* `refs`  
|
|
274
|
-
* `Collection` **[Array][
|
|
268
|
+
* `Collection` **[Array][130]\<RefLibRef>** of references for the selected library
|
|
275
269
|
|
|
276
|
-
Returns **[Promise][
|
|
270
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
277
271
|
|
|
278
272
|
### serialize
|
|
279
273
|
|
|
280
|
-
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][
|
|
274
|
+
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][132]
|
|
281
275
|
|
|
282
276
|
Compress a file state down into a serializable entity
|
|
283
277
|
By default this computes a Structured Clone which can be stringified
|
|
284
278
|
|
|
285
|
-
Returns **[Object][
|
|
279
|
+
Returns **[Object][125]** A Structured Clone compatible representation of this ProjectFile instance
|
|
286
280
|
|
|
287
281
|
### deserialize
|
|
288
282
|
|
|
@@ -290,10 +284,18 @@ Restore an entity created with serialize
|
|
|
290
284
|
|
|
291
285
|
#### Parameters
|
|
292
286
|
|
|
293
|
-
* `data` **[Object][
|
|
287
|
+
* `data` **[Object][125]** An input object created via `ProjectFiles.serialize()`
|
|
294
288
|
|
|
295
289
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
296
290
|
|
|
291
|
+
## tera
|
|
292
|
+
|
|
293
|
+
Parent TeraClient instance used by all helper functions
|
|
294
|
+
|
|
295
|
+
### Parameters
|
|
296
|
+
|
|
297
|
+
* `TeraClient`  
|
|
298
|
+
|
|
297
299
|
## TeraFy
|
|
298
300
|
|
|
299
301
|
Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
@@ -302,18 +304,18 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
302
304
|
|
|
303
305
|
Various settings to configure behaviour
|
|
304
306
|
|
|
305
|
-
Type: [Object][
|
|
307
|
+
Type: [Object][125]
|
|
306
308
|
|
|
307
309
|
#### Properties
|
|
308
310
|
|
|
309
|
-
* `devMode` **[Boolean][
|
|
311
|
+
* `devMode` **[Boolean][133]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
|
|
310
312
|
* `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
|
|
311
|
-
* `modeFallback` **[String][
|
|
312
|
-
* `modeTimeout` **[Number][
|
|
313
|
-
* `siteUrl` **[String][
|
|
314
|
-
* `restrictOrigin` **[String][
|
|
315
|
-
* `List` **[Array][
|
|
316
|
-
* `handshakeInterval` **[Number][
|
|
313
|
+
* `modeFallback` **[String][124]** Method to use when all method detection fails
|
|
314
|
+
* `modeTimeout` **[Number][127]** How long entities have in 'detect' mode to identify themselves
|
|
315
|
+
* `siteUrl` **[String][124]** The TERA URL to connect to
|
|
316
|
+
* `restrictOrigin` **[String][124]** URL to restrict communications to
|
|
317
|
+
* `List` **[Array][130]<[String][124]>** of sandbox allowables for the embedded if in embed mode
|
|
318
|
+
* `handshakeInterval` **[Number][127]** Interval in milliseconds when sanning for a handshake
|
|
317
319
|
|
|
318
320
|
### events
|
|
319
321
|
|
|
@@ -325,13 +327,13 @@ Type: Mitt
|
|
|
325
327
|
|
|
326
328
|
DOMElements for this TeraFy instance
|
|
327
329
|
|
|
328
|
-
Type: [Object][
|
|
330
|
+
Type: [Object][125]
|
|
329
331
|
|
|
330
332
|
#### Properties
|
|
331
333
|
|
|
332
334
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
333
335
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
334
|
-
* `popup` **[Window][
|
|
336
|
+
* `popup` **[Window][134]** The popup window context (if `settings.mode == 'popup'`)
|
|
335
337
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
336
338
|
|
|
337
339
|
### methods
|
|
@@ -339,13 +341,13 @@ Type: [Object][123]
|
|
|
339
341
|
List of function stubs mapped from the server to here
|
|
340
342
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
341
343
|
|
|
342
|
-
Type: [Array][
|
|
344
|
+
Type: [Array][130]<[String][124]>
|
|
343
345
|
|
|
344
346
|
### plugins
|
|
345
347
|
|
|
346
348
|
Loaded plugins via Use()
|
|
347
349
|
|
|
348
|
-
Type: [Array][
|
|
350
|
+
Type: [Array][130]\<TeraFyPlugin>
|
|
349
351
|
|
|
350
352
|
### send
|
|
351
353
|
|
|
@@ -353,9 +355,9 @@ Send a message + wait for a response object
|
|
|
353
355
|
|
|
354
356
|
#### Parameters
|
|
355
357
|
|
|
356
|
-
* `message` **[Object][
|
|
358
|
+
* `message` **[Object][125]** Message object to send
|
|
357
359
|
|
|
358
|
-
Returns **[Promise][
|
|
360
|
+
Returns **[Promise][131]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
359
361
|
|
|
360
362
|
### sendRaw
|
|
361
363
|
|
|
@@ -364,7 +366,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
364
366
|
|
|
365
367
|
#### Parameters
|
|
366
368
|
|
|
367
|
-
* `message` **[Object][
|
|
369
|
+
* `message` **[Object][125]** Message object to send
|
|
368
370
|
|
|
369
371
|
### rpc
|
|
370
372
|
|
|
@@ -372,10 +374,10 @@ Call an RPC function in the server instance
|
|
|
372
374
|
|
|
373
375
|
#### Parameters
|
|
374
376
|
|
|
375
|
-
* `method` **[String][
|
|
377
|
+
* `method` **[String][124]** The method name to call
|
|
376
378
|
* `args` **...any** 
|
|
377
379
|
|
|
378
|
-
Returns **[Promise][
|
|
380
|
+
Returns **[Promise][131]\<any>** The resolved output of the server function
|
|
379
381
|
|
|
380
382
|
### acceptMessage
|
|
381
383
|
|
|
@@ -384,7 +386,7 @@ Accept an incoming message
|
|
|
384
386
|
#### Parameters
|
|
385
387
|
|
|
386
388
|
* `rawMessage`  
|
|
387
|
-
* `Raw` **[MessageEvent][
|
|
389
|
+
* `Raw` **[MessageEvent][135]** message event to process
|
|
388
390
|
|
|
389
391
|
### acceptPostboxes
|
|
390
392
|
|
|
@@ -393,27 +395,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
|
|
|
393
395
|
### createProjectStatePatch
|
|
394
396
|
|
|
395
397
|
Create + transmit a new project state patch base on the current and previous states
|
|
396
|
-
The transmitted patch follows the [JSPatch][
|
|
398
|
+
The transmitted patch follows the [JSPatch][136] standard
|
|
397
399
|
This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
|
|
398
400
|
|
|
399
401
|
#### Parameters
|
|
400
402
|
|
|
401
|
-
* `newState` **[Object][
|
|
402
|
-
* `oldState` **[Object][
|
|
403
|
+
* `newState` **[Object][125]** The local projectState to accept
|
|
404
|
+
* `oldState` **[Object][125]** The previous projectState to examine against
|
|
403
405
|
|
|
404
|
-
Returns **[Promise][
|
|
406
|
+
Returns **[Promise][131]** A promise which will resolve when the operation has completed
|
|
405
407
|
|
|
406
408
|
### applyProjectStatePatchLocal
|
|
407
409
|
|
|
408
410
|
Client function which accepts a patch from the server and applies it to local project state
|
|
409
|
-
The patch should follow the [JSPatch][
|
|
411
|
+
The patch should follow the [JSPatch][136] standard
|
|
410
412
|
This function is expected to be sub-classed by a plugin
|
|
411
413
|
|
|
412
414
|
#### Parameters
|
|
413
415
|
|
|
414
|
-
* `patch` **[Array][
|
|
416
|
+
* `patch` **[Array][130]** A JSPatch patch to apply
|
|
415
417
|
|
|
416
|
-
Returns **[Promise][
|
|
418
|
+
Returns **[Promise][131]** A promise which will resolve when the operation has completed
|
|
417
419
|
|
|
418
420
|
### init
|
|
419
421
|
|
|
@@ -422,28 +424,28 @@ This function can only be called once and will return the existing init() worker
|
|
|
422
424
|
|
|
423
425
|
#### Parameters
|
|
424
426
|
|
|
425
|
-
* `options` **[Object][
|
|
427
|
+
* `options` **[Object][125]?** Additional options to merge into `settings` via `set`
|
|
426
428
|
|
|
427
|
-
Returns **[Promise][
|
|
429
|
+
Returns **[Promise][131]<[TeraFy][29]>** An eventual promise which will resovle with this terafy instance
|
|
428
430
|
|
|
429
431
|
### detectMode
|
|
430
432
|
|
|
431
433
|
Populate `settings.mode`
|
|
432
434
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
433
435
|
|
|
434
|
-
Returns **[Promise][
|
|
436
|
+
Returns **[Promise][131]<[String][124]>** A promise which will resolve with the detected mode to use
|
|
435
437
|
|
|
436
438
|
### injectComms
|
|
437
439
|
|
|
438
440
|
Find an existing active TERA server OR initalize one
|
|
439
441
|
|
|
440
|
-
Returns **[Promise][
|
|
442
|
+
Returns **[Promise][131]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
441
443
|
|
|
442
444
|
### injectStylesheet
|
|
443
445
|
|
|
444
446
|
Inject a local stylesheet to handle TERA server functionality
|
|
445
447
|
|
|
446
|
-
Returns **[Promise][
|
|
448
|
+
Returns **[Promise][131]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
447
449
|
|
|
448
450
|
### injectMethods
|
|
449
451
|
|
|
@@ -466,7 +468,7 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
466
468
|
|
|
467
469
|
#### Parameters
|
|
468
470
|
|
|
469
|
-
* `key` **([String][
|
|
471
|
+
* `key` **([String][124] | [Object][125])** Either a single setting key to set or an object to merge
|
|
470
472
|
* `value` **any** The value to set if `key` is a string
|
|
471
473
|
|
|
472
474
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -479,7 +481,7 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
479
481
|
|
|
480
482
|
#### Parameters
|
|
481
483
|
|
|
482
|
-
* `key` **([String][
|
|
484
|
+
* `key` **([String][124] | [Object][125])** Either a single setting key to set or an object to merge
|
|
483
485
|
* `value` **any** The value to set if `key` is a string
|
|
484
486
|
|
|
485
487
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -491,8 +493,8 @@ Include a TeraFy client plugin
|
|
|
491
493
|
#### Parameters
|
|
492
494
|
|
|
493
495
|
* `mod`  
|
|
494
|
-
* `options` **[Object][
|
|
495
|
-
* `The` **[Object][
|
|
496
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
|
|
497
|
+
* `The` **[Object][125]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
|
|
496
498
|
|
|
497
499
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
498
500
|
|
|
@@ -502,8 +504,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
502
504
|
|
|
503
505
|
#### Parameters
|
|
504
506
|
|
|
505
|
-
* `target` **[Object][
|
|
506
|
-
* `source` **[Object][
|
|
507
|
+
* `target` **[Object][125]** Initalied class instance to extend
|
|
508
|
+
* `source` **[Object][125]** Initalized source object to extend from
|
|
507
509
|
|
|
508
510
|
### toggleDevMode
|
|
509
511
|
|
|
@@ -511,7 +513,7 @@ Set or toggle devMode
|
|
|
511
513
|
|
|
512
514
|
#### Parameters
|
|
513
515
|
|
|
514
|
-
* `devModeEnabled` **([String][
|
|
516
|
+
* `devModeEnabled` **([String][124] | [Boolean][133])** Optional boolean to force dev mode (optional, default `'toggle'`)
|
|
515
517
|
|
|
516
518
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
517
519
|
|
|
@@ -522,7 +524,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
522
524
|
|
|
523
525
|
#### Parameters
|
|
524
526
|
|
|
525
|
-
* `isFocused` **([String][
|
|
527
|
+
* `isFocused` **([String][124] | [Boolean][133])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
526
528
|
|
|
527
529
|
### selectProjectFile
|
|
528
530
|
|
|
@@ -534,7 +536,7 @@ This is an pre-requisite step for requireProject()
|
|
|
534
536
|
|
|
535
537
|
* `options`  
|
|
536
538
|
|
|
537
|
-
Returns **[Promise][
|
|
539
|
+
Returns **[Promise][131]** A promise which will resolve if the there is a user and they are logged in
|
|
538
540
|
|
|
539
541
|
### getProjectFiles
|
|
540
542
|
|
|
@@ -542,12 +544,12 @@ Fetch the files associated with a given project
|
|
|
542
544
|
|
|
543
545
|
#### Parameters
|
|
544
546
|
|
|
545
|
-
* `options` **[Object][
|
|
547
|
+
* `options` **[Object][125]** Options which mutate behaviour
|
|
546
548
|
|
|
547
|
-
* `options.autoRequire` **[Boolean][
|
|
548
|
-
* `options.meta` **[Boolean][
|
|
549
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
550
|
+
* `options.meta` **[Boolean][133]** Pull meta information for each file entity (optional, default `true`)
|
|
549
551
|
|
|
550
|
-
Returns **[Promise][
|
|
552
|
+
Returns **[Promise][131]<[Array][130]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
551
553
|
|
|
552
554
|
### getProjectFile
|
|
553
555
|
|
|
@@ -555,9 +557,9 @@ Fetch a project file
|
|
|
555
557
|
|
|
556
558
|
#### Parameters
|
|
557
559
|
|
|
558
|
-
* `path` **[String][
|
|
560
|
+
* `path` **[String][124]** File path to read
|
|
559
561
|
|
|
560
|
-
Returns **[Promise][
|
|
562
|
+
Returns **[Promise][131]<[Blob][128]>** The eventual fetched file as a blob
|
|
561
563
|
|
|
562
564
|
## handshake
|
|
563
565
|
|
|
@@ -565,9 +567,9 @@ Return basic server information as a form of validation
|
|
|
565
567
|
|
|
566
568
|
### Properties
|
|
567
569
|
|
|
568
|
-
* `date` **[Date][
|
|
570
|
+
* `date` **[Date][126]** Server date
|
|
569
571
|
|
|
570
|
-
Returns **[Promise][
|
|
572
|
+
Returns **[Promise][131]<[Object][125]>** Basic promise result
|
|
571
573
|
|
|
572
574
|
## User
|
|
573
575
|
|
|
@@ -575,16 +577,16 @@ User / active session within TERA
|
|
|
575
577
|
|
|
576
578
|
### Properties
|
|
577
579
|
|
|
578
|
-
* `id` **[String][
|
|
579
|
-
* `email` **[String][
|
|
580
|
-
* `name` **[String][
|
|
581
|
-
* `isSubscribed` **[Boolean][
|
|
580
|
+
* `id` **[String][124]** Unique identifier of the user
|
|
581
|
+
* `email` **[String][124]** The email address of the current user
|
|
582
|
+
* `name` **[String][124]** The provided full name of the user
|
|
583
|
+
* `isSubscribed` **[Boolean][133]** Whether the active user has a TERA subscription
|
|
582
584
|
|
|
583
585
|
## getUser
|
|
584
586
|
|
|
585
587
|
Fetch the current session user
|
|
586
588
|
|
|
587
|
-
Returns **[Promise][
|
|
589
|
+
Returns **[Promise][131]<[User][78]>** The current logged in user or null if none
|
|
588
590
|
|
|
589
591
|
## requireUser
|
|
590
592
|
|
|
@@ -594,11 +596,11 @@ This is an pre-requisite step for requireProject()
|
|
|
594
596
|
|
|
595
597
|
### Parameters
|
|
596
598
|
|
|
597
|
-
* `options` **[Object][
|
|
599
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
598
600
|
|
|
599
|
-
* `options.forceRetry` **[Boolean][
|
|
601
|
+
* `options.forceRetry` **[Boolean][133]** Forcabily try to refresh the user state (optional, default `false`)
|
|
600
602
|
|
|
601
|
-
Returns **[Promise][
|
|
603
|
+
Returns **[Promise][131]<[User][78]>** The current logged in user or null if none
|
|
602
604
|
|
|
603
605
|
## Project
|
|
604
606
|
|
|
@@ -608,13 +610,13 @@ Project entry within TERA
|
|
|
608
610
|
|
|
609
611
|
Get the currently active project, if any
|
|
610
612
|
|
|
611
|
-
Returns **[Promise][
|
|
613
|
+
Returns **[Promise][131]<([Project][83] | null)>** The currently active project, if any
|
|
612
614
|
|
|
613
615
|
## getProjects
|
|
614
616
|
|
|
615
617
|
Get a list of projects the current session user has access to
|
|
616
618
|
|
|
617
|
-
Returns **[Promise][
|
|
619
|
+
Returns **[Promise][131]<[Array][130]<[Project][83]>>** Collection of projects the user has access to
|
|
618
620
|
|
|
619
621
|
## setActiveProject
|
|
620
622
|
|
|
@@ -622,7 +624,7 @@ Set the currently active project within TERA
|
|
|
622
624
|
|
|
623
625
|
### Parameters
|
|
624
626
|
|
|
625
|
-
* `project` **([Object][
|
|
627
|
+
* `project` **([Object][125] | [String][124])** The project to set as active - either the full Project object or its ID
|
|
626
628
|
|
|
627
629
|
## requireProject
|
|
628
630
|
|
|
@@ -631,14 +633,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
631
633
|
|
|
632
634
|
### Parameters
|
|
633
635
|
|
|
634
|
-
* `options` **[Object][
|
|
636
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
635
637
|
|
|
636
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
637
|
-
* `options.title` **[String][
|
|
638
|
-
* `options.noSelectTitle` **[String][
|
|
639
|
-
* `options.noSelectBody` **[String][
|
|
638
|
+
* `options.autoSetActiveProject` **[Boolean][133]** After selecting a project set that project as active in TERA (optional, default `true`)
|
|
639
|
+
* `options.title` **[String][124]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
640
|
+
* `options.noSelectTitle` **[String][124]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
|
|
641
|
+
* `options.noSelectBody` **[String][124]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
|
|
640
642
|
|
|
641
|
-
Returns **[Promise][
|
|
643
|
+
Returns **[Promise][131]<[Project][83]>** The active project
|
|
642
644
|
|
|
643
645
|
## selectProject
|
|
644
646
|
|
|
@@ -646,13 +648,13 @@ Prompt the user to select a project from those available
|
|
|
646
648
|
|
|
647
649
|
### Parameters
|
|
648
650
|
|
|
649
|
-
* `options` **[Object][
|
|
651
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
650
652
|
|
|
651
|
-
* `options.title` **[String][
|
|
652
|
-
* `options.allowCancel` **[Boolean][
|
|
653
|
-
* `options.setActive` **[Boolean][
|
|
653
|
+
* `options.title` **[String][124]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
654
|
+
* `options.allowCancel` **[Boolean][133]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
|
|
655
|
+
* `options.setActive` **[Boolean][133]** Also set the project as active when selected (optional, default `false`)
|
|
654
656
|
|
|
655
|
-
Returns **[Promise][
|
|
657
|
+
Returns **[Promise][131]<[Project][83]>** The active project
|
|
656
658
|
|
|
657
659
|
## getProjectState
|
|
658
660
|
|
|
@@ -660,12 +662,12 @@ Return the current, full snapshot state of the active project
|
|
|
660
662
|
|
|
661
663
|
### Parameters
|
|
662
664
|
|
|
663
|
-
* `options` **[Object][
|
|
665
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
664
666
|
|
|
665
|
-
* `options.autoRequire` **[Boolean][
|
|
666
|
-
* `Paths` **[Array][
|
|
667
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
668
|
+
* `Paths` **[Array][130]<[String][124]>** to subscribe to e.g. \['/users/'],
|
|
667
669
|
|
|
668
|
-
Returns **[Promise][
|
|
670
|
+
Returns **[Promise][131]<[Object][125]>** The current project state snapshot
|
|
669
671
|
|
|
670
672
|
## setProjectState
|
|
671
673
|
|
|
@@ -677,13 +679,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
677
679
|
|
|
678
680
|
### Parameters
|
|
679
681
|
|
|
680
|
-
* `path` **([String][
|
|
682
|
+
* `path` **([String][124] | [Array][130]<[String][124]>)** The sub-path within the project state to set
|
|
681
683
|
* `value` **any** The value to set
|
|
682
|
-
* `options` **[Object][
|
|
684
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
683
685
|
|
|
684
|
-
* `options.save` **[Boolean][
|
|
686
|
+
* `options.save` **[Boolean][133]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
685
687
|
|
|
686
|
-
Returns **[Promise][
|
|
688
|
+
Returns **[Promise][131]** A promise which resolves when the operation has been dispatched to the server
|
|
687
689
|
|
|
688
690
|
## setProjectStateDefaults
|
|
689
691
|
|
|
@@ -693,17 +695,17 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
693
695
|
|
|
694
696
|
### Parameters
|
|
695
697
|
|
|
696
|
-
* `path` **([String][
|
|
698
|
+
* `path` **([String][124] | [Array][130]<[String][124]>)** The sub-path within the project state to set
|
|
697
699
|
* `value` **any** The value to set
|
|
698
|
-
* `options` **[Object][
|
|
700
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
699
701
|
|
|
700
|
-
Returns **[Promise][
|
|
702
|
+
Returns **[Promise][131]<[Boolean][133]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
|
|
701
703
|
|
|
702
704
|
## saveProjectState
|
|
703
705
|
|
|
704
706
|
Force-Save the currently active project state
|
|
705
707
|
|
|
706
|
-
Returns **[Promise][
|
|
708
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
707
709
|
|
|
708
710
|
## replaceProjectState
|
|
709
711
|
|
|
@@ -714,9 +716,9 @@ You almost never want to use this function directly, see `setProjectState(path,
|
|
|
714
716
|
|
|
715
717
|
### Parameters
|
|
716
718
|
|
|
717
|
-
* `newState` **[Object][
|
|
719
|
+
* `newState` **[Object][125]** The new state to replace the current state with
|
|
718
720
|
|
|
719
|
-
Returns **[Promise][
|
|
721
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
720
722
|
|
|
721
723
|
## applyProjectStatePatch
|
|
722
724
|
|
|
@@ -724,9 +726,9 @@ Apply a computed `just-diff` patch to the current project state
|
|
|
724
726
|
|
|
725
727
|
### Parameters
|
|
726
728
|
|
|
727
|
-
* `Patch` **[Object][
|
|
729
|
+
* `Patch` **[Object][125]** to apply
|
|
728
730
|
|
|
729
|
-
Returns **[Promise][
|
|
731
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
730
732
|
|
|
731
733
|
## subscribeProjectState
|
|
732
734
|
|
|
@@ -734,7 +736,7 @@ Subscribe to project state changes
|
|
|
734
736
|
This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
|
|
735
737
|
If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
|
|
736
738
|
|
|
737
|
-
Returns **[Promise][
|
|
739
|
+
Returns **[Promise][131]<[Function][137]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
|
|
738
740
|
|
|
739
741
|
## FileFilters
|
|
740
742
|
|
|
@@ -742,10 +744,10 @@ Data structure for a file filter
|
|
|
742
744
|
|
|
743
745
|
### Properties
|
|
744
746
|
|
|
745
|
-
* `library` **[Boolean][
|
|
746
|
-
* `filename` **[String][
|
|
747
|
-
* `basename` **[String][
|
|
748
|
-
* `ext` **[String][
|
|
747
|
+
* `library` **[Boolean][133]?** Restrict to library files only
|
|
748
|
+
* `filename` **[String][124]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
|
|
749
|
+
* `basename` **[String][124]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
|
|
750
|
+
* `ext` **[String][124]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
|
|
749
751
|
|
|
750
752
|
## selectProjectFile
|
|
751
753
|
|
|
@@ -753,20 +755,20 @@ Prompt the user to select a library to operate on
|
|
|
753
755
|
|
|
754
756
|
### Parameters
|
|
755
757
|
|
|
756
|
-
* `options` **[Object][
|
|
758
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
757
759
|
|
|
758
|
-
* `options.title` **[String][
|
|
759
|
-
* `options.hint` **([String][
|
|
760
|
-
* `options.save` **[Boolean][
|
|
760
|
+
* `options.title` **[String][124]** The title of the dialog to display (optional, default `"Select a file"`)
|
|
761
|
+
* `options.hint` **([String][124] | [Array][130]<[String][124]>)?** Hints to identify the file to select in array order of preference
|
|
762
|
+
* `options.save` **[Boolean][133]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
|
|
761
763
|
* `options.filters` **[FileFilters][104]?** Optional file filters
|
|
762
|
-
* `options.allowUpload` **[Boolean][
|
|
763
|
-
* `options.allowRefresh` **[Boolean][
|
|
764
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
765
|
-
* `options.allowCancel` **[Boolean][
|
|
766
|
-
* `options.autoRequire` **[Boolean][
|
|
764
|
+
* `options.allowUpload` **[Boolean][133]** Allow uploading new files (optional, default `true`)
|
|
765
|
+
* `options.allowRefresh` **[Boolean][133]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
766
|
+
* `options.allowDownloadZip` **[Boolean][133]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
767
|
+
* `options.allowCancel` **[Boolean][133]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
768
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
767
769
|
* `options.filter` **[FileFilters][104]?** Optional file filters
|
|
768
770
|
|
|
769
|
-
Returns **[Promise][
|
|
771
|
+
Returns **[Promise][131]<[ProjectFile][1]>** The eventually selected file
|
|
770
772
|
|
|
771
773
|
## setProjectFile
|
|
772
774
|
|
|
@@ -774,10 +776,10 @@ Replace a project files contents
|
|
|
774
776
|
|
|
775
777
|
### Parameters
|
|
776
778
|
|
|
777
|
-
* `path` **[String][
|
|
778
|
-
* `contents` **(File | [Blob][
|
|
779
|
+
* `path` **[String][124]** File path to write
|
|
780
|
+
* `contents` **(File | [Blob][128] | [FormData][129] | [Object][125] | [Array][130])** The new file contents
|
|
779
781
|
|
|
780
|
-
Returns **[Promise][
|
|
782
|
+
Returns **[Promise][131]** A promise which will resolve when the write operation has completed
|
|
781
783
|
|
|
782
784
|
## selectProjectLibrary
|
|
783
785
|
|
|
@@ -785,18 +787,18 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
785
787
|
|
|
786
788
|
### Parameters
|
|
787
789
|
|
|
788
|
-
* `options` **[Object][
|
|
790
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
789
791
|
|
|
790
|
-
* `options.title` **[String][
|
|
791
|
-
* `options.hint` **([String][
|
|
792
|
-
* `options.allowUpload` **[Boolean][
|
|
793
|
-
* `options.allowRefresh` **[Boolean][
|
|
794
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
795
|
-
* `options.allowCancel` **[Boolean][
|
|
796
|
-
* `options.autoRequire` **[Boolean][
|
|
792
|
+
* `options.title` **[String][124]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
793
|
+
* `options.hint` **([String][124] | [Array][130]<[String][124]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
|
|
794
|
+
* `options.allowUpload` **[Boolean][133]** Allow uploading new files (optional, default `true`)
|
|
795
|
+
* `options.allowRefresh` **[Boolean][133]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
796
|
+
* `options.allowDownloadZip` **[Boolean][133]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
797
|
+
* `options.allowCancel` **[Boolean][133]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
798
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
797
799
|
* `options.filters` **[FileFilters][104]?** Optional file filters, defaults to citation library selection only
|
|
798
800
|
|
|
799
|
-
Returns **[Promise][
|
|
801
|
+
Returns **[Promise][131]<[Array][130]\<Ref>>** A collection of references from the selected file
|
|
800
802
|
|
|
801
803
|
## getProjectLibrary
|
|
802
804
|
|
|
@@ -804,15 +806,15 @@ Fetch + convert a project file into a library of citations
|
|
|
804
806
|
|
|
805
807
|
### Parameters
|
|
806
808
|
|
|
807
|
-
* `path` **[String][
|
|
808
|
-
* `options` **[Object][
|
|
809
|
+
* `path` **[String][124]** File path to read, if omitted the contents of `options` are used to guess at a suitable file
|
|
810
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
809
811
|
|
|
810
|
-
* `options.format` **[String][
|
|
811
|
-
* `options.autoRequire` **[Boolean][
|
|
812
|
-
* `options.filter` **[Function][
|
|
813
|
-
* `options.find` **[Function][
|
|
812
|
+
* `options.format` **[String][124]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
813
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
814
|
+
* `options.filter` **[Function][137]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
815
|
+
* `options.find` **[Function][137]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
814
816
|
|
|
815
|
-
Returns **([Promise][
|
|
817
|
+
Returns **([Promise][131]<[Array][130]\<Ref>> | [Promise][131]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
816
818
|
|
|
817
819
|
## setProjectLibrary
|
|
818
820
|
|
|
@@ -820,21 +822,33 @@ Save back a citation library from some input
|
|
|
820
822
|
|
|
821
823
|
### Parameters
|
|
822
824
|
|
|
823
|
-
* `path` **[String][
|
|
824
|
-
* `refs` **([Array][
|
|
825
|
-
* `options` **[Object][
|
|
825
|
+
* `path` **[String][124]?** File path to save back to, if omitted one will be prompted for
|
|
826
|
+
* `refs` **([Array][130]\<RefLibRef> | [Blob][128] | File)?** Collection of references for the selected library or the raw Blob/File
|
|
827
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
828
|
+
|
|
829
|
+
* `options.path` **[String][124]?** Alternate method to specify the path to save as, if omitted one will be prompted for
|
|
830
|
+
* `options.refs` **([Array][130]\<RefLibRef> | [Blob][128] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
831
|
+
* `options.format` **[String][124]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
832
|
+
* `options.autoRequire` **[Boolean][133]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
833
|
+
* `options.hint` **[String][124]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
834
|
+
* `options.filename` **[String][124]?** Suggested filename if path is unspecified
|
|
835
|
+
* `options.title` **[String][124]** Dialog title if path is unspecified and we need to prompt (optional, default `'Save citation library'`)
|
|
836
|
+
* `options.overwrite` **[Boolean][133]** Allow existing file upsert (optional, default `true`)
|
|
837
|
+
* `options.meta` **[Object][125]?** Optional meta data to merge into the file data
|
|
838
|
+
|
|
839
|
+
Returns **[Promise][131]** A promise which resolves when the save operation has completed
|
|
840
|
+
|
|
841
|
+
## projectLog
|
|
842
|
+
|
|
843
|
+
Create a log entry for the currently active project
|
|
826
844
|
|
|
827
|
-
|
|
828
|
-
* `options.refs` **([Array][128]\<RefLibRef> | [Blob][126] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
829
|
-
* `options.format` **[String][122]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
830
|
-
* `options.autoRequire` **[Boolean][131]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
831
|
-
* `options.hint` **[String][122]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
832
|
-
* `options.filename` **[String][122]?** Suggested filename if path is unspecified
|
|
833
|
-
* `options.title` **[String][122]** Dialog title if path is unspecified and we need to prompt (optional, default `'Save citation library'`)
|
|
834
|
-
* `options.overwrite` **[Boolean][131]** Allow existing file upsert (optional, default `true`)
|
|
835
|
-
* `options.meta` **[Object][123]?** Optional meta data to merge into the file data
|
|
845
|
+
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][138] for the full list
|
|
836
846
|
|
|
837
|
-
|
|
847
|
+
### Parameters
|
|
848
|
+
|
|
849
|
+
* `log` **[Object][125]** The log entry to create
|
|
850
|
+
|
|
851
|
+
Returns **[Promise][131]** A promise which resolves when the operation has completed
|
|
838
852
|
|
|
839
853
|
## uiAlert
|
|
840
854
|
|
|
@@ -842,13 +856,13 @@ Display simple text within TERA
|
|
|
842
856
|
|
|
843
857
|
### Parameters
|
|
844
858
|
|
|
845
|
-
* `text` **[String][
|
|
846
|
-
* `options` **[Object][
|
|
859
|
+
* `text` **[String][124]** The text to display
|
|
860
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
847
861
|
|
|
848
|
-
* `options.title` **[String][
|
|
849
|
-
* `options.isHtml` **[Boolean][
|
|
862
|
+
* `options.title` **[String][124]** The title of the alert box (optional, default `'TERA'`)
|
|
863
|
+
* `options.isHtml` **[Boolean][133]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
850
864
|
|
|
851
|
-
Returns **[Promise][
|
|
865
|
+
Returns **[Promise][131]** A promise which resolves when the alert has been dismissed
|
|
852
866
|
|
|
853
867
|
## uiSplat
|
|
854
868
|
|
|
@@ -857,10 +871,10 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
857
871
|
|
|
858
872
|
### Parameters
|
|
859
873
|
|
|
860
|
-
* `content` **(DOMElement | [String][
|
|
861
|
-
* `options` **[Object][
|
|
874
|
+
* `content` **(DOMElement | [String][124] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
|
|
875
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
862
876
|
|
|
863
|
-
* `options.logo` **([Boolean][
|
|
877
|
+
* `options.logo` **([Boolean][133] | [String][124])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
|
|
864
878
|
|
|
865
879
|
## uiWindow
|
|
866
880
|
|
|
@@ -868,69 +882,69 @@ Open a popup window containing a new site
|
|
|
868
882
|
|
|
869
883
|
### Parameters
|
|
870
884
|
|
|
871
|
-
* `url` **[String][
|
|
872
|
-
* `options` **[Object][
|
|
885
|
+
* `url` **[String][124]** The URL to open
|
|
886
|
+
* `options` **[Object][125]?** Additional options to mutate behaviour
|
|
873
887
|
|
|
874
|
-
* `options.width` **[Number][
|
|
875
|
-
* `options.height` **[Number][
|
|
876
|
-
* `options.center` **[Boolean][
|
|
877
|
-
* `options.permissions` **[Object][
|
|
888
|
+
* `options.width` **[Number][127]** The desired width of the window (optional, default `500`)
|
|
889
|
+
* `options.height` **[Number][127]** The desired height of the window (optional, default `600`)
|
|
890
|
+
* `options.center` **[Boolean][133]** Attempt to center the window on the screen (optional, default `true`)
|
|
891
|
+
* `options.permissions` **[Object][125]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
|
|
878
892
|
|
|
879
893
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
880
894
|
|
|
881
895
|
[1]: #projectfile
|
|
882
896
|
|
|
883
|
-
[2]: #
|
|
897
|
+
[2]: #id
|
|
884
898
|
|
|
885
|
-
[3]: #
|
|
899
|
+
[3]: #name
|
|
886
900
|
|
|
887
|
-
[4]: #
|
|
901
|
+
[4]: #icon
|
|
888
902
|
|
|
889
|
-
[5]: #
|
|
903
|
+
[5]: #path
|
|
890
904
|
|
|
891
|
-
[6]: #
|
|
905
|
+
[6]: #parsedname
|
|
892
906
|
|
|
893
|
-
[7]: #
|
|
907
|
+
[7]: #properties
|
|
894
908
|
|
|
895
|
-
[8]: #
|
|
909
|
+
[8]: #created
|
|
896
910
|
|
|
897
|
-
[9]: #
|
|
911
|
+
[9]: #createdformatted
|
|
898
912
|
|
|
899
|
-
[10]: #
|
|
913
|
+
[10]: #modified
|
|
900
914
|
|
|
901
|
-
[11]: #
|
|
915
|
+
[11]: #modifiedformatted
|
|
902
916
|
|
|
903
|
-
[12]: #
|
|
917
|
+
[12]: #accessed
|
|
904
918
|
|
|
905
|
-
[13]: #
|
|
919
|
+
[13]: #accessedformatted
|
|
906
920
|
|
|
907
|
-
[14]: #
|
|
921
|
+
[14]: #size
|
|
908
922
|
|
|
909
|
-
[15]: #
|
|
923
|
+
[15]: #sizeformatted
|
|
910
924
|
|
|
911
|
-
[16]: #
|
|
925
|
+
[16]: #mime
|
|
912
926
|
|
|
913
|
-
[17]: #
|
|
927
|
+
[17]: #meta
|
|
914
928
|
|
|
915
|
-
[18]: #
|
|
929
|
+
[18]: #getcontents
|
|
916
930
|
|
|
917
|
-
[19]: #
|
|
931
|
+
[19]: #setcontents
|
|
918
932
|
|
|
919
|
-
[20]: #
|
|
933
|
+
[20]: #parameters
|
|
920
934
|
|
|
921
|
-
[21]: #
|
|
935
|
+
[21]: #getrefs
|
|
922
936
|
|
|
923
|
-
[22]: #
|
|
937
|
+
[22]: #setrefs
|
|
924
938
|
|
|
925
|
-
[23]: #
|
|
939
|
+
[23]: #parameters-1
|
|
926
940
|
|
|
927
|
-
[24]: #
|
|
941
|
+
[24]: #serialize
|
|
928
942
|
|
|
929
|
-
[25]: #
|
|
943
|
+
[25]: #deserialize
|
|
930
944
|
|
|
931
|
-
[26]: #
|
|
945
|
+
[26]: #parameters-2
|
|
932
946
|
|
|
933
|
-
[27]: #
|
|
947
|
+
[27]: #tera
|
|
934
948
|
|
|
935
949
|
[28]: #parameters-3
|
|
936
950
|
|
|
@@ -1108,42 +1122,48 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1108
1122
|
|
|
1109
1123
|
[115]: #parameters-34
|
|
1110
1124
|
|
|
1111
|
-
[116]: #
|
|
1125
|
+
[116]: #projectlog
|
|
1112
1126
|
|
|
1113
1127
|
[117]: #parameters-35
|
|
1114
1128
|
|
|
1115
|
-
[118]: #
|
|
1129
|
+
[118]: #uialert
|
|
1116
1130
|
|
|
1117
1131
|
[119]: #parameters-36
|
|
1118
1132
|
|
|
1119
|
-
[120]: #
|
|
1133
|
+
[120]: #uisplat
|
|
1120
1134
|
|
|
1121
1135
|
[121]: #parameters-37
|
|
1122
1136
|
|
|
1123
|
-
[122]:
|
|
1137
|
+
[122]: #uiwindow
|
|
1138
|
+
|
|
1139
|
+
[123]: #parameters-38
|
|
1140
|
+
|
|
1141
|
+
[124]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1142
|
+
|
|
1143
|
+
[125]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1124
1144
|
|
|
1125
|
-
[
|
|
1145
|
+
[126]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1126
1146
|
|
|
1127
|
-
[
|
|
1147
|
+
[127]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1128
1148
|
|
|
1129
|
-
[
|
|
1149
|
+
[128]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1130
1150
|
|
|
1131
|
-
[
|
|
1151
|
+
[129]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1132
1152
|
|
|
1133
|
-
[
|
|
1153
|
+
[130]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1134
1154
|
|
|
1135
|
-
[
|
|
1155
|
+
[131]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1136
1156
|
|
|
1137
|
-
[
|
|
1157
|
+
[132]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1138
1158
|
|
|
1139
|
-
[
|
|
1159
|
+
[133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1140
1160
|
|
|
1141
|
-
[
|
|
1161
|
+
[134]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1142
1162
|
|
|
1143
|
-
[
|
|
1163
|
+
[135]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1144
1164
|
|
|
1145
|
-
[
|
|
1165
|
+
[136]: http://jsonpatch.com
|
|
1146
1166
|
|
|
1147
|
-
[
|
|
1167
|
+
[137]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1148
1168
|
|
|
1149
|
-
[
|
|
1169
|
+
[138]: https://tera-tools.com/api/logs.json
|